dronekit-python: Exception in message handler for heartbeat

I found 3 threads about this but no authorative answer/solution:

https://groups.google.com/forum/#!topic/drones-discuss/tQQjc0_5Eng https://discuss.dronekit.io/t/issue-with-vehicle-state-py-and-rover/307 https://discuss.dronekit.io/t/missionplanner-and-dronekit-floods-console-with-errors/287

Im running dronekit 2.4.0 on an odroid UX4, connected with an FTDI cable to the Pixhawk Telem 2 port (dronekit is reading straight from /dev/ttyUSB0). Pixhawk is running APM copter 3.3.3 and the 3DR Radio is on Telem 1. Serial 4/5 is also in use (Taranis telemetry).

I notice the following messages being spammed to std err/out on the odroid. Otherwise it does seem to be working properly (both reading the data via dronekit and apm planner 2.0).

...
argument of type 'NoneType' is not iterable
Exception in message handler for HEARTBEAT
argument of type 'NoneType' is not iterable
Exception in message handler for HEARTBEAT
argument of type 'NoneType' is not iterable
Exception in message handler for HEARTBEAT
...

It seems the issue is something to do with the telem1 & telem2 streams interfering with each other somehow? Some guidance as to what the correct usage pattern is would be appreciated. Or confirm if this is a bug.

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Reactions: 3
  • Comments: 75 (22 by maintainers)

Commits related to this issue

Most upvoted comments

@lidia-toscano In my experience, the XML definitions pymavlink is looking for are located in the Mavlink library, unless you generate your own and give pymavlink a reference to their location. The easiest and most thorough solution that I have found is to install mavlink by cloning from https://github.com/mavlink/mavlink, and updating the submodules or navigating into the pymavlink directory (inside the mavlink directory) and cloning from https://github.com/ArduPilot/pymavlink. Running the setup should complete successfully here.

I tried the following today and it worked for me:

pip unistall pymavlink (multiple times) pip unistall dronekit pip install dronekit (this added pymavlink back in but not the version I want) git clone https://github.com/mavlink/mavlink cd mavlink git clone https://github.com/Ardupilot/pymavlink (by using clone in the mavlink directory the build can find the message definitions and there is no need for extra work) cd pymavlink setup.py build install

Hope it helps.

On Thu, 6 Oct 2016, lidia-toscano wrote:

Hi, I am having the same issue and I’ve tried following the instructions: Then follow these instructions

  1. git clone https://github.com/Ardupilot/pymavlink
  2. cd into the pymavlink directory
  3. python setup.py build install --force --user

The pymavlink repo doesn’t contain the message definitions, but does include the code to generate language binding from the message definitions. You may specify the location of the message definitions using the “MDEF” environment variable.

e.g. pbarker@bluebottle:~/rc/pymavlink(master)$ MDEF=$HOME/rc/ardupilot/modules/mavlink/message_definitions python setup.py build install --user --force