Open dgorissen opened 8 years ago
That is what its complaining about
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
I found where the definitions are located. What is the procedure to include them in my directory? Can I clone them in there? Thanks, I am a real newbie.
https://github.com/mavlink/mavlink/blob/master/message_definitions/v1.0/ardupilotmega.xml
Thanks a bunch!
On Fri, Oct 7, 2016 at 9:01 AM, majorpr13 notifications@github.com wrote:
That is what its complaining about
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dronekit/dronekit-python/issues/610#issuecomment-252245860, or mute the thread https://github.com/notifications/unsubscribe-auth/ASyBScxbf9IcrF6KRGDbC9jkGIuusL7Pks5qxkKOgaJpZM4H-mq6 .
On Fri, 7 Oct 2016, Lidia wrote:
files. I do see the setup.py file in there. Peter is right in that the XML files are not where they should be, during the cloning there were notices
root@beaglebone:~#/rc/pymavlink(master)$MDEF=$HOME/rc/ardupilot/modules/mavlink/message_defin itions python setup.py build install --user --force -bash: syntax error near unexpected token `master' root@beaglebone:~#
Any other ideas on how to correct this error?
Sorry, I was unclear in my instructions. What I pased in was an excerpt from my shell, supposedly giving context to the command line I was suggesting you run, but apparently confusing you!
The command you should run is:
MDEF=$HOME/rc/ardupilot/modules/mavlink/message_definitions python setup.py build install --user --force
And you should run that in the "pymavlink" github clone's directory. You may need to adjust the location of the directory - in this case I'm using the definitions out of the mavlink submodule of an ardupilot repository.
This command line is setting an environment variable before running python.
Lidia
Peter Barker | Programmer,Sysadmin,Geek. pbarker@barker.dropbear.id.au | You need a bigger hammer. :: It's a hack! Expect underscores! - Nigel Williams
I successfully ran this command inside the pymavlink directory: MDEF=$HOME/rc/ardupilot/modules/mavlink/message_definitions python setup.py build install --user --force
Unfortunately, when I run a SITL or try to connect both a dronekit script along with mission planner I am still receiving this message: Exception in message handler for HEARTBEAT mode 0 not available on mavlink definition
Peter,
Thank you so much for your suggestions. I did NOT successfully run the code indicated: MDEF=$HOME/rc/ardupilot/modules/mavlink/message_definitions python setup.py build install --user --force. I adjusted the directory to fit my setup thus:
MDEF=$HOME/rc/mavlink/pymavlink/message_definitions python setup.py build install --user --force (because I do not have an ardupilot and modules folders). Here is my dilemma, I don'r know enough to move folders around. I might cause more damage than I intend to so far.
My mavlink folder HAS a "message-definitions" folder which for some reason Dronekit does not see and therefore gives me the mode 0 errors. You indicated to run the MDEF=$HOME/rc/mavlink/pymavlink/message_definitions python setup.py build install --user --force command in the pymavlink folder which is inside the mavlink folder. There is NO setup.py file in the mavlink folder. It is buried in the pymavlink so when I run the
MDEF=$HOME/rc/mavlink/pymavlink/message_definitions python setup.py build install --user --force so it cannot see the "message_definitions folder.
root@beaglebone:~# cd mavlink root@beaglebone:~/mavlink# MDEF=$HOME/rc/mavlink/pymavlink/message_definitions python setup.py build install --user --force python: can't open file 'setup.py': [Errno 2] No such file or directory root@beaglebone:~/mavlink# cd pymavlink root@beaglebone:~/mavlink/pymavlink# MDEF=$HOME/rc/mavlink/pymavlink/message_definitions python setup.py build install --user --force No XML message definitions found root@beaglebone:~/mavlink/pymavlink#
Can I just move the message_definitions folder down to pymavlink without breaking anything?
Thanks!
On Mon, Oct 10, 2016 at 1:32 PM, paan2097 notifications@github.com wrote:
I successfully ran this command inside the pymavlink directory: MDEF=$HOME/rc/ardupilot/modules/mavlink/message_definitions python setup.py build install --user --force
Unfortunately, when I run a SITL or try to connect both a dronekit script along with mission planner I am still receiving this message: Exception in message handler for HEARTBEAT mode 0 not available on mavlink definition
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dronekit/dronekit-python/issues/610#issuecomment-252687227, or mute the thread https://github.com/notifications/unsubscribe-auth/ASyBSS8imZi0kytBR76Z51yNmWGoMXsHks5qynbFgaJpZM4H-mq6 .
I got brave and moved it. Still can't get it to work!
On Mon, Oct 10, 2016 at 2:08 PM, Lidia Toscano lidia.toscano@gmail.com wrote:
Peter,
Thank you so much for your suggestions. I did NOT successfully run the code indicated: MDEF=$HOME/rc/ardupilot/modules/mavlink/message_definitions python setup.py build install --user --force. I adjusted the directory to fit my setup thus:
MDEF=$HOME/rc/mavlink/pymavlink/message_definitions python setup.py build install --user --force (because I do not have an ardupilot and modules folders). Here is my dilemma, I don'r know enough to move folders around. I might cause more damage than I intend to so far.
My mavlink folder HAS a "message-definitions" folder which for some reason Dronekit does not see and therefore gives me the mode 0 errors. You indicated to run the MDEF=$HOME/rc/mavlink/pymavlink/message_definitions python setup.py build install --user --force command in the pymavlink folder which is inside the mavlink folder. There is NO setup.py file in the mavlink folder. It is buried in the pymavlink so when I run the
MDEF=$HOME/rc/mavlink/pymavlink/message_definitions python setup.py build install --user --force so it cannot see the "message_definitions folder.
root@beaglebone:~# cd mavlink root@beaglebone:~/mavlink# MDEF=$HOME/rc/mavlink/pymavlink/message_definitions python setup.py build install --user --force python: can't open file 'setup.py': [Errno 2] No such file or directory root@beaglebone:~/mavlink# cd pymavlink root@beaglebone:~/mavlink/pymavlink# MDEF=$HOME/rc/mavlink/pymavlink/message_definitions python setup.py build install --user --force No XML message definitions found root@beaglebone:~/mavlink/pymavlink#
Can I just move the message_definitions folder down to pymavlink without breaking anything?
Thanks!
On Mon, Oct 10, 2016 at 1:32 PM, paan2097 notifications@github.com wrote:
I successfully ran this command inside the pymavlink directory: MDEF=$HOME/rc/ardupilot/modules/mavlink/message_definitions python setup.py build install --user --force
Unfortunately, when I run a SITL or try to connect both a dronekit script along with mission planner I am still receiving this message: Exception in message handler for HEARTBEAT mode 0 not available on mavlink definition
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dronekit/dronekit-python/issues/610#issuecomment-252687227, or mute the thread https://github.com/notifications/unsubscribe-auth/ASyBSS8imZi0kytBR76Z51yNmWGoMXsHks5qynbFgaJpZM4H-mq6 .
@lidia-toscano Are you sure you have your directory path set up right? My ardupilot directory is located directly in my home folder, so I had MDEF=$HOME/ardupilot....
Paan2097,
Not really sure - I am logged in as root@beaglebone
Is that the "HOME" or is "HOME" another command like MDEF? I am not sure what those commands are saying, like MDEF, HOME, rc etcetera. This is all new to me and I am learning but it seems I have to google just about everything. I'm having a bit of a learning curve. lol
On Mon, Oct 10, 2016 at 3:06 PM, paan2097 notifications@github.com wrote:
@lidia-toscano https://github.com/lidia-toscano Are you sure you have your directory path set up right? My ardupilot directory is located directly in my home folder, so I had MDEF=$HOME/ardupilot....
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dronekit/dronekit-python/issues/610#issuecomment-252715807, or mute the thread https://github.com/notifications/unsubscribe-auth/ASyBSdwnUZuu4KKyYwvPMSGe9nnCcRvQks5qyoyxgaJpZM4H-mq6 .
@lidia-toscano Welcome to the world of programming. HOME is the base directory. When you are log in as root@beaglebone, you start at the root directory. A few directories are built in, like HOME/Desktop, /Documents, and /Downloads. So it depends on where you cloned the ardupilot directory. Where in your folder system in the ardupilot folder?
A picture can paint a thousand words: [image: Inline image 1] This resides in an sd card on my beaglebone - so no desktop. I am using WinSCP to see the beaglebone's tree structure. So would it be MDEF=root@beaglebone/mavlink . . . .?
Thanks!
On Mon, Oct 10, 2016 at 5:31 PM, paan2097 notifications@github.com wrote:
@lidia-toscano https://github.com/lidia-toscano Welcome to the world of programming. HOME is the base directory. When you are log in as root@beaglebone, you start at the root directory. A few directories are built in, like HOME/Desktop, /Documents, and /Downloads. So it depends on where you cloned the ardupilot directory. Where in your folder system in the ardupilot folder?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dronekit/dronekit-python/issues/610#issuecomment-252751738, or mute the thread https://github.com/notifications/unsubscribe-auth/ASyBSZCDEQmRhSHxEySq5UP0DZaP7Tikks5qyq6zgaJpZM4H-mq6 .
Hi, still getting errors: root@beaglebone:~/mavlink/pymavlink# MDEF=$HOME/mavlink/message_definitions python setup.py build install --user --force Using message definitions from /root/mavlink/message_definitions Building /root/mavlink/message_definitions/v1.0/paparazzi.xml for protocol 1.0 WARNING: Unable to load XML validator libraries. XML validation will not be performed Building /root/mavlink/message_definitions/v1.0/matrixpilot.xml for protocol 1.0 WARNING: Unable to load XML validator libraries. XML validation will not be performed Building /root/mavlink/message_definitions/v1.0/test.xml for protocol 1.0
This is a little different. Is this something I need to clone as well? Thanks
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.
Which error were you getting @kostkar ? Was it Exception in message handler for HEARTBEAT mode 0 not available on mavlink definition when trying to connect MP and dronekit?
Thanks, that gave me a glimmer of hope but still same issue. = (
On Tue, Oct 11, 2016 at 3:09 PM, kostkar notifications@github.com wrote:
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) setup.py build install
Hope it helps.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dronekit/dronekit-python/issues/610#issuecomment-253014690, or mute the thread https://github.com/notifications/unsubscribe-auth/ASyBSXH81XyrRm-eUobfMjNqleF3MqnKks5qy976gaJpZM4H-mq6 .
I think the issue, even when I clone git clone https://github.com/Ardupilot/ pymavlink from the mavlink folder, the setup.py file is not there, it is in the pymavlink folder. If I try to do the setup.py from mavlink, it cannot find that file and if I do it from the pymavlink folder it cannot find the XML validator because now I am getting that error.
root@beaglebone:~/mavlink# cd ~ root@beaglebone:~# python setup.py build install python: can't open file 'setup.py': [Errno 2] No such file or directory root@beaglebone:~# cd mavlink root@beaglebone:~/mavlink# python setup.py build install python: can't open file 'setup.py': [Errno 2] No such file or directory
This is really frustrating.
root@beaglebone:~/mavlink# cd pymavlink root@beaglebone:~/mavlink/pymavlink# python setup.py build install Using message definitions from /root/mavlink/pymavlink/../message_definitions Building /root/mavlink/pymavlink/../message_definitions/v1.0/paparazzi.xml for protocol 1.0 WARNING: Unable to load XML validator libraries. XML validation will not be performed Building /root/mavlink/pymavlink/../message_definitions/v1.0/matrixpilot.xml for protocol 1.0 WARNING: Unable to load XML validator libraries. XML validation will not be performed
On Tue, Oct 11, 2016 at 3:09 PM, kostkar notifications@github.com wrote:
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) setup.py build install
Hope it helps.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dronekit/dronekit-python/issues/610#issuecomment-253014690, or mute the thread https://github.com/notifications/unsubscribe-auth/ASyBSXH81XyrRm-eUobfMjNqleF3MqnKks5qy976gaJpZM4H-mq6 .
On Tue, 11 Oct 2016, Lidia wrote:
Building /root/mavlink/pymavlink/../message_definitions/v1.0/paparazzi.xml for protocol 1.0 WARNING: Unable to load XML validator libraries. XML validation will not be performed
OK, congratulations, you're living on the bleeding edge.
New prerequisites are present for building the languiage bindings as of yesterday.
You can install the prerequisites with "pip install -r requirements.txt" where requirements.txt is present in the pymavlink root. You might also consider checking the contents of that file and using your operating system's package manager to install.
We've moved to using lxml - which is - no kidding - 10x faster than what we were using!
Please also note that we've also just accepted a PR to add python3 support to pymavlink; there might be some rough edges.
Peter,
I did the pip install -r and it is looking for an argument? What is it?
root@beaglebone:~/mavlink/pymavlink# pip install -r
Usage:
pip install [options]
-r option requires an argument root@beaglebone:~/mavlink/pymavlink#
Checking the contents of that file, what would I be looking for exactly?
Also, when you say "your operating system's package manager" what exactly does that mean? I am using Windows but all of my software is residing on an sd card in the Beaglebone I am trying to work with. Your input is greatly appreciated.
Thanks!!!
On Tue, Oct 11, 2016 at 6:40 PM, Peter Barker notifications@github.com wrote:
On Tue, 11 Oct 2016, Lidia wrote:
Building /root/mavlink/pymavlink/../message_definitions/v1.0/ paparazzi.xml for protocol 1.0 WARNING: Unable to load XML validator libraries. XML validation will not be performed
OK, congratulations, you're living on the bleeding edge.
New prerequisites are present for building the languiage bindings as of yesterday.
You can install the prerequisites with "pip install -r requirements.txt" where requirements.txt is present in the pymavlink root. You might also consider checking the contents of that file and using your operating system's package manager to install.
We've moved to using lxml - which is - no kidding - 10x faster than what we were using!
Please also note that we've also just accepted a PR to add python3 support to pymavlink; there might be some rough edges.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dronekit/dronekit-python/issues/610#issuecomment-253068478, or mute the thread https://github.com/notifications/unsubscribe-auth/ASyBSVD_oMwrnO_82eAHPodrPs7E-9RDks5qzBBCgaJpZM4H-mq6 .
Hi Concerning this: Exception in message handler for HEARTBEAT mode 0 not available on mavlink definition
I am running a simple test from my OdroidXU4 on ubuntu 14.04 MINIMAL_TEST.py from dronekit import connect import time print 'Connecting to vehicle on: %s' % connection_string vehicle = connect('tcp:my.host.computer.ip:5763', wait_ready=True) while True: print " Ch1: %s" % vehicle.channels['1'] time.sleep(0.2)
I do NOT have error message when connecting to my UBUNTU Host running sitl : sim_vehicule.py I do have error message when connecting to my WINDOWS Host running simulator within Mission Planner 1.3.41
Hope this test set can help resolve this issue :-)
Both patricks here are still getting the same where whe connecting to SITL and MP... @patrickpoirier51 let me know if you find a solution please. good luck.
Hey @LorenzMeier ... how about you take some pride in your work and actually TRY this yourself? Show folks how to make it work, or fix the broken code yourself? I have a feeling you really don't WANT PX4 to work well with mavproxy / dronekit for political reasons...
@lidia-toscano There is an argument in what I wrote :-) pip install -r requirements.txt
@paan2097 Oh. You're connecting to a simulated vehicle being run under Mission Planner?!
That's a new one on me. My quick reading tells me it runs the same SITL binaries....
Do you think you could record a telemetry log for me to look at?
This thread is getting very murky.
@expntly has confirmed that modern versions of pymavlink do work against PX4 - which is what this issue was originally about.
If your issue is NOT one of:
argument of type 'NoneType' is not iterable
Exception in message handler for HEARTBEAT
or
>>> Exception in message handler for HEARTBEAT
>>> mode 65536 not available on mavlink definition
then this is almost certainly not a PX4-related issue, and please open a separate issue describing your problem.
If your error message is one of the above, then using a 2.9.0-or-greater version of dronekit-python should fix your problem. Several people have discovered they were running older versions of dronekit-python when they weren't expecting it, often due to package-managers vs pip vs "python setup.py ..." all interacting badly. People have been able to fix this by repeatedly running "pip uninstall dronekit" until it says no package is installed by that name, then installing it again.
If getting the version like this:
>>> import pkg_resources
>>> pkg_resources.get_distribution('dronekit').version
'2.9.0'
>>>
doesn't give you 2.9.0 (or greater), then you are likely to get the PX4-related exceptions (assuming you're running "PX4 Pro" :-) )
@paan2097 I think your issue is a different issue to that covered on this ticket (you're getting "mode 0" not available on heartbeat"). Please open a separate issue. You might also try connecting MAVProxy to the same port you were trying to point dronekit-python at - the output might be illuminating.
@MAVProxyUser We believe that dronekit-python should communicate with "PX4 Pro" just fine now, and any bugs in dronekit-python are our bugs, not @LorenzMeier 's. Various members of the "PX4 Pro" team have been quite helpful trying to get dronekit-python (and pymavlink) working correctly on "PX4 Pro".
I will be closing this issue as "fixed" at some stage soon, unless someone pipes up and says it is still broken. Please don't take this as a "we don't believe you have problems" reaction, and re-read the bit up there about "murky" and "create a new separate issue" :-)
Thanks for the follow-up, as requested I opened : Exception in message handler for HEARTBEAT mode 0 not available on mavlink definition #677
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).
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.