Send MAVlink message to Raspberry Pi through Herelink ground station buttons

Good afternoon all,

I am using a herelink system to communicate with a raspberry pi to transmit video from the hdmi output of the pi to the input of the herelink air unit to display a cameras feed on the ground controller. I am not using a cudepilot or any other flight controller since my project does not require that. I would like to be able to push one of the herelink ground controller buttons (A,B,C,D,home, etc) and receive that specific mavlink message on the raspberry pi. the message does not have to be specific, just distinguishable from heartbeats to trigger further action coded in a raspberry pi program. Here’s what has worked so far:

  • I have got clear images from herelink air to ground controller
  • I have the UART port of the air unit connected to the serial receiver port along with a ground connection to the raspberry pi
  • both are externally powered and functioning properly
  • i can use pymavlink and mavutil to receive a radio status, heartbeat, and scaled pressure.
  • mavproxy connects and seems to be operating properly

When i run the code that is supposed to receive all messages being sent through the serial port, i only see the status, heartbeat, and scaled pressure despite pressing the a or b button, which are both programmed in the solex TX to send a custom MAVlink message. Is there a separate code i need to run on the Raspberry Pi to recognize the mavlink message being sent? Or since i dont have a vehicle connection for not using a flight controller, will it not sent mavlink button messages?

Thank you

Not very sure but maybe you need to specify the target id for the message?
https://ardupilot.org/dev/docs/mavlink-routing-in-ardupilot.html

Thank you for the information Alvin. I have read that link you attached a couple of times and cant seem to figure out how to change the target ID for the message on the herelink ground controller. The only options I see when in the solex TX button mapping is what message do i want to send and what button it is associated with. Is there another/better way to change their message or another app i can use to adjust the MAVlink message being sent? I saw that there is a button mapping adjuster in the settings app but it always warns me that the mapping should only be used for certain commands and not messages in general.

Thanks

The Solex sends the command_long message, which the first 2 parameters specify the target.
You can check the system id and component id by connecting the Herelink to Mission Planner, then check the mavlink inspector.

I really appreciate the advice Alvin. Still a little confused. I have read through a vast majority of the documentation on solex and the mavlink communication protocol but none of those seem to suggest a format for the button mapping within Solex TX. The solex presents the following options when setting a MAVLink command : a command value, and a param value 1 through 7. I will attach a picture of my mavlink inspector through the mission planner but from your last comment, i would assume that the system ID is 42 and the component ID is 250? Vehicle 42 is the air unit and vehicle 255 is the ground unit. So, assuming im right, the 42 would be the input for the param1 value and 250 for the param2 value. I’m still unsure what I should make the command value and do I set one of the other param values to send a single number or letter? I tried a bunch of combinations with no success to what my raspberry pi is reading.

Thanks again.

I have just revise the things again. It seems that the mavlink button in Herelink is sending COMMAND_LONG which contains MAV_CMD [Command]
If you want to print something in GCS, it has to be STATUSTEXT [Message]. So looks like it is not so straight forward as I thought in my last reply.

Maybe you can try to trigger something in mavlink system with commands. Then read the change and produce respond according to the button pressed.

Thank you for the information. I now see some of the formats for mav_cmd and I believe that I can send a command but nothing still shows up on the raspberry pi message reader. You mentioned that my best path of action would be to trigger something and read the change but Im not sure what code to use to read the change from the pi. I have been using mavutil from pymavlink and the command master.recv_match(blocking = True) to read in messages after receiving a heartbeat. Is there a different program or code I can run on the raspberry pi to read in commands without a cubepilot or px4? just straight from the herelink air units uart port? Thanks

I am not sure because I have never build a system without autopilot. This seems like becoming an Ardupilot/mavlink problem.

You may try to add some dummy messages into the system (eg: servo/relay/flight mode). Then trigger the flight mode/non-physically-existing servo/relay with commands.

Hello all, I wanted to follow up on the above for anyone else looking to get information without ardupilot. I was never able to get any solid information from the UART port so I instead used the Sbus, built an inverter circuit to invert the output, and read that in with a couple libraries and serial port communication. Hopefully more additional support will be added in the future to communicate with UART since that can be much more in depth and provide more data then Sbus could.