In the last tutorial part we wrote our code to get a time stamped temperature data from the Stalker. Now we want to send this information wireless using XBEE modules. The good news is that we don't have to touch code anymore. The XBEE module on the Stalker is connected to the same serial interface we've been using to talk to the computer. We need just to configure the XBEE modules and the wireless data transmission will work. For this session we'll need all the parts from the last tutorials and additionally we'll need:
We'll use the tool X-CTU to configure the XBEE's. First we're going to configure our XBEE for the Stalker as End Device. Then we'll configure the other XBEE as Coordinator and giving it the address data of the End Device. After that these two XBEE's should be able to talk to each other. You can find a detailed explanation what End Device/Coordinator configuration means here.
The first steps are:
- Install X-CTU
- Plug one XBEE module into the XBEE USB Explorer and connect it to the PC
- Start X-CTU
- Press the Test button to test if the XBEE is connected, you should get an answer message as shown in the picture
- Change to the "Modem Configuration" tab and press Read to get the actual XBEE configuration
- Now set this XBEE as "ZIGBEE END DEVICE AT" and set a PAN ID of your choice, you'll have to give the other XBEE the same PAN ID to ensure that they can talk to each other. After this configuration we'll write these changes to the XBEE module by pressing the Write button
- We need again to read the XBEE configuration to get the SH and SL addresses of our XBEE End Device. Note these two addresses, we'll need them later to configure the second XBEE module.
- Unplug carefully our configured XBEE module, you can already plug it into the Stalker.
- Plug the second XBEE module to the USB Explorer
- Press again the test button in the first tab of the X-CTU window to ensure that the module is connected properly
- Switch to the Modem Configuration tab and press read, you should see now again the standard XBEE configuration
- Configure this XBEE module as ZIGBEE COORDINATOR AT and set the same PAN ID as on the other module, then press write.
- Read again the new configuration of our second XBEE by pressing the read button.
- Our Coordinator needs to know the address of our End Device. Therefore we'll set the SH and SL addresses from our End Device (which you hopefully noted somewhere) as DH and DL addresses in our Coordinator device. Press the write button after this change.
- The two XBEE's are configured, and if you have loaded the code from tutorial part 3 on the Stalker and you plugged in the End device XBEE on our Stalker you should receive already the time stamped temperature data by switching to the Terminal tab of the X-CTU tool.
A useful advice at the end: mark your Coordinator XBEE somehow (small label or a pen dot), in that way you can distinguish what's the Coordinator and the End Device.