user49798: TL;DR does someone know of a advance and reliable/redudent USB protocol for communicating between a raspberry pi and Arduino due (native port)
I am trying to learn how to build a little robot which I hope could be autonomous at some point. In terms of hardware I am using an Arduino Due and a raspberry pi 3. The former is connected to DC motors, servos, ultrasonic sensors, light sensors, etc... The pi is responsible for running the picam and sending controlles from an Xbox controller to the Arduino as well as running a django web interface. 
Long story short, I am trying to have python reliably communicating with the Arduino over serialusb (using the native port) but with no luck. The simple communication protocol shown in the Arduino example is too weak. I found a GitHub project named arduino-robust-serial https://github.com/araffin/arduino-robust-serial which worked at first but for reasons which are quite long to discuss here was not enough.
My question is as follows: does someone know of a reliable serial protocol around which could be used to have a raspberry pi communicating with an Arduino over usb?
I hope I'm not too vague. But looking online I'm struggling to find resources regarding Arduino which are not beginner blinking light examples. 
Thx

user49798: Ok, after quite some time looking for something that would allow me to easily control an arduino with the raspberry pi, I found the FIRMATA protocol which allows one to communicate with the arduino through many languages. (a snippet from the github page for SEO purposes is shown at the end of this message).
From there I looked for through the python frameworks, and had a long chat with MrYsLab who helped me integrate the arduino Due to his pymata and pymataExpress frameworks. They work quite well and enable you to have a script that quickly and efficiently communicates with the arduino. I'm sure proper frameworks from ros.org or gobot are better. But pymata worked for me hence my answer to my own question.

processing 


https://github.com/firmata/processing 
http://funnel.cc 

python 


https://github.com/firmata/pyduino 
https://github.com/lupeke/python-firmata 
https://github.com/tino/pyFirmata 
https://github.com/MrYsLab/PyMata 
https://github.com/MrYsLab/pymata-aio 

perl


https://github.com/ntruchsess/perl-firmata 
https://github.com/rcaputo/rx-firmata 

ruby


https://github.com/hardbap/firmata 
https://github.com/PlasticLizard/rufinol 
http://funnel.cc 

clojure


https://github.com/nakkaya/clodiuno 
https://github.com/peterschwarz/clj-firmata 

javascript


https://github.com/jgautier/firmata 
http://breakoutjs.com 
https://github.com/rwldrn/johnny-five 

java


https://github.com/4ntoine/Firmata 
https://github.com/kurbatov/firmata4j 
https://github.com/reapzor/FiloFirmata 

.NET


https://github.com/SolidSoils/Arduino 
http://www.imagitronics.org/projects/firmatanet/ 
https://github.com/wbadry/FirmataCSharpClientClass 

Flash/AS3


http://funnel.cc 
http://code.google.com/p/as3glue/ 

PHP


https://bitbucket.org/ThomasWeinert/carica-firmata 
https://github.com/oasynnoum/phpmake_firmata

Haskell


http://hackage.haskell.org/package/hArduino

iOS


https://github.com/jacobrosenthal/iosfirmata

Dart


https://github.com/nfrancois/firmata

Max/MSP


http://www.maxuino.org/

Elixir 


https://github.com/kfatehi/firmata

Modelica


https://www.wolfram.com/system-modeler/libraries/model-plug/ 

golang


https://github.com/kraman/go-firmata

Qt/QML


https://github.com/callaa/qfirmata 

Android/Kotlin


https://github.com/xujiaao/android-firmata

Smalltalk 


https://github.com/pharo-iot/Firmata



49798: <p>TL;DR does someone know of a advance and reliable/redudent USB protocol for communicating between a raspberry pi and Arduino due (native port)</p>

<p>I am trying to learn how to build a little robot which I hope could be autonomous at some point. In terms of hardware I am using an Arduino Due and a raspberry pi 3. The former is connected to DC motors, servos, ultrasonic sensors, light sensors, etc... The pi is responsible for running the picam and sending controlles from an Xbox controller to the Arduino as well as running a django web interface. 
Long story short, I am trying to have python reliably communicating with the Arduino over serialusb (using the native port) but with no luck. The simple communication protocol shown in the Arduino example is too weak. I found a GitHub project named arduino-robust-serial <a href="https://github.com/araffin/arduino-robust-serial" rel="nofollow noreferrer">https://github.com/araffin/arduino-robust-serial</a> which worked at first but for reasons which are quite long to discuss here was not enough.</p>

<p>My question is as follows: does someone know of a reliable serial protocol around which could be used to have a raspberry pi communicating with an Arduino over usb?</p>

<p>I hope I'm not too vague. But looking online I'm struggling to find resources regarding Arduino which are not beginner blinking light examples. </p>

<p>Thx</p>
 49798: <p>Ok, after quite some time looking for something that would allow me to easily control an arduino with the raspberry pi, I found the <a href="https://github.com/firmata/protocol" rel="nofollow noreferrer">FIRMATA protocol</a> which allows one to communicate with the arduino through many languages. (a snippet from the github page for SEO purposes is shown at the end of this message).</p>

<p>From there I looked for through the python frameworks, and had a long chat with <a href="https://github.com/MrYsLab" rel="nofollow noreferrer">MrYsLab</a> who helped me integrate the arduino Due to his <a href="https://github.com/MrYsLab/pymata-aio" rel="nofollow noreferrer">pymata</a> and <a href="https://github.com/MrYsLab/pymata-express" rel="nofollow noreferrer">pymataExpress</a> frameworks. They work quite well and enable you to have a script that quickly and efficiently communicates with the arduino. I'm sure proper frameworks from <a href="http://www.ros.org" rel="nofollow noreferrer">ros.org</a> or <a href="https://gobot.io" rel="nofollow noreferrer">gobot</a> are better. But <a href="https://github.com/MrYsLab/pymata-aio" rel="nofollow noreferrer">pymata</a> worked for me hence my answer to my own question.</p>

<ol>
<li>processing 

<ul>
<li><a href="https://github.com/firmata/processing" rel="nofollow noreferrer">https://github.com/firmata/processing</a>   </li>
<li><a href="http://funnel.cc" rel="nofollow noreferrer">http://funnel.cc</a> </li>
</ul></li>
<li>python 

<ul>
<li><a href="https://github.com/firmata/pyduino" rel="nofollow noreferrer">https://github.com/firmata/pyduino</a> </li>
<li><a href="https://github.com/lupeke/python-firmata" rel="nofollow noreferrer">https://github.com/lupeke/python-firmata</a> </li>
<li><a href="https://github.com/tino/pyFirmata" rel="nofollow noreferrer">https://github.com/tino/pyFirmata</a> </li>
<li><a href="https://github.com/MrYsLab/PyMata" rel="nofollow noreferrer">https://github.com/MrYsLab/PyMata</a> </li>
<li><a href="https://github.com/MrYsLab/pymata-aio" rel="nofollow noreferrer">https://github.com/MrYsLab/pymata-aio</a>  </li>
</ul></li>
<li>perl

<ul>
<li><a href="https://github.com/ntruchsess/perl-firmata" rel="nofollow noreferrer">https://github.com/ntruchsess/perl-firmata</a> </li>
<li><a href="https://github.com/rcaputo/rx-firmata" rel="nofollow noreferrer">https://github.com/rcaputo/rx-firmata</a>  </li>
</ul></li>
<li>ruby

<ul>
<li><a href="https://github.com/hardbap/firmata" rel="nofollow noreferrer">https://github.com/hardbap/firmata</a> </li>
<li><a href="https://github.com/PlasticLizard/rufinol" rel="nofollow noreferrer">https://github.com/PlasticLizard/rufinol</a>  </li>
<li><a href="http://funnel.cc" rel="nofollow noreferrer">http://funnel.cc</a>  </li>
</ul></li>
<li>clojure

<ul>
<li><a href="https://github.com/nakkaya/clodiuno" rel="nofollow noreferrer">https://github.com/nakkaya/clodiuno</a> </li>
<li><a href="https://github.com/peterschwarz/clj-firmata" rel="nofollow noreferrer">https://github.com/peterschwarz/clj-firmata</a>  </li>
</ul></li>
<li>javascript

<ul>
<li><a href="https://github.com/jgautier/firmata" rel="nofollow noreferrer">https://github.com/jgautier/firmata</a>  </li>
<li><a href="http://breakoutjs.com" rel="nofollow noreferrer">http://breakoutjs.com</a> </li>
<li><a href="https://github.com/rwldrn/johnny-five" rel="nofollow noreferrer">https://github.com/rwldrn/johnny-five</a>  </li>
</ul></li>
<li>java

<ul>
<li><a href="https://github.com/4ntoine/Firmata" rel="nofollow noreferrer">https://github.com/4ntoine/Firmata</a> </li>
<li><a href="https://github.com/kurbatov/firmata4j" rel="nofollow noreferrer">https://github.com/kurbatov/firmata4j</a> </li>
<li><a href="https://github.com/reapzor/FiloFirmata" rel="nofollow noreferrer">https://github.com/reapzor/FiloFirmata</a>  </li>
</ul></li>
<li>.NET

<ul>
<li><a href="https://github.com/SolidSoils/Arduino" rel="nofollow noreferrer">https://github.com/SolidSoils/Arduino</a> </li>
<li><a href="http://www.imagitronics.org/projects/firmatanet/" rel="nofollow noreferrer">http://www.imagitronics.org/projects/firmatanet/</a> </li>
<li><a href="https://github.com/wbadry/FirmataCSharpClientClass" rel="nofollow noreferrer">https://github.com/wbadry/FirmataCSharpClientClass</a>  </li>
</ul></li>
<li>Flash/AS3

<ul>
<li><a href="http://funnel.cc" rel="nofollow noreferrer">http://funnel.cc</a>  </li>
<li><a href="http://code.google.com/p/as3glue/" rel="nofollow noreferrer">http://code.google.com/p/as3glue/</a>  </li>
</ul></li>
<li>PHP

<ul>
<li><a href="https://bitbucket.org/ThomasWeinert/carica-firmata" rel="nofollow noreferrer">https://bitbucket.org/ThomasWeinert/carica-firmata</a> </li>
<li><a href="https://github.com/oasynnoum/phpmake_firmata" rel="nofollow noreferrer">https://github.com/oasynnoum/phpmake_firmata</a></li>
</ul></li>
<li>Haskell

<ul>
<li><a href="http://hackage.haskell.org/package/hArduino" rel="nofollow noreferrer">http://hackage.haskell.org/package/hArduino</a></li>
</ul></li>
<li>iOS

<ul>
<li><a href="https://github.com/jacobrosenthal/iosfirmata" rel="nofollow noreferrer">https://github.com/jacobrosenthal/iosfirmata</a></li>
</ul></li>
<li>Dart

<ul>
<li><a href="https://github.com/nfrancois/firmata" rel="nofollow noreferrer">https://github.com/nfrancois/firmata</a></li>
</ul></li>
<li>Max/MSP

<ul>
<li><a href="http://www.maxuino.org/" rel="nofollow noreferrer">http://www.maxuino.org/</a></li>
</ul></li>
<li>Elixir 

<ul>
<li><a href="https://github.com/kfatehi/firmata" rel="nofollow noreferrer">https://github.com/kfatehi/firmata</a></li>
</ul></li>
<li>Modelica

<ul>
<li><a href="https://www.wolfram.com/system-modeler/libraries/model-plug/" rel="nofollow noreferrer">https://www.wolfram.com/system-modeler/libraries/model-plug/</a>  </li>
</ul></li>
<li>golang

<ul>
<li><a href="https://github.com/kraman/go-firmata" rel="nofollow noreferrer">https://github.com/kraman/go-firmata</a></li>
</ul></li>
<li>Qt/QML

<ul>
<li><a href="https://github.com/callaa/qfirmata" rel="nofollow noreferrer">https://github.com/callaa/qfirmata</a> </li>
</ul></li>
<li>Android/Kotlin

<ul>
<li><a href="https://github.com/xujiaao/android-firmata" rel="nofollow noreferrer">https://github.com/xujiaao/android-firmata</a></li>
</ul></li>
<li>Smalltalk 

<ul>
<li><a href="https://github.com/pharo-iot/Firmata" rel="nofollow noreferrer">https://github.com/pharo-iot/Firmata</a></li>
</ul></li>
</ol>
