Emir0723
(Emir)
February 1, 2023, 11:21am
1
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
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?
GRS26
(GRS26)
February 1, 2023, 11:36am
2
Have you tried without using the “ip=” part, just the serial port?
Emir0723
(Emir)
February 1, 2023, 11:37am
3
Yes, but unfortunately didn’t work.
GRS26
(GRS26)
February 1, 2023, 11:45am
4
ok, try setting the timeouts parameters to higher values
Emir0723
(Emir)
February 1, 2023, 11:56am
5
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,
GRS26
(GRS26)
February 1, 2023, 11:58am
6
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?
Emir0723
(Emir)
February 1, 2023, 12:07pm
7
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.