My python code stuck at master.wait_heartbeat()

Hi everyone,

I’m new to ArduSub and I’ve encountered some problems. I’ve set up a system using a Raspberry Pi 4 with BlueOS installed and a Pixhawk running the Sub firmware. On the BlueOS side, I can receive data from QGroundControl and start the engines as needed. However, I’m having trouble with my Python code, which I copied from the ArduSub Website.

Whenever I use the wait_heartbeat() function, my code gets stuck and never responds until I terminate the process.
I’ve followed the instructions closely, but I can’t seem to figure out why the wait_heartbeat() function is causing the issue. Has anyone experienced this problem or have any suggestions on how to fix it?

Thanks in advance for your help!

Hi @mustafaGulsoy -
You seem to be running the connection code as if you were executing on the topside computer, and not the Raspberry Pi 4 running BlueOS?

See if changing your code to use udpout (rather than udpin) gets things going!

Hi @mustafaGulsoy, welcome to the forum :slight_smile:

  1. You may need to set up an additional MAVLink endpoint in BlueOS for your Python code to connect to, so it’s not conflicting with other services
  2. As @tony-white mentioned, the way you connect depends on the endpoint type you’re connecting to
  3. Those Pymavlink examples were written with a limited system in mind - BlueOS has some additional MAVLink components within the system, so you may need to explicitly wait for a vehicle heartbeat