February 1, 2023, 11:21am
I’m trying to connect raspberry PI with Pixhawk using dronekit.
In console I can connect to the drone with the command below
mavproxy.py --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?
February 1, 2023, 11:36am
Have you tried without using the “ip=” part, just the serial port?
February 1, 2023, 11:37am
Yes, but unfortunately didn’t work.
February 1, 2023, 11:45am
ok, try setting the timeouts parameters to higher values
February 1, 2023, 11:56am
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,
February 1, 2023, 11:58am
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?
February 1, 2023, 12:07pm
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.