0

I am trying to run a helloworld.py using dronekit on my solo drone.

My environment is

dronekit==2.7.0
pymavlink>=2.0.0

When I try to run the simple helloworld example the vehicle.connect() timesout.

ERROR LOADING MAVNATIVE - falling back to python implementation
Connecting to udpin:0.0.0.0:14550...
>>> Link timeout, no heartbeat in last 5 seconds
>>> No heartbeat in 30 seconds, aborting.
Traceback (most recent call last):
  File "/log/solo-script/helloworld.py", line 9, in <module>
    vehicle = connect("0.0.0.0:14550", wait_ready=True, baud=57600, heartbeat_timeout=30)
  File "/log/solo-script/env/lib/python2.7/site-packages/dronekit/__init__.py", line 2787, in connect
    vehicle.initialize(rate=rate, heartbeat_timeout=heartbeat_timeout)
  File "/log/solo-script/env/lib/python2.7/site-packages/dronekit/__init__.py", line 2060, in initialize
    raise APIException('Timeout in initializing connection.')
dronekit.APIException: Timeout in initializing connection.

I have tried downgrading pymavlink to 1.1.73 as well, but did not work. Any help is much appreciated.

Jerome Anthony
  • 7,823
  • 2
  • 40
  • 31

2 Answers2

0

I had the same problem.After downgrading pymavlink also build older version of dronekit. I used 2.0.0 and its worked.Here is a link for dronekit versions: https://github.com/dronekit/dronekit-python/releases

Eldar
  • 11
  • 2
0

Make sure you are using python2. Dronekit uses pymavlink and dronekit code have been changed to python3 but pymavlink has given me a lot of issues in python3 and it works fine in python2.

It looks like an issue in vehicle.initialize method however try to set wait_ready=False, If it works then your solo it's not sending the parameters that dronekit is expecting:

 # Default parameters when calling wait_ready() or wait_ready(True).
 self._default_ready_attrs = ['parameters', 'gps_0', 'armed', 'mode', 'attitude']

Try updating your solo firmware and getting the latest dronekit and pymavlink versions from their git repo.

epinal
  • 1,415
  • 1
  • 13
  • 27