WARNING:dronekit:Link timeout, no heartbeat in last 5 seconds

Hi there, i’ve been facing a real issue about dronekit timeout and until now i did’nt find a way to handle that. Can any one help me about that issue? I’m using a navio2 with a raspberry pi 3.

WARNING:dronekit:Link timeout, no heartbeat in last 5 seconds
ERROR:dronekit.mavlink:Exception in MAVLink input loop
Traceback (most recent call last):
File “/usr/local/lib/python3.6/dist-packages/dronekit/mavlink.py”, line 211, in mavlink_thread_in
fn(self)
File “/usr/local/lib/python3.6/dist-packages/dronekit/init.py”, line 1371, in listener
self._heartbeat_error)
dronekit.APIException: No heartbeat in 30 seconds, aborting.
Traceback (most recent call last):
File “Land_mission.py”, line 82, in
vehicle = connectMyCopter()
File “Land_mission.py”, line 23, in connectMyCopter
vehicle = connect(connection_string, wait_ready=True)
File “/usr/local/lib/python3.6/dist-packages/dronekit/init.py”, line 3166, in connect
vehicle.initialize(rate=rate, heartbeat_timeout=heartbeat_timeout)
File “/usr/local/lib/python3.6/dist-packages/dronekit/init.py”, line 2275, in initialize
raise APIException(‘Timeout in initializing connection.’)
dronekit.APIException: Timeout in initializing connection.

Hi @ornestpompidou,

Welcome to the community forum!

You may try to change the timeout parameter to 120 seconds or more in the _ _ init _ _.py file from Dronekit. As I know, this issue might appear because it takes approximately 2 minutes to download the parameters at the default baud rate.

HI @liudmila.slepova,

Thanks for the reply, but i changed it as you told me, and i still get the same issue. I even tried using 200 s instead of 120 s but it didn’t solve the problem.

Is there any other way to handle it?

pi@navio:~/Ornest $ sudo python Land_mission.py --connect 127.0.0.1:14550
WARNING:dronekit:Link timeout, no heartbeat in last 5 seconds
ERROR:dronekit.mavlink:Exception in MAVLink input loop
Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/dronekit/mavlink.py”, line 211, in mavlink_thread_in
fn(self)
File “/usr/local/lib/python2.7/dist-packages/dronekit/init.py”, line 1371, in listener
self._heartbeat_error)
APIException: No heartbeat in 200 seconds, aborting.
Traceback (most recent call last):
File “Land_mission.py”, line 81, in
vehicle = connectMyCopter()
File “Land_mission.py”, line 20, in connectMyCopter
vehicle = connect(connection_string, wait_ready=True)
File “/usr/local/lib/python2.7/dist-packages/dronekit/init.py”, line 3166, in connect
vehicle.initialize(rate=rate, heartbeat_timeout=heartbeat_timeout)
File “/usr/local/lib/python2.7/dist-packages/dronekit/init.py”, line 2275, in initialize
raise APIException(‘Timeout in initializing connection.’)
dronekit.APIException: Timeout in initializing connection.

PS: It works well when i simulate a sitl using dronekit-sitl and mission planner.

@liudmila.slepova,

I’ve been looking in so many communities now, and they said that it works with previous version of arducopter(3.5.5, 3.6). So is it possible to get pre-build previous version of ardupilot ? I’ll be glad if you help me in this way.

Thanks in advance.

Hi @ornestpompidou,

You can download the previous stable binary files from the ArduPilot build server. After that, you need to declare the path to the custom binary in /etc/systemd/system/ardupilot.service. Please check this part of the guide that explains how to launch custom binary.

Hi @liudmila.slepova,

Thanks for the help, i’ve already done that, but the issue i now get is that every time i restart the RPI, it automaticaly boots on the arducopter that i don’t want to use. And because of that i can’t be sure of wich one i’m using when i try to make calibration. I’ll provide the different step i used, but do you know how i can disable the arducopter that came with the navio definitely so that it will only boot on the one i build? I built mine using copter-3.6.11.

Hi @ornestpompidou,

I suggest checking whether the default ArduCopter is enabled on boot by running sudo emlidtool ardupilot. In the boot section, please select disable.