Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
materiel:xbee:star:en [2014/09/19 12:06] resonance [XBee - Star] |
materiel:xbee:star:en [2018/01/28 15:41] (Version actuelle) resonance ancienne révision (2016/02/01 00:06) restaurée |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
====== XBee - Star ====== | ====== XBee - Star ====== | ||
- | ([[: | + | ([[: |
* Author: Jérôme Abel (Reso-nance) | * Author: Jérôme Abel (Reso-nance) | ||
Ligne 6: | Ligne 6: | ||
* License: GNU/FDL3 | * License: GNU/FDL3 | ||
* Files: {{: | * Files: {{: | ||
+ | * Thanks to: Martin Peach, Hans-Christop Steiner, Vincent Pillet | ||
Xbee modules are used to transmit wireless data (radio waves). If you don't know anything about that and you are brave, you should follow a tutorial or mine but it is in French : [[http:// | Xbee modules are used to transmit wireless data (radio waves). If you don't know anything about that and you are brave, you should follow a tutorial or mine but it is in French : [[http:// | ||
+ | |||
On the last tutorial we've seen how to make a " | On the last tutorial we've seen how to make a " | ||
- | |||
{{ : | {{ : | ||
- | ===== Pré-requities ===== | + | {{ vimeo> |
+ | |||
+ | |||
+ | ===== Pre-requities ===== | ||
* Basics of Pure Data, Arduino | * Basics of Pure Data, Arduino | ||
* Basics of [[logiciels: | * Basics of [[logiciels: | ||
Ligne 30: | Ligne 34: | ||
* Jumper wires | * Jumper wires | ||
- | ==== Logiciels | + | ==== Softwares |
To install: | To install: | ||
- | * [[http:// | + | * [[http:// |
* [[http:// | * [[http:// | ||
* [[https:// | * [[https:// | ||
- | * [[http:// | + | * {{:materiel: |
* Additional libraries (in " | * Additional libraries (in " | ||
- | ==== Ressources | + | ==== Resources |
* XBee Datasheet : {{: | * XBee Datasheet : {{: | ||
* XBee Arduino : [[https:// | * XBee Arduino : [[https:// | ||
Ligne 50: | Ligne 54: | ||
* **RX/TX** : be careful of the direction, the RX is linked to TX and TX is linked to the RX. | * **RX/TX** : be careful of the direction, the RX is linked to TX and TX is linked to the RX. | ||
* **RX/TX** : take out RX/TX wires branchés à l' | * **RX/TX** : take out RX/TX wires branchés à l' | ||
- | * Attention au **baudrate** | + | * Be really careful with the **baudrate** |
- | * **Leonardo** : utiliser | + | * **Leonardo** : use Serial1 |
</ | </ | ||
- | ==== Astuce | + | ==== Trick ==== |
- | En ouvrant deux fois le logiciel | + | If you open twice the Arduino |
- | + | ||
=====1/ To XBee (direct) ===== | =====1/ To XBee (direct) ===== | ||
- | Le premier exemple consiste à contrôler directement les sorties numériques et PWM des XBees à partir de Pure Data sans passer par Arduino. | + | The first example is to control directly digital and pwm outputs of XBees with Pure Data, without |
- | **Schéma** : Pd/ | + | **Schematic** : Pd/ |
**Code** : to-xbee-star.pd | **Code** : to-xbee-star.pd | ||
Ligne 68: | Ligne 71: | ||
==== Configuration ==== | ==== Configuration ==== | ||
- | Ouvrir le XBee Terminal avec Processing | + | Open the xBeeSerialTerminal with Processing |
* XBEE#1 Coordinator: | * XBEE#1 Coordinator: | ||
* XBEE#2 End Device : ATRE, ATID1111, ATMY2, ATWR | * XBEE#2 End Device : ATRE, ATID1111, ATMY2, ATWR | ||
* XBEE#3 End Device : ATRE, ATID1111, ATMY3, ATWR | * XBEE#3 End Device : ATRE, ATID1111, ATMY3, ATWR | ||
- | La grande différence par rapport aux précédentes configurations est le fait que nous ne spécifions pas d' | + | The main difference between last setups is that we do not write the destination address. The address is part if the message sended by Pure Data to the coordinator. It is because we use the **API mode** (ATAP2). |
{{: | {{: | ||
- | ==== Explications | + | ==== Explanations |
^ AT Command | ^ AT Command | ||
- | | ATRE | + | | ATRE |
- | | ATID1111 | Adresse du réseau | + | | ATID1111 | Network address |
- | | ATAP2 | Coordinateur en mode API | | + | | ATAP2 | Coordinator is in API mode | |
- | | ATCE1 | Rôle de coordinateur | + | | ATCE1 | Coordinator behavior |
- | | ATMY2 | Adresse du XBee | | + | | ATMY2 | Addresses of end devices |
- | | ATWR | + | | ATWR |
- | **Remarques** : | + | **Notes** : |
- | | ATAP2 | Par défaut | + | | ATAP2 | By default |
- | | ATMY0 | Par défaut | + | | ATMY0 | By default |
- | | ATCE0 | + | | ATAP0 |
- | | ATDH0 | Par défaut | + | | ATCE0 | By default : End Device behavior |
- | | ATDL0 | Par défaut | + | | ATDH0 | By default |
- | | ATIU1 | ? : pour ne pas utiliser les entrées/ | + | | ATDL0 | By default |
- | | ATMY1 | ? : si l' | + | | ATIU0 | ? : if we not use RX/TX in our case (direct) | |
+ | | ATMY1 | ? : if the coordinator address is 1, we avoid send useless data to it | | ||
==== Pure Data ==== | ==== Pure Data ==== | ||
- | Envois des commandes avec Pure Data | + | Send commands with Pure Data : |
{{: | {{: | ||
- | === Explications | + | === Explanations |
^ AT Command | ^ AT Command | ||
|RAT 0x0 0x2 2 D0 4 | digital switch off| | |RAT 0x0 0x2 2 D0 4 | digital switch off| | ||
Ligne 109: | Ligne 113: | ||
|RAT 0x0 0x3 2 M1 $1 | Control PWM (0-255) with M1 (use P0 and M0 for PWM0 pin)| | |RAT 0x0 0x3 2 M1 $1 | Control PWM (0-255) with M1 (use P0 and M0 for PWM0 pin)| | ||
- | **Décryptage du message " | + | **Remote |
|64-bit_destination| 0x0 (any, not needed here)| | |64-bit_destination| 0x0 (any, not needed here)| | ||
|16-bit_destination: | |16-bit_destination: | ||
Ligne 117: | Ligne 121: | ||
<WRAP center round tip> | <WRAP center round tip> | ||
- | Si vous envoyer des données très rapidement, vous verrez que les LEDs réagissent lentement. On observe une inertie qui n'est pas souhaitable pour du contrôle en temps-réel. C'est parce que le **baudrate** par défaut est de 9600, ce qui est très lent. Pour avoir une meilleure réponse, on peut le changer dans les modules XBee, avec la commande | + | If you send a lot of data, you should see the LED light slowly. We don't want that for real-time communications. To have a better behavior we can change the baudrate. By default it is 9600, which is very slow. With the **ATBD6** |
</ | </ | ||
- | =====2/ | + | =====2/ |
- | Pour comprendre ce qu' | + | We can understand what is in Xbee packets with serial monitoring. |
- | **Schéma** : Pd/ | + | **Schematic** : Pd/ |
**Fichiers** : to-xbee-serial.pd, | **Fichiers** : to-xbee-serial.pd, | ||
{{: | {{: | ||
- | **Remarque** : en passant par le convertisseur série, sans Arduino, | + | **Note** : when I use simply the serial converter without |
==== Configuration ==== | ==== Configuration ==== | ||
Ligne 135: | Ligne 140: | ||
* XBEE#2 End Device : ATRE, ATID1111, ATMY2, ATWR | * XBEE#2 End Device : ATRE, ATID1111, ATMY2, ATWR | ||
- | ==== Résultats | + | ==== Results |
- | ^ Données | + | ^ Data ^ Results |
- | |Chiffres quelconques | + | |Whatever numbers |
|print **A** | **65**| | |print **A** | **65**| | ||
|print **hello**| **104 101 108 108 111**| | |print **hello**| **104 101 108 108 111**| | ||
Ligne 144: | Ligne 149: | ||
|TX 0x0 0x2 0 0 **10 11 12 13 14 15**| 126 0 125 51 16 30 0 0 0 0 0 0 0 0 0 2 0 0 **10 11 12 13 14 15** 145| | |TX 0x0 0x2 0 0 **10 11 12 13 14 15**| 126 0 125 51 16 30 0 0 0 0 0 0 0 0 0 2 0 0 **10 11 12 13 14 15** 145| | ||
- | ==== Récupérer une donnée | + | ==== Get a data (parser) |
{{: | {{: | ||
=====3/ XBee API - Arduino ===== | =====3/ XBee API - Arduino ===== | ||
- | On fait communiquer uniquement des Arduinos entre elles pour comprendre comment envoyer et recevoir des trames XBee avec Arduino. | + | One Arduino |
- | **Schéma** : ARDUINO/ | + | **Schematic** : ARDUINO/ |
**Codes** : to_xbee_api.ino, | **Codes** : to_xbee_api.ino, | ||
| | ||
Ligne 162: | Ligne 167: | ||
- | ==== Résultat | + | ==== Results |
{{: | {{: | ||
- | =====4/ XBee API - Arduino | + | =====4/ XBee API - Arduino |
- | N' | + | To use Pure Data and send Xbee packet, I had no success in using only a serial converter. I needed use an Arduino |
- | **Schéma** : Pd/ | + | **Schematic** : Pd/ |
**Codes** : to-xbee-cmd.pd, | **Codes** : to-xbee-cmd.pd, | ||
Ligne 180: | Ligne 185: | ||
<WRAP center round important> | <WRAP center round important> | ||
- | **Changement de baudrate** : il faut donc les changer partout | + | **Baudrate changes** : you need to change it everywhere |
</ | </ | ||
Ligne 186: | Ligne 191: | ||
{{: | {{: | ||
- | =====4/ | + | =====4/ |
- | Réception des données directes (capteurs) de plusieurs XBees sans Arduinos | + | The coordinator get data directly from sensors connected to XBee senders whithout |
- | + | ||
- | **Schéma** : XBEE2 et XBEE3 (seules) ---> | + | **Schematic** : SENSOR/XBEE2 et SENSOR/XBEE3 (only) ---> |
**Codes** : from-xbee-star-1.pd, | **Codes** : from-xbee-star-1.pd, | ||
Ligne 200: | Ligne 205: | ||
==== Pure Data ==== | ==== Pure Data ==== | ||
- | Sans unpackxbee\\ | + | Without [mrpeach/unpackxbee]\\ |
{{: | {{: | ||
- | Avec unpackxbee\\ | + | With [mrpeach/unpackxbee]\\ |
{{: | {{: | ||
Ligne 210: | Ligne 215: | ||
- | ===== Annexes | + | ===== Appendices |
==== API ==== | ==== API ==== | ||
Ligne 246: | Ligne 251: | ||
==== Broadcast / Unicast ==== | ==== Broadcast / Unicast ==== | ||
- | Pour envoyer des commandes à plusieurs destinataires, une autre solution aurait été d' | + | To send data to few modules, another way would be to send messages |
**Series 2** ([[https:// | **Series 2** ([[https:// |