Issue with Waiting for Heartbeat Message in UAV Project

My current focus is on developing a one-window GUI that displays sensor data and allows users to send commands through user input. While I have grasped the basics, I have encountered a roadblock that I am unable to overcome.

Specifically, I am facing an issue with waiting for the heartbeat message in my code. I am using the wait_heartbeat() method, but when I start the Pixhawk 6 and run my code directly, I am unable to receive the first heartbeat message. The code seems to be stuck at this line. I have connected the TELEM1 Port to my PC using a TTL to USB Converter.

Interestingly, when I run QGroundControl (QGCS), it successfully connects, and then, after closing QGCS and running my code again, I start receiving the first heartbeat message followed by the rest of the MAVLink messages. (PYTHON)

My suspicion is that QGCS might be sending MAVLink requests that trigger the heartbeat message. However, I am uncertain how to replicate this behavior in my own code.

I would greatly appreciate it if you could provide some insight or guidance on how to resolve this issue.

That’s exactly it. You need to send out heartbeats at 1 Hz in order for the mavlink instance on USB to start MAVLink.

With this pull request there is a parameter to change this behavior:

So I could see only one change and did it manually ‘CONFIG_DRIVERS_CDCACM_AUTOSTART=y’
But i haven’t done custom build and followed by uploading it.

I think that to build, as given, on the website using: make px4_fmu-v6x_default
After which how do I upload it into the Holybro Pixhawk 6X? Is there any steps missing before or to be followed after building and uploading into pixhawk?

You might have to set the parameter it adds.


Do you have any update on this thread?

I am stuck at the same issue (wait_hearbeat).

Thanks :slight_smile: