Request NAMED_VALUE_FLOAT at different intervals

I’ve been recently trying to log some custom data wirelessly via a radio connected to USB with the PC running a pymavlink script that parses the data and puts it into a CSV file. I send my data by using a Lua script with the gcs:send_named_float() command

The issue I’m consistently having is that the data flash log contains around 800 data points, however, the data received in my script is only around 200 data points.

Is this normal behavior when using radios like this? I hypothesize that the messages are coming in too fast from the FC and I can’t parse them fast enough in python, so I tried to change the message interval for command ID #251 (NAMED_VALUE_FLOAT’s ID), but it fails to set the interval and mission planner prints “No ap_message for mavlink id (251)”. Is there a way to change NAMED_VALUE_FLOAT’s message interval?

Since you use Lua script, it’s completely up to you to chose the interval right in the script.
Let’s say your script looks like

function update () -- periodic function that will be called
  gcs:send_named_float(...)
  return update, 1000
end

return update, 1000

In this case the value will be send each second, and if you chance 1000 to 500 it would be each 500ms.

1 Like