Re: CC3D - Communication via UART
« Reply #15 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.

Re: CC3D - Communication via UART
« Reply #16 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...

f5soh

  • *****
  • 4572
    • LibrePilot
Re: CC3D - Communication via UART
« Reply #17 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 in your Windows10 computer.


Re: CC3D - Communication via UART
« Reply #18 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!
« Last Edit: August 30, 2017, 03:50:13 pm by NXTNiklas »

f5soh

  • *****
  • 4572
    • LibrePilot
Re: CC3D - Communication via UART
« Reply #19 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

Re: CC3D - Communication via UART
« Reply #20 on: August 30, 2017, 04:27:27 pm »
Thanks!
Going to try it now...

Re: CC3D - Communication via UART
« Reply #21 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?

f5soh

  • *****
  • 4572
    • LibrePilot
Re: CC3D - Communication via UART
« Reply #22 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
[...]

Re: CC3D - Communication via UART
« Reply #23 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 )


f5soh

  • *****
  • 4572
    • LibrePilot
Re: CC3D - Communication via UART
« Reply #24 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

Re: CC3D - Communication via UART
« Reply #25 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!

Re: CC3D - Communication via UART
« Reply #26 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]>
[...]

f5soh

  • *****
  • 4572
    • LibrePilot
Re: CC3D - Communication via UART
« Reply #27 on: August 30, 2017, 05:39:33 pm »
Examples are in /home/pi/code/librepilot/python

Re: CC3D - Communication via UART
« Reply #28 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