No heartbeat while trying to connect Pixhawk with Dronekit

Hi everyone,

I’m trying to connect raspberry PI with Pixhawk using dronekit.

In console I can connect to the drone with the command below --master=/dev/serial0 --baudrate 921600 --aircraft MyCopter

But I’m getting no heartbeat when I try to connect with the python examples below

vehicle = dronekit.connect(ip="/dev/ttyAMA0", baud=921600, wait_ready=True)
vehicle = dronekit.connect(ip="/dev/serial0", baud=921600, wait_ready=True)

I couldn’t find a way to connect. Can you help me out please?

Have you tried without using the “ip=” part, just the serial port?

Yes, but unfortunately didn’t work.

ok, try setting the timeouts parameters to higher values

I add “heartbeat_timeout=30” but I think it didn’t change the timeout time. Am I doing it correct?

vehicle = connect('/dev/ttyAMA0', baud=921600, wait_ready=True, heartbeat_timeout=30)

Unfortunately there is still no change for now, if it’s correct,

There are two parameters, the one you asked and just timeout.You are doing it correctly. What exactly is showing after you try to connect?

Same output as before. (dronekit:Link timeout, no heartbeat in last 5 seconds)

I finally solved it! I saw in another page that it could be related to bluetooth so I disabled it by simply adding “dtoverlay=disable-bt” into the boot/config.txt in raspberry. Then I reboot the raspberry and it can connect to the Pixhawk now.

Thank you for the help.