LUA and Mavilnk with Orange Cube+

Hi everyone!

I’m asking for help from the community in writing a script. I’m stuck and can’t figure out how to do it, as I’m a beginner in programming. I have a device that feeds data to UART 2 (of Cube+) 100 times per second. This is a sequence of characters (numbers, it doesn’t matter). I can output them in the form of a message to the MissionPlanner screen, but I need to transmit them to the ground station via the Mavlink protocol. I slightly changed the example from GitHub to output the message, but I can’t figure out how to transmit it via Mavlink. Please help with advice, I’ve been struggling with this task for a week. The code that I currently have working just to output information to the screen is as follows:
– Lua script to write and read from a serial

And I can see on screen my data:


Please, help me. Thank you all in advance!

Look for gcs:send_named_float

1 Like

Thank you. I will try to do it

snf
As I understand, the value is not displayed on the screen, but can it be intercepted? And how can it be processed?
So, I don’t need to combine my data with Mavlink then?

named float is a mavlink message Messages (common) · MAVLink Developer Guide
MP will process the message and add the value to the status window with the name.

1 Like

I found that I can use MAVLINK_MSG_ID_NAMED_VALUE_FLOAT. But I don’t exactly know that it is right…

Correct. You can intercept those messages

1 Like

Super!
Andras, thank you so much! I was getting really confused with all the MAVLink messages. I’ll try your solution. Thanks again!