Wiki » Historique » Version 86
Version 85 (Sylvain Bentz, 28/01/2016 00:04) → Version 86/89 (Sylvain Bentz, 28/01/2016 02:13)
{{toc}} h1. LINK Raspberry-Arduino
Ce Wiki regorge de liens vers de la documentation et des tutoriels pour faire communiquer une Arduino et une [[Arduino - Raspberry Pi. Pi w/ USB]]
[[ArduinoLampone]]
h1. Les bibliothèques : où les trouver ?
h2. Pour Bibliothèques pour l'Arduino : http://playground.arduino.cc/Main/LibraryList#Comm
_Wire Library (I2C)_
https://www.arduino.cc/en/Reference/Wire
[[Les bibliothèques Arduino]] _Pour de la communication *entre Arduinos* !_ Ca a l'air génial !
https://github.com/gioblu/PJON : la sélection d'e-gab (ce qui pourrait être intéressant Among many features : "you have the complete access to the microntroller ready to be used, as usual, untouched".
_Software I2C library_ | Guère plus grande que _Wire_
http://playground.arduino.cc/Main/SoftwareI2CLibrary
_Wireless sensor node (WSN) network protocol for arduino_ | (Pour des futures bornes de géolocalisation ?)
https://code.google.com/p/arduinode/
h2. Applis/Biblio pour le robot ^^)
h2. Pour la Raspberry Pi (Applications et bibliothèques) : (Java, C, Python...tout ce qu'on veut) http://playground.arduino.cc/Main/InterfacingWithSoftware
[[Les bibliothèques Raspberry Pi]]
http://ardulink.org/ : la sélection d'e-gab
h1. Communication Raspberry-Arduino Programme en Java (marche avec bus port USB. Et avec I2C
Nous (sbentz et tbenhnini) avons choisi le bus I2C pour faire communiquer Raspi et Arduino. ? sais pas :( )
On a réussi à transférer des mesures (= des floats) et des ordres (= des int)... > How to install Ardulink on your Raspberry PI
...mais...
. les floats sont chiants à transférer
. les floats devaient être compris entre -100 et +100
. le floats reçu par la Raspi n'était pas égal au float envoyé par l'Arduino > http://www.ardulink.org/how-to-install-arduino-pc-link-on-raspberry-pi/
http://playground.arduino.cc/Interfacing/Delphi : si sa partie décimale était non nulle, il y avait une erreur relative de 10^-7 libère l'USB "For instance, the switch could be replaced with a temperature sensor and the LED with a relay to turn a home's heating on."
http://sglez.org/2008/08/05/interfacing-arduino-with-c-and-libserial/ : Serial et C++
h2. Raspberry - Arduino w/ I2C
warning. Possible problème de tension entre la RasPi (3.3V) et l'arduino (5V) qui PEUT être à 5V (Uno, Nano et Mega = 5V)
tip. Des solutions simples existent avec quelques résistances http://playground.arduino.cc/Main/I2CBi-directionalLevelShifter
h2. Tutoriels h3. Tutos
_Tuto de Julien Enselme ! : La communication série avec arduino (et Python)_
http://www.jujens.eu/posts/2014/May/05/Communication-serie/
_Raspberry Pi – Arduino – Lier les deux via le bus I2C_
Logiciels utilisés :
Arduino -> Biblio Wire
Raspi -> Python
http://www.pihomeserver.fr/2013/08/13/raspberry-pi-home-server-arduino-lier-les-deux-via-bus-i2c/
_Raspberry-Pi - Arduino par l'intermédiaire d'un bus I2C_ *Au S7, on (sbentz et tbenhnini) s'en est inspiré pour faire communiquer Arduino et Raspi et coder* https://github.com/E-gab-ECM/Link_Raspberry-Arduino
http://mchobby.be/wiki/index.php?title=ArduPi-I2C
_Tuto de Julien Enselme ! : La communication série avec arduino (et Python)_
http://www.jujens.eu/posts/2014/May/05/Communication-serie/
_Raspberry Pi – Arduino – Lier les deux via le bus I2C_
http://www.pihomeserver.fr/2013/08/13/raspberry-pi-home-server-arduino-lier-les-deux-via-bus-i2c/
_Arduino Serial communication_
http://www.oxgadgets.com/2011/07/arduino-serial-communication.html
h2. Documentation h3. Doc
Arduino lit octet par octet, cf fonction read()
Arduino peut interpréter l'octet comme nombre (type int) ou string (type char)
_Connecteurs I2C de l'Arduino Nano : où sont-ils ?_ A4 (SDA) et A5 (SCL)_
Regarder la page de Wire Library (cf lien ci-dessous)
Regarder la page officielle de la carte (Uno pour l'exemple) : https://www.arduino.cc/en/Main/ArduinoBoardNano
_Wire Library (I2C)_
https://www.arduino.cc/en/Reference/Wire
_Wikipedia I2C_
[[wikipedia>I²C]]
h1. Raspberry Serial Communication Raspberry-Arduino ou Raspberry-Carte moteur MD25 avec bus Sériel
warning. Toujours faire attention au 3.3V de la Raspi, ajoutez des résistances si nécessaire
tip. pour résoudre le problème, cf http://blog.oscarliang.net/raspberry-pi-and-arduino-connected-serial-gpio/
h2. Raspberry Pi
h3. Bibliothèque python : pySerial pySerial: https://pypi.python.org/pypi/pyserial
_Documentation de pySerial_ h3. Documentation pySerial : http://pythonhosted.org/pyserial/
h3. Tutos
_Lecture/Ecriture sur le port série de la Raspi:_
http://www.instructables.com/id/Read-and-write-from-serial-port-with-Raspberry-Pi/
h2.
h3. Carte commande moteur MD25 (utilisée (utilisé pour l'asservissement des moteurs du grand robot)
_Documentation_:
http://www.robot-electronics.co.uk/htm/md25tech.htm
notice. Comme indiqué il y a les deux modes I2C ou Serial de disponible pour la carte commande. disponible. Au choix.. mais le mode série est beaucoup plus clair.
h2. Arduino
h3. Bibliothèque officielle Arduino
notice. Elle s'appelle SoftwareSerial. A l'époque (2013) elle était appelée NewSoftSerial.
_Documentation_
biblio arduio http://arduiniana.org/libraries/NewSoftSerial/
https://www.arduino.cc/en/Reference/Serial
_A savoir_
Le port Seriel (pins 0 et 1) est lié au port USB. Ce sont les mêmes. On ne peut pas brancher son PC par le port USB et la RasPi aux pins 0 et 1. Cependant, il semble qu'on peut tout de même téléverser ;) (cf le tuto)
L'Arduino Mega a 3 autres ports sériels : Seriel3 (pins 14 et 15), Seriel2 (16,17) et Seriel3 (18,19).
La biblio Arduino (SoftwareSerial) permet d'utiliser d'autres pins.
_Tutos_
http://codeandlife.com/2012/07/29/arduino-and-raspberry-pi-serial-communication/
h1. Archives
[[Arduino - Raspberry Pi w/ USB]]
[[ArduinoLampone]]
Ce Wiki regorge de liens vers de la documentation et des tutoriels pour faire communiquer une Arduino et une [[Arduino - Raspberry Pi. Pi w/ USB]]
[[ArduinoLampone]]
h1. Les bibliothèques : où les trouver ?
h2. Pour Bibliothèques pour l'Arduino : http://playground.arduino.cc/Main/LibraryList#Comm
_Wire Library (I2C)_
https://www.arduino.cc/en/Reference/Wire
[[Les bibliothèques Arduino]] _Pour de la communication *entre Arduinos* !_ Ca a l'air génial !
https://github.com/gioblu/PJON : la sélection d'e-gab (ce qui pourrait être intéressant Among many features : "you have the complete access to the microntroller ready to be used, as usual, untouched".
_Software I2C library_ | Guère plus grande que _Wire_
http://playground.arduino.cc/Main/SoftwareI2CLibrary
_Wireless sensor node (WSN) network protocol for arduino_ | (Pour des futures bornes de géolocalisation ?)
https://code.google.com/p/arduinode/
h2. Applis/Biblio pour le robot ^^)
h2. Pour la Raspberry Pi (Applications et bibliothèques) : (Java, C, Python...tout ce qu'on veut) http://playground.arduino.cc/Main/InterfacingWithSoftware
[[Les bibliothèques Raspberry Pi]]
http://ardulink.org/ : la sélection d'e-gab
h1. Communication Raspberry-Arduino Programme en Java (marche avec bus port USB. Et avec I2C
Nous (sbentz et tbenhnini) avons choisi le bus I2C pour faire communiquer Raspi et Arduino. ? sais pas :( )
On a réussi à transférer des mesures (= des floats) et des ordres (= des int)... > How to install Ardulink on your Raspberry PI
...mais...
. les floats sont chiants à transférer
. les floats devaient être compris entre -100 et +100
. le floats reçu par la Raspi n'était pas égal au float envoyé par l'Arduino > http://www.ardulink.org/how-to-install-arduino-pc-link-on-raspberry-pi/
http://playground.arduino.cc/Interfacing/Delphi : si sa partie décimale était non nulle, il y avait une erreur relative de 10^-7 libère l'USB "For instance, the switch could be replaced with a temperature sensor and the LED with a relay to turn a home's heating on."
http://sglez.org/2008/08/05/interfacing-arduino-with-c-and-libserial/ : Serial et C++
h2. Raspberry - Arduino w/ I2C
warning. Possible problème de tension entre la RasPi (3.3V) et l'arduino (5V) qui PEUT être à 5V (Uno, Nano et Mega = 5V)
tip. Des solutions simples existent avec quelques résistances http://playground.arduino.cc/Main/I2CBi-directionalLevelShifter
h2. Tutoriels h3. Tutos
_Tuto de Julien Enselme ! : La communication série avec arduino (et Python)_
http://www.jujens.eu/posts/2014/May/05/Communication-serie/
_Raspberry Pi – Arduino – Lier les deux via le bus I2C_
Logiciels utilisés :
Arduino -> Biblio Wire
Raspi -> Python
http://www.pihomeserver.fr/2013/08/13/raspberry-pi-home-server-arduino-lier-les-deux-via-bus-i2c/
_Raspberry-Pi - Arduino par l'intermédiaire d'un bus I2C_ *Au S7, on (sbentz et tbenhnini) s'en est inspiré pour faire communiquer Arduino et Raspi et coder* https://github.com/E-gab-ECM/Link_Raspberry-Arduino
http://mchobby.be/wiki/index.php?title=ArduPi-I2C
_Tuto de Julien Enselme ! : La communication série avec arduino (et Python)_
http://www.jujens.eu/posts/2014/May/05/Communication-serie/
_Raspberry Pi – Arduino – Lier les deux via le bus I2C_
http://www.pihomeserver.fr/2013/08/13/raspberry-pi-home-server-arduino-lier-les-deux-via-bus-i2c/
_Arduino Serial communication_
http://www.oxgadgets.com/2011/07/arduino-serial-communication.html
h2. Documentation h3. Doc
Arduino lit octet par octet, cf fonction read()
Arduino peut interpréter l'octet comme nombre (type int) ou string (type char)
_Connecteurs I2C de l'Arduino Nano : où sont-ils ?_ A4 (SDA) et A5 (SCL)_
Regarder la page de Wire Library (cf lien ci-dessous)
Regarder la page officielle de la carte (Uno pour l'exemple) : https://www.arduino.cc/en/Main/ArduinoBoardNano
_Wire Library (I2C)_
https://www.arduino.cc/en/Reference/Wire
_Wikipedia I2C_
[[wikipedia>I²C]]
h1. Raspberry Serial Communication Raspberry-Arduino ou Raspberry-Carte moteur MD25 avec bus Sériel
warning. Toujours faire attention au 3.3V de la Raspi, ajoutez des résistances si nécessaire
tip. pour résoudre le problème, cf http://blog.oscarliang.net/raspberry-pi-and-arduino-connected-serial-gpio/
h2. Raspberry Pi
h3. Bibliothèque python : pySerial pySerial: https://pypi.python.org/pypi/pyserial
_Documentation de pySerial_ h3. Documentation pySerial : http://pythonhosted.org/pyserial/
h3. Tutos
_Lecture/Ecriture sur le port série de la Raspi:_
http://www.instructables.com/id/Read-and-write-from-serial-port-with-Raspberry-Pi/
h2.
h3. Carte commande moteur MD25 (utilisée (utilisé pour l'asservissement des moteurs du grand robot)
_Documentation_:
http://www.robot-electronics.co.uk/htm/md25tech.htm
notice. Comme indiqué il y a les deux modes I2C ou Serial de disponible pour la carte commande. disponible. Au choix.. mais le mode série est beaucoup plus clair.
h2. Arduino
h3. Bibliothèque officielle Arduino
notice. Elle s'appelle SoftwareSerial. A l'époque (2013) elle était appelée NewSoftSerial.
_Documentation_
biblio arduio http://arduiniana.org/libraries/NewSoftSerial/
https://www.arduino.cc/en/Reference/Serial
_A savoir_
Le port Seriel (pins 0 et 1) est lié au port USB. Ce sont les mêmes. On ne peut pas brancher son PC par le port USB et la RasPi aux pins 0 et 1. Cependant, il semble qu'on peut tout de même téléverser ;) (cf le tuto)
L'Arduino Mega a 3 autres ports sériels : Seriel3 (pins 14 et 15), Seriel2 (16,17) et Seriel3 (18,19).
La biblio Arduino (SoftwareSerial) permet d'utiliser d'autres pins.
_Tutos_
http://codeandlife.com/2012/07/29/arduino-and-raspberry-pi-serial-communication/
h1. Archives
[[Arduino - Raspberry Pi w/ USB]]
[[ArduinoLampone]]