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 Prochaine révision Les deux révisions suivantes | ||
materiel:xbee:star:en [2014/09/19 12:24] resonance [XBee - Star] |
materiel:xbee:star:en [2014/11/14 15:13] resonance [Softwares] |
||
---|---|---|---|
Ligne 15: | Ligne 15: | ||
- | {{vimeo> | + | {{ vimeo> |
Ligne 38: | Ligne 38: | ||
* [[http:// | * [[http:// | ||
* [[https:// | * [[https:// | ||
- | * [[http:// | + | * {{:materiel: |
* Additional libraries (in " | * Additional libraries (in " | ||
Ligne 61: | Ligne 61: | ||
=====1/ To XBee (direct) ===== | =====1/ To XBee (direct) ===== | ||
- | The first example is to control | + | The first example is to control |
- | Le premier exemple consiste à contrôler directement les sorties numériques et PWM des XBees à partir de Pure Data sans passer par Arduino. | + | |
- | **Schéma** : Pd/ | + | **Schematic** : Pd/ |
**Code** : to-xbee-star.pd | **Code** : to-xbee-star.pd | ||
Ligne 71: | Ligne 70: | ||
==== 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 112: | Ligne 112: | ||
|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 120: | Ligne 120: | ||
<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 138: | Ligne 139: | ||
* 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 147: | Ligne 148: | ||
|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 165: | Ligne 166: | ||
- | ==== 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 183: | Ligne 184: | ||
<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 189: | Ligne 190: | ||
{{: | {{: | ||
- | =====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 203: | Ligne 204: | ||
==== Pure Data ==== | ==== Pure Data ==== | ||
- | Sans unpackxbee\\ | + | Without [mrpeach/unpackxbee]\\ |
{{: | {{: | ||
- | Avec unpackxbee\\ | + | With [mrpeach/unpackxbee]\\ |
{{: | {{: | ||
Ligne 213: | Ligne 214: | ||
- | ===== Annexes | + | ===== Appendices |
==== API ==== | ==== API ==== | ||
Ligne 249: | Ligne 250: | ||
==== 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:// |