LibrePilot Forum

Users => Vehicles - MultiRotors => Topic started by: osuarez on February 01, 2016, 09:14:51 am

Title: CC3D - Communication via UART
Post by: osuarez on February 01, 2016, 09:14:51 am
Hi everyone,

I am doing some tests to read the telemetry of the CC3D board using the UART channel of a RaspberryPi.
Does anyone know where to find info about how this communication work?
What is the structure of the data I should wait?
By now I can receive some characters from the CC3D, but they make no sense.
My configuration is 57600, 8 bits, 1 stop bit.

Thanks in advanced,
Omar
Title: Re: CC3D - Communication via UART
Post by: f5soh on February 01, 2016, 10:37:54 am
Here is python examples how to communicate using Uavtalk:
https://bitbucket.org/alessiomorale/librepilot/commits/812babc4406e8063f04997e9f5214efe66ca4cac?at=next

https://librepilot.atlassian.net/wiki/display/LPDOC/UavTalk

Similar question here: https://forum.librepilot.org/index.php?topic=718.0
Title: Re: CC3D - Communication via UART
Post by: osuarez on February 02, 2016, 08:31:04 am
Thanks for the links!!

I will take a look to see how this protocol works.

Title: Re: CC3D - Communication via UART
Post by: sonium on May 15, 2016, 08:38:15 pm
Hi, I'm trying the same thing (except the UART is the oplink modem). So far I found code from Taulabs [1]. It seems to establish a connection using /shell.py -s -b 38400 /dev/ttyAMA0 (use ssh -X to connect to RPi) but then if I try doing anything meaningful I get error about mismatching packet sizes.
Please let me know if you get any further.

[1]
https://github.com/TauLabs/TauLabs/tree/09af5415bb393e6e31f8cadc151f9d40e9b7e380/python

Edit:

The helpful folks at Taulabs pointed me to [2] and recommended trying minimal_connection.py it still has however more or less simlar problems.

[2] https://github.com/d-ronin/dRonin/tree/next/python
Title: Re: CC3D - Communication via UART
Post by: hwh on May 15, 2016, 10:38:39 pm
Hi, I'm trying the same thing (except the UART is the oplink modem). So far I found code from Taulabs [1]. It seems to establish a connection using /shell.py -s -b 38400 /dev/ttyAMA0 (use ssh -X to connect to RPi) but then if I try doing anything meaningful I get error about mismatching packet sizes.
...
If you didn't modify the TauLabs code to understand LibrePilot UAV objects you'd get that.  You can't take code from a project and expect it to work with a different project without modifications.  That code gets it's idea of how the UAV objects are formatted by looking up in the same source tree it's in.
Title: Re: CC3D - Communication via UART
Post by: sonium on May 15, 2016, 10:42:22 pm
ok, that explains some things I have seen. But not the mismatching packed sizes, since UAVtalk should be standardized on that, or?
Title: Re: CC3D - Communication via UART
Post by: hwh on May 15, 2016, 11:22:49 pm
No, each UAVobject has it's own size.  A packet that transfers just a single value like sonaraltitude is much smaller than one that transfers a larger number of settings like mixersettings.

edit:  Looking at it with the LP definitions loaded it seems like every object is exactly 2 bytes off in size.  That implies that there is probably some difference in the overall packet structure or protocol.  Maybe an added or deleted field.
Title: Re: CC3D - Communication via UART
Post by: sonium on May 16, 2016, 10:07:05 am
I got the code from alessiomorale working, here a run-down of basic steps on RPi2:

Code: [Select]
git clone https://bitbucket.org/alessiomorale/librepilot
cd librepilot
git checkout amorale/lp_python_porting
sudo apt-get install qt5-default qt5-qmake qtbase5-dev-tools
make uavobjects_python_install

Now I have my OPlink modem connected to the raspberry pi via the UART pins and power it via the +5V and GND pins from the GPIO. If the OPlink mini is powered externaly the +5V should left be disconnected. On the Oplink side the connected port is set to 'Telemetry'.

there is an example code in librepilot/ground/pyuavtalk/examples/example.py however the UART speed needs to be adjusted in line 58:
Code: [Select]
        serPort = serial.Serial(_port, 38400, timeout=.5)   # this was the default set in the GCS Oplink tab

Time to try, model powered by flight battery:
Code: [Select]
pi@raspberrypi:~/librepilot/ground/pyuavtalk/examples $ python example.py /dev/ttyAMA0 o
Opening Port "/dev/ttyAMA0"
Creating UavTalk
Starting ObjectManager
INFO:root:Importing UAVObject definitions from /usr/local/lib/python2.7/dist-packages/openpilot/uavtalk/../uavobjects
Starting UavTalk
Request fast periodic updates for AttitudeState
Install Observer for AttitudeState updates

 . Rate: 6.4 Hz   RPY: 13.134890 11.503283 -10.094670
Stopping UavTalk
Title: Re: CC3D - Communication via UART
Post by: richardche_au on May 24, 2016, 01:55:01 pm
I tried the same branch but without success on RPI2:

pi@raspi:~/workspace/librepilot/ground/pyuavtalk/examples $ python example.py /dev/ttyAMA0 o
Opening Port "/dev/ttyAMA0"
Creating UavTalk
Starting ObjectManager
INFO:root:Importing UAVObject definitions from /usr/local/lib/python2.7/dist-packages/openpilot/uavtalk/../uavobjects
Starting UavTalk
Request fast periodic updates for AttitudeState
Install Observer for AttitudeState updates

:( waiting forever here

eventually had to stop using ^C
^C
Stopping UavTalk

used the default 38400 baud rate.

Ported the python script (pyuavtalk) to my laptop (Windows 10) and result is the same.
python examples\example.py COM3 o
Note: COM3 is the serial port of oplink mini. [ Given sonium has "/dev/ttyAMA0" on RPI2, I suppose I should use the normal serial port COM3?] 

By moving the Oplink mini (micro-usb connector) to my laptop, Librepilot GCS on windows 10 instantly establishes telemetry link. However I notice that Librepilot GCS uses port "USB oplinkmini" instead of "COM3" for communicating with oplink on the drone. If I change it to "COM3", I cannot get telemetry link. Does this mean there is another layer (driver?) in the Librepilot GCS which drives the COM3 port? Can anyone please explain the logic behind?

Thanks
Richard


Title: Re: CC3D - Communication via UART
Post by: f5soh on May 25, 2016, 01:48:30 am
python only supports serial port.

You should enable the VCP port as telemetry (move the Telemetry setting from USB Hid to VCP)

Next connect using /dev/ttyACM0 for Rpi

(https://forum.librepilot.org/index.php?action=dlattach;topic=749.0;attach=3179)
Title: Re: CC3D - Communication via UART
Post by: richardche_au on May 25, 2016, 09:28:08 am
Thanks for the detailed instruction, got it working!

Slightly different set up though:
1. On Win 10 GCS connects to drone via Oplink mini, in the H/W config tab keep the config as is (HID telemetry and VCP disabled) - this way I can connect via USB telemetry as usual. I tried as shown in the picture but seems I cannot get USB telemetry working on my revo board for some reason. Maybe it does not matter what you have on the revo board?

2. in the oplink tab, change VCP port to serial

3. Plug in oplink mini (usb) onto RPI;

4. use ttyACM0 on RPI and run the example script untouched.

Hurrah!

Thank you F5soh again for sharing.
Title: Re: CC3D - Communication via UART
Post by: sallyc on August 04, 2017, 07:35:24 pm
Hello, I didn't use OPlink modem, and i did what the previous says and still waiting forever. Can anyone help me?
Title: Re: CC3D - Communication via UART
Post by: sallyc on August 25, 2017, 04:37:07 pm
I got the code from alessiomorale working, here a run-down of basic steps on RPi2:

Code: [Select]
git clone https://bitbucket.org/alessiomorale/librepilot
cd librepilot
git checkout amorale/lp_python_porting
sudo apt-get install qt5-default qt5-qmake qtbase5-dev-tools
make uavobjects_python_install

Now I have my OPlink modem connected to the raspberry pi via the UART pins and power it via the +5V and GND pins from the GPIO. If the OPlink mini is powered externaly the +5V should left be disconnected. On the Oplink side the connected port is set to 'Telemetry'.

there is an example code in librepilot/ground/pyuavtalk/examples/example.py however the UART speed needs to be adjusted in line 58:
Code: [Select]
        serPort = serial.Serial(_port, 38400, timeout=.5)   # this was the default set in the GCS Oplink tab

Time to try, model powered by flight battery:
Code: [Select]
pi@raspberrypi:~/librepilot/ground/pyuavtalk/examples $ python example.py /dev/ttyAMA0 o
Opening Port "/dev/ttyAMA0"
Creating UavTalk
Starting ObjectManager
INFO:root:Importing UAVObject definitions from /usr/local/lib/python2.7/dist-packages/openpilot/uavtalk/../uavobjects
Starting UavTalk
Request fast periodic updates for AttitudeState
Install Observer for AttitudeState updates

 . Rate: 6.4 Hz   RPY: 13.134890 11.503283 -10.094670
Stopping UavTalk

I got root:error: CRC ERROR
does any one knows about this?
Title: Re: CC3D - Communication via UART
Post by: TheOtherCliff on August 25, 2017, 07:36:49 pm
One possibility is that you have mismatched UAVO definitions.

If you change a UAVO / xml file you must recompile all code that knows about that UAVO, including however you manage UAVO IDs for any external project.  And data files that contain old OAVOs will not work with new definitions...
Title: Re: CC3D - Communication via UART
Post by: sallyc on August 26, 2017, 12:51:30 pm
no i did not change the UAVO definitions... :'(
Title: Re: CC3D - Communication via UART
Post by: TheOtherCliff on August 26, 2017, 05:44:51 pm
If there is corruption somewhere in the link (example: a bit changed in the serial stream: RF?) you would get that?  If you use a higher level hardware or any protocol that sends things in packets, and a packet gets dropped you would get that?

If your code is otherwise working, I would be tempted to move on.  Perhaps it will become more obvious.

Of course you can debug it, find where that string is generated and add some more print statements or run it in a debugger.
Title: Re: CC3D - Communication via UART
Post by: NXTNiklas on August 30, 2017, 01:01:43 pm
Hello all!

I have run into the same problem... I assume this is, because I calibrated the CC3D over the GCS on Windows 10 and tried to read telemetry over the Raspberry Pi. I do get objects send, but they're all unknown. Is there a way to get the UAV Objects from Win 10 GCS to Linux?
Acctually I dont fancy running the GCS on the Pi (Zero), because of OpenGL and other reasons...

An Import/Export function would be great...
Title: Re: CC3D - Communication via UART
Post by: f5soh on August 30, 2017, 01:56:24 pm
The host (linux/OSX/Windows) is not a issue, you just need the Pi and your windows computer running the same software version.

This mean as example, update your Pi with latest/current next branch and install this next build LibrePilot-16.09+r461-gd1ab06e_i686.exe (https://drive.google.com/open?id=0B5d_9OcqQj8BMVFka3lrVnZzb2M) in your Windows10 computer.

Title: Re: CC3D - Communication via UART
Post by: NXTNiklas on August 30, 2017, 03:21:43 pm
Thanks for the fast answer!

I tried:
Code: [Select]
git checkout next
after download I run
Code: [Select]
pi@raspberrypi:~/code/librepilot $ make uavobjects
- LibrePilot UAVObject Generator -
Done: processed 115 XML files and generated 115 objects with no ID collisions. Total size of the data fields is 4867 bytes.
generating gcs code
- LibrePilot UAVObject Generator -
Done: processed 115 XML files and generated 115 objects with no ID collisions. Total size of the data fields is 4867 bytes.
generating flight code
- LibrePilot UAVObject Generator -
Done: processed 115 XML files and generated 115 objects with no ID collisions. Total size of the data fields is 4867 bytes.
generating python code
- LibrePilot UAVObject Generator -
Done: processed 115 XML files and generated 115 objects with no ID collisions. Total size of the data fields is 4867 bytes.
generating matlab code
- LibrePilot UAVObject Generator -
Done: processed 115 XML files and generated 115 objects with no ID collisions. Total size of the data fields is 4867 bytes.
generating java code
- LibrePilot UAVObject Generator -
Done: processed 115 XML files and generated 115 objects with no ID collisions. Total size of the data fields is 4867 bytes.
generating wireshark code

and
Code: [Select]
pi@raspberrypi:~/code/librepilot $ make uavobjects_python_install
- LibrePilot UAVObject Generator -
required UAVObject definitions not found! /home/pi/code/librepilot.xml
Makefile:207: recipe for target 'uavobjects_python_install' failed
make: *** [uavobjects_python_install] Error 2
-> I don't know how to fix this..

But when running the example file I still get the following:
Code: [Select]
pi@raspberrypi:~/code/pyuavtalk/examples $ python example.py /dev/ttyAMA0 o
Opening Port "/dev/ttyAMA0"
Creating UavTalk
Starting ObjectManager
INFO:root:Importing UAVObject definitions from /usr/local/lib/python2.7/dist-packages/openpilot/uavtalk/../uavobjects
Starting UavTalk
Request fast periodic updates for AttitudeState
Install Observer for AttitudeState updates

^C
Stopping UavTalk
pi@raspberrypi:~/code/pyuavtalk/examples $ python example.py /dev/ttyAMA0 o
Opening Port "/dev/ttyAMA0"
Creating UavTalk
Starting ObjectManager
INFO:root:Importing UAVObject definitions from /usr/local/lib/python2.7/dist-packages/openpilot/uavtalk/../uavobjects
Starting UavTalk
Request fast periodic updates for AttitudeState
Install Observer for AttitudeState updates

WARNING:root:Rec UNKNOWN Obj 7421c7ba
ERROR:root:INVALID Packet Size
WARNING:root:Rec UNKNOWN Obj 1a163914
WARNING:root:Rec UNKNOWN Obj 5146807c
WARNING:root:Rec UNKNOWN Obj 85c20346
WARNING:root:Rec UNKNOWN Obj 7421c7ba
ERROR:root:INVALID Packet Size
WARNING:root:Rec UNKNOWN Obj 265ba97e
WARNING:root:Rec UNKNOWN Obj 7421c7ba
ERROR:root:INVALID Packet Size
WARNING:root:Rec UNKNOWN Obj 7421c7ba
ERROR:root:INVALID Packet Size
WARNING:root:Rec UNKNOWN Obj 7421c7ba
ERROR:root:INVALID Packet Size
WARNING:root:Rec UNKNOWN Obj f1ec270e
WARNING:root:Rec UNKNOWN Obj 7421c7ba
ERROR:root:INVALID Packet Size
WARNING:root:Rec UNKNOWN Obj 373871f0
WARNING:root:Rec UNKNOWN Obj 0
WARNING:root:Rec UNKNOWN Obj 7421c7ba
ERROR:root:INVALID Packet Size
WARNING:root:Rec UNKNOWN Obj 7421c7ba
ERROR:root:INVALID Packet Size
WARNING:root:Rec UNKNOWN Obj 1a163914
WARNING:root:Rec UNKNOWN Obj 5146807c
WARNING:root:Rec UNKNOWN Obj 7421c7ba
ERROR:root:INVALID Packet Size
WARNING:root:Rec UNKNOWN Obj 85c20346
WARNING:root:Rec UNKNOWN Obj 7421c7ba
ERROR:root:INVALID Packet Size
WARNING:root:Rec UNKNOWN Obj 7421c7ba
ERROR:root:INVALID Packet Size
WARNING:root:Rec UNKNOWN Obj 7421c7ba
ERROR:root:INVALID Packet Size
WARNING:root:Rec UNKNOWN Obj f1ec270e
WARNING:root:Rec UNKNOWN Obj 7421c7ba
ERROR:root:INVALID Packet Size
WARNING:root:Rec UNKNOWN Obj 7421c7ba
ERROR:root:INVALID Packet Size
WARNING:root:Rec UNKNOWN Obj 373871f0
WARNING:root:Rec UNKNOWN Obj 0
WARNING:root:Rec UNKNOWN Obj 7421c7ba
ERROR:root:INVALID Packet Size
WARNING:root:Rec UNKNOWN Obj 7421c7ba
ERROR:root:INVALID Packet Size
WARNING:root:Rec UNKNOWN Obj 1a163914
WARNING:root:Rec UNKNOWN Obj 5146807c
WARNING:root:Rec UNKNOWN Obj 85c20346
WARNING:root:Rec UNKNOWN Obj 7421c7ba
ERROR:root:INVALID Packet Size
WARNING:root:Rec UNKNOWN Obj 265ba97e
WARNING:root:Rec UNKNOWN Obj 7421c7ba
WARNING:root:Rec UNKNOWN Obj 7421c7ba
ERROR:root:CRC ERROR
ERROR:root:CRC ERROR
ERROR:root:CRC ERROR
ERROR:root:CRC ERROR
ERROR:root:CRC ERROR
ERROR:root:CRC ERROR
ERROR:root:CRC ERROR
ERROR:root:CRC ERROR
ERROR:root:CRC ERROR
ERROR:root:CRC ERROR
ERROR:root:CRC ERROR
ERROR:root:CRC ERROR
ERROR:root:CRC ERROR
ERROR:root:CRC ERROR
ERROR:root:CRC ERROR

Thanks for your help!
Title: Re: CC3D - Communication via UART
Post by: f5soh on August 30, 2017, 04:21:19 pm
Still not working because your Pi side is not correctly updated, current python code still using previous version while the board connected is indeed running the next branch firmware.

Code: [Select]
git checkout next
git pull
make all_clean
make uavobjects
make uavobjects_python_install
Title: Re: CC3D - Communication via UART
Post by: NXTNiklas on August 30, 2017, 04:27:27 pm
Thanks!
Going to try it now...
Title: Re: CC3D - Communication via UART
Post by: NXTNiklas on August 30, 2017, 04:33:48 pm
Code: [Select]
make uavobjects_python_install
Still exits with error... Is there a way to downgrade the firmware of the CC3D, so it can be used with python?
Title: Re: CC3D - Communication via UART
Post by: f5soh on August 30, 2017, 04:45:34 pm
Did you made a "git pull" ?

Try "git log" and check if you have the same output.
Code: [Select]
git log
commit d1ab06e5b0cef938ca90608ef655c8652cb9a5d0
Merge: a542372 819653b
Author: Marcus Proest <[email protected]>
Date:   Wed Jul 19 21:38:40 2017 +0000
[...]
Title: Re: CC3D - Communication via UART
Post by: NXTNiklas on August 30, 2017, 04:51:23 pm
unfortunatly not...
Code: [Select]
commit b05f7d96a51273a6f4fa316fd731568864aad317
Merge: e00c0fad6 105219e71
Author: Lalanne Laurent <[email protected]>
Date:   Wed Oct 26 20:15:16 2016 +0000

    Merged in corvusvcorax/librepilot (pull request #349)

    LP-438: fixed connection manager ugly side effects (triggered by LP-430 )

commit 105219e7146aa0d43df120ac69ef8e2a20796816
Author: Eric Price <[email protected]>
Date:   Tue Oct 25 20:44:59 2016 +0200

    LP-438: fixed connection manager ugly side effects (triggered by LP-430 )

Title: Re: CC3D - Communication via UART
Post by: f5soh on August 30, 2017, 04:56:46 pm
So try again the following, assuming the Pi is connected to internet of course...

Code: [Select]
git checkout next
git pull
make all_clean
make uavobjects
make uavobjects_python_install
Title: Re: CC3D - Communication via UART
Post by: NXTNiklas on August 30, 2017, 04:58:46 pm
Did exactly what you told me...
It says I'm already up to date...
Still the same, so I'm going to start fresh with:
Code: [Select]
git clone https://bitbucket.org/librepilot/librepilot.git
Will try it after installation is complete!
Thanks!
Title: Re: CC3D - Communication via UART
Post by: NXTNiklas on August 30, 2017, 05:24:56 pm
I did this:
Code: [Select]
git clone https://bitbucket.org/librepilot/librepilot.git
Cloning into 'librepilot'...
remote: Counting objects: 168914, done.
remote: Compressing objects: 100% (40272/40272), done.
remote: Total 168914 (delta 129069), reused 165187 (delta 125474)
Receiving objects: 100% (168914/168914), 257.64 MiB | 1.19 MiB/s, done.
Resolving deltas: 100% (129069/129069), done.
Checking out files: 100% (9079/9079), done.
then your steps:
Code: [Select]
pi@raspberrypi:~/code $ cd librepilot/
pi@raspberrypi:~/code/librepilot $ git checkout next
Already on 'next'
Your branch is up-to-date with 'origin/next'.
pi@raspberrypi:~/code/librepilot $ git pull
Already up-to-date.
pi@raspberrypi:~/code/librepilot $ make all_clean
 CLEAN      build
After this make uavobjects worked:
Code: [Select]
pi@raspberrypi:~/code/librepilot $ make uavobjects
Info: creating stash file /home/pi/code/librepilot/build/uavobjgenerator/.qmake.                                                                                                             stash
compiling ../../ground/uavobjgenerator/main.cpp
compiling ../../ground/uavobjgenerator/uavobjectparser.cpp
compiling ../../ground/uavobjgenerator/generators/generator_io.cpp
compiling ../../ground/uavobjgenerator/generators/java/uavobjectgeneratorjava.cp                                                                                                             p
compiling ../../ground/uavobjgenerator/generators/flight/uavobjectgeneratorfligh                                                                                                             t.cpp
compiling ../../ground/uavobjgenerator/generators/arduino/uavobjectgeneratorardu                                                                                                             ino.cpp
compiling ../../ground/uavobjgenerator/generators/gcs/uavobjectgeneratorgcs.cpp
compiling ../../ground/uavobjgenerator/generators/matlab/uavobjectgeneratormatla                                                                                                             b.cpp
compiling ../../ground/uavobjgenerator/generators/python/uavobjectgeneratorpytho                                                                                                             n.cpp
compiling ../../ground/uavobjgenerator/generators/wireshark/uavobjectgeneratorwi                                                                                                             reshark.cpp
compiling ../../ground/uavobjgenerator/generators/generator_common.cpp
linking uavobjgenerator
- LibrePilot UAVObject Generator -
Done: processed 121 XML files and generated 121 objects with no ID collisions. T                                                                                                             otal size of the data fields is 5100 bytes.
generating gcs code
warning: firmwareiapobj.xml: Ignoring reserved property Description.
warning: oplinkstatus.xml: Ignoring reserved property Description.
- LibrePilot UAVObject Generator -
Done: processed 121 XML files and generated 121 objects with no ID collisions. T                                                                                                             otal size of the data fields is 5100 bytes.
generating flight code
- LibrePilot UAVObject Generator -
Done: processed 121 XML files and generated 121 objects with no ID collisions. T                                                                                                             otal size of the data fields is 5100 bytes.
generating arduino code
- LibrePilot UAVObject Generator -
Done: processed 121 XML files and generated 121 objects with no ID collisions. T                                                                                                             otal size of the data fields is 5100 bytes.
generating python code
- LibrePilot UAVObject Generator -
Done: processed 121 XML files and generated 121 objects with no ID collisions. T                                                                                                             otal size of the data fields is 5100 bytes.
generating matlab code
- LibrePilot UAVObject Generator -
Done: processed 121 XML files and generated 121 objects with no ID collisions. T                                                                                                             otal size of the data fields is 5100 bytes.
generating java code
- LibrePilot UAVObject Generator -
Done: processed 121 XML files and generated 121 objects with no ID collisions. T                                                                                                             otal size of the data fields is 5100 bytes.
generating wireshark code
Even this created no error...
Code: [Select]
pi@raspberrypi:~/code/librepilot $
pi@raspberrypi:~/code/librepilot $ make uavobjects_python_install
make[1]: Entering directory '/home/pi/code/librepilot'
- LibrePilot UAVObject Generator -
Done: processed 121 XML files and generated 121 objects with no ID collisions. T                                                                                                             otal size of the data fields is 5100 bytes.
generating python code
make[1]: Leaving directory '/home/pi/code/librepilot'
running build
running build_py
creating build
creating build/lib.linux-armv6l-2.7
creating build/lib.linux-armv6l-2.7/librepilot
copying librepilot/__init__.py -> build/lib.linux-armv6l-2.7/librepilot
creating build/lib.linux-armv6l-2.7/librepilot/uavtalk
copying librepilot/uavtalk/uavobject.py -> build/lib.linux-armv6l-2.7/librepilot                                                                                                             /uavtalk
copying librepilot/uavtalk/flighttelemetrystats.py -> build/lib.linux-armv6l-2.7                                                                                                             /librepilot/uavtalk
copying librepilot/uavtalk/__init__.py -> build/lib.linux-armv6l-2.7/librepilot/                                                                                                             uavtalk
copying librepilot/uavtalk/objectManager.py -> build/lib.linux-armv6l-2.7/librep                                                                                                             ilot/uavtalk
copying librepilot/uavtalk/uavtalk.py -> build/lib.linux-armv6l-2.7/librepilot/u                                                                                                             avtalk
copying librepilot/uavtalk/connectionManager.py -> build/lib.linux-armv6l-2.7/li                                                                                                             brepilot/uavtalk
creating build/lib.linux-armv6l-2.7/librepilot/uavobjects
copying librepilot/uavobjects/barosensor.py -> build/lib.linux-armv6l-2.7/librep                                                                                                             ilot/uavobjects
copying librepilot/uavobjects/auxmagsensor.py -> build/lib.linux-armv6l-2.7/libr                                                                                                             epilot/uavobjects
[...]
byte-compiling /usr/local/lib/python2.7/dist-packages/librepilot/uavtalk/objectM                                                                                                             anager.py to objectManager.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/librepilot/uavtalk/uavtalk                                                                                                             .py to uavtalk.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/librepilot/uavtalk/connect                                                                                                             ionManager.py to connectionManager.pyc
running install_egg_info
Writing /usr/local/lib/python2.7/dist-packages/LibrePilot_UAVTalk-1.0.egg-info
After this I check for the example code, but couldn't find it...
Code: [Select]
pi@raspberrypi:~/code/librepilot $ cd ground
pi@raspberrypi:~/code/librepilot/ground $ ls
gcs  ground.pro  uavobjgenerator  usagetracker
pi@raspberrypi:~/code/librepilot/ground $ cd ../
pi@raspberrypi:~/code/librepilot $ cd ../
So i executed the old example:
Code: [Select]
pi@raspberrypi:~/code $ cd pyuavtalk/
pi@raspberrypi:~/code/pyuavtalk $ ls
build  examples  openpilot  pyuavtalk.iml  setup.py
pi@raspberrypi:~/code/pyuavtalk $ cd examples
pi@raspberrypi:~/code/pyuavtalk/examples $ ls
example.py  example_readlog.py  example_tuning.py
pi@raspberrypi:~/code/pyuavtalk/examples $ python example.py /dev/ttyAMA0 o
Opening Port "/dev/ttyAMA0"
Creating UavTalk
Starting ObjectManager
INFO:root:Importing UAVObject definitions from /usr/local/lib/python2.7/dist-pac                                                                                                             kages/openpilot/uavtalk/../uavobjects
Starting UavTalk
Request fast periodic updates for AttitudeState
Install Observer for AttitudeState updates

WARNING:root:Rec UNKNOWN Obj 265ba97e
WARNING:root:Rec UNKNOWN Obj 7421c7ba
WARNING:root:Rec UNKNOWN Obj 7421c7ba
WARNING:root:Rec UNKNOWN Obj 7421c7ba
WARNING:root:Rec UNKNOWN Obj f1ec270e
WARNING:root:Rec UNKNOWN Obj 7421c7ba
WARNING:root:Rec UNKNOWN Obj 7421c7ba
WARNING:root:Rec UNKNOWN Obj 373871f0

ERROR:root:INVALID Packet Size
still unknown objects..

btw git log returns this:
Code: [Select]
commit d1ab06e5b0cef938ca90608ef655c8652cb9a5d0
Merge: a542372d5 819653bcb
Author: Marcus Proest <[email protected]>
Date:   Wed Jul 19 21:38:40 2017 +0000

    Merged in marcus_proest/librepilot/LP-543-fix-tea-ci-secrets-file (pull request #456)

    LP-543 updated .drone.yml and regenerated .drone.sec for Tea-CI

    Approved-by: Marcus Proest <[email protected]>
    Approved-by: Lalanne Laurent <[email protected]>
    Approved-by: Philippe Renon <[email protected]>

commit a542372d5f71b55ae7b3c968f826dd09b8974ea3
Merge: d031352cd b75637e6f
Author: Brian Webb <[email protected]>
Date:   Wed Jul 19 21:35:25 2017 +0000

    Merged in webbbn/librepilot/LP-540-add-support-for-ms5607-and-ms5637 (pull request #449)

    LP-540 Adds support for ms5607 and ms5637 to the ms5611 driver and renames it ms56xx.

    Approved-by: Lalanne Laurent <[email protected]>
    Approved-by: Alessio Morale <[email protected]>
    Approved-by: Philippe Renon <[email protected]>
    Approved-by: Jan NIJS <[email protected]>
    Approved-by: Brian Webb <[email protected]>
[...]
Title: Re: CC3D - Communication via UART
Post by: f5soh on August 30, 2017, 05:39:33 pm
Examples are in /home/pi/code/librepilot/python
Title: Re: CC3D - Communication via UART
Post by: NXTNiklas on August 30, 2017, 05:43:49 pm
You're awsome mate!

Thank you very much it works now!

Code: [Select]
python example.py /dev/ttyAMA0 o
Opening Port "/dev/ttyAMA0"
Creating UavTalk
Starting ObjectManager
INFO:root:Importing UAVObject definitions from /usr/local/lib/python2.7/dist-packages/librepilot/uavtalk/../uavobjects
Starting UavTalk
Starting ConnectionManager
Connecting... Connected
Getting all Data
ERROR:root:INVALID Packet Size. Should be: 47 got 8936 for obj FlightTelemetryStats
ERROR:root:INVALID Packet Size. Should be: 58 got 32116 for obj ManualControlCommand
ERROR:root:INVALID Packet Size. Should be: 18 got 0 for obj Meta[StabilizationSettingsBank3]
ERROR:root:INVALID Packet Size. Should be: 42 got 0 for obj AttitudeState
ERROR:root:INVALID Packet Size. Should be: 18 got 8252 for obj Meta[AccelGyroSettings]
ERROR:root:INVALID Packet Size. Should be: 42 got 0 for obj AttitudeState
ERROR:root:INVALID Packet Size. Should be: 42 got 9878 for obj AttitudeState
ERROR:root:INVALID Packet Size. Should be: 42 got 8252 for obj AttitudeState
WARNING:root:Rec UNKNOWN Obj 0
Request fast periodic updates for AttitudeState
Install Observer for AttitudeState updates

   Rate: 0.1 Hz   RPY: 2.003046 -3.421967 134.551773
 . Rate: 0.1 Hz   RPY: 2.005497 -3.421069 134.556595
   Rate: 0.1 Hz   RPY: 2.005834 -3.420865 134.556213
 . Rate: 0.1 Hz   RPY: 2.005699 -3.419216 134.556412
   Rate: 0.1 Hz   RPY: 2.005625 -3.419538 134.557800
 . Rate: 0.1 Hz   RPY: 2.005082 -3.418016 134.559006
   Rate: 0.1 Hz   RPY: 2.003489 -3.417472 134.559601
 . Rate: 0.1 Hz   RPY: 2.003320 -3.419203 134.561737
   Rate: 0.1 Hz   RPY: 2.001394 -3.419319 134.561600