Receive message from pymavlink?

Hi! i’m trying to get my companion computer to send messages to my GCS so that they appear on the screen, or even on my remote controller with yaapu telemetry script.

What I’ve done is configure the companion computer, and try to send the message via:

master.mav.statustext_send(mavutil.mavlink.MAV_SEVERITY_CRITICAL, "text".encode())

I can see the message in MAVLink inspector, but, since it is sent from another SystemID, i cannot see it in the GCS.

How do i fix this problem?

Which GCS are you using?
Did you specify the source system and component on the MAVLink master connection (maybe 1,1 or 1,0)?

Hi! Thanks for your comment, I’ve just figured out that my system ID was different from the one on the drone, now the message is seen in the GCS.

However, I am still not able to view the message on my remote and, now that i’ve noticed, in the OSD. The messages in the OSD and through the frsky telemetry seem to be completely the same, coming from the autopilot itself.

So, is there a way to view those messages in the OSD and on the remote?

I’ve figured this question out, so I’m sharing the info for everyone who might have the same question in the future. What I was trying to do is impossible using the standard ardupilot firmware. All statustext messages received by the autopilot are automatically sent to the log file, and nothing else is done with them. So, if you want to implement some non-standard behavior for receiving StatusText messages, you’ll have to edit the ArduPilot source code and re-compile the firmware for yourself. Hope this helps!

You don’t need to update source code for that.
Just input two masters to mavproxy (first one is autopilot, second one is the script) and out all mavlink stream to another endpoint with --out.
You should see the message from the script running on your companion computer on gcs (connect to the connection string specified in --out).
Here is an example:
https://github.com/mustafa-gokce/ardupilot-software-development/blob/main/pymavlink/send-status-text.py

@Mustafa_Gokce Thanks for your reply! I think i’ve already tried something like this, with both system_id and component_id the same as the drone itself, but only using the built-in statustext_send command. As far as I understood the source code of ardupilot, it simply sends the statustext to its log regardless of the system_id, and, if the FC itself needs to send a statustext to the user’s screen or GCS, it uses another function called something like “print out”. I’ll try the code you suggested and update this message. Thanks again!