Ren-W XBee Radio Configuration
- You will need the free XCTU software from Digi International (www.digi.com) as well as an XBee programming board. An inexpensive programming board is available from SparkFun Electronics (www.sparkfun.com - XBee USB Explorer, SparkFun part # WRL-08687, about $25). Other programming boards are available and prices vary widely. You may also configure the XBee manually using a Ren-W board; information about manual configuration appears later in this document.
- 1. Verify that the programmer board is unplugged from the USB port, and plug the XBee module into the board.
- 2. Connect the programming board into the computer's USB port. Wait a few moments for the computer to recognize it.
- 3. Start the XCTU software. Choose the proper communication port into which the programmer board is plugged.
- 4. Use the default communication parameters to begin (9600 baud, no flow control, 8 data bits, no parity, 1 stop bit). These are the default parameters for all XBee modules right out-of-the-box.
- 5. Connect to the XBee module by clicking the Test/Query button. After a few seconds, a confirmation box will appear that communication was successful. The box will also display the type and firmware version the XBee module is using. Close the test/query box to continue. Note: if a connection is not made, verify that the correct com port and baud rate was selected and try again. If still unsuccessful, retry using a different baud rate.
- 6. Select the Modem Configuration tab.
- 7. Click the Read button. In a few moments, the screen will display multiple configuration items.
- 8. Only four items need changing: PAN ID, MAC Mode, Interface Data Rate and Packetization Timeout (scroll down the XCTU screen to view more settings).
- PAN ID: this is akin to a "domain" for a computer network, but for XBee, the ID is numerical instead of text. The default is 3332 for all XBee modules, but you can change it to a different number if you wish or if another XBee network is in use nearby. Note that only modules with the same PAN ID can communicate with one another. (See PAN ID concept notes below)
- MAC Mode: choose option 1 – 802.15.4 No ACKS. While all the modes function, this setting is the fastest for streaming data.
- Interface Data Rate: this is the speed at which the XBee will communicate with the Renard SS controllers. Set this to 57600 for best performance. While the maximum setting for both a Renard and an XBee is 115,200, XBee radios are designed to provide up to 80kbps streaming throughput; setting to 115,200 may cause erratic behavior.
- Packetization Timeout: set to zero (the default is 3). A zero setting makes the XBee perform faster.
- 9. When changes are complete, click the Write button near the top of the XCTU screen to save the changes to the XBee’s internal memory. A progress bar will appear and in a few moments, the completion message will appear such as the one in the lower left corner of this screen:
- 10. Because the XBee's communication parameters have changed, you can return to the first screen (steps #3-4 above), change the communication parameters to 57,600 baud, requery the modem and reconnect to it to check your settings.
Setting an XBee Module's Address
- Connecting to all XBee modules simultaneously is easy: just set the PANIDs on each module to the same number. However, if you want to create a daisy chain network architecture where one module transmits to a specific next module, and so forth, you need to go a little further.
- If you have two modules on each Ren-W board (a real luxury because of the added expense!), you can simply set the PANIDs of the two modules that will communicate with one another to the same PANID. See the "Point to Point" broadcasting example on the Ren-W Configuration Concepts page.
- However, in Alternate PTP mode with only ONE XBee module installed on a Ren-W board as an E-Mode Repeater (XBee module in the TX position and jumper on JP5) XBee addressing is used instead. With addressing, you have multiple options:
- Notice the 16-bit source address option in the above window. You can insert a numerical address of your choosing here, such as 1001, 1002, 1003, etc. and leave the PANID the same for all modules. To create a daisy chain network, you would assign the "destination address high" of the first module to be the 16-bit address of the next module. You would continue this logic throughout your XBee network by assiging a specific 16-bit address to each module and then assigning the desired destination addresses.
- Instead of assigning a 16-bit source address of your own, you may choose to use the predefined serial numbers instead. If you do, be sure to use both the serial number high and serial number low of the receiving module as the transmitting module's destination address high and destination address low. Using the serial numbers makes the network the most secure it can possibly be because no two XBee modules are manufactured with the same serial number high and low.
- TIP #1: Be sure to write each radio's 16-bit address and it's assigned destination address on a piece of tape and either tape it to the XBee itself or to your enclosure so you know which radio transmits to which.
- TIP #2: By defining two or more XBee modules with the same 16-bit address, you can control them simultaneously from only one radio. However, don't assign multiple XBees to the same destination address or the receiving XBee may receive different commands from two different sources; the result will likely be confusion.
Manually Configuring an XBee
- An XBee can be programmed manually directly from your computer's serial port (using an RS-485 converter) and a Ren-W board if you do not have an XBee programming board. However, this practice is somewhat difficult as there is no facility in the Ren-W for duplex communication with the XBee module, and you will be unable to "read" the XBee's settings to discover what they are. However, out of the box, an XBee module is factory pre-set at 9600 baud, 8 data bits, 1 stop bit and no parity.
- You will need a terminal program. The Free XCTU software from www.digi.com includes a terminal program or you can use Windows Hyperterminal. XCTU is easier to use and is highly recommended as you have fewer configuration settings to contend with than with Hyperterminal.
- You will also need the XBee documentation that explains the AT command set the radio uses. This is also available from www.digi.com. The sample below displays the method for setting the XBee module to the proper communication settings.
- 1. Plug the XBee module into the XBee TX (left) side of the Ren-W board.
- 2. Plug the cat5 cable from your RS-485 connection into the J1 jack of the Ren-W board. This is on the XBee TX (left) side of the board as well.
- 3. Make sure the Ren-W is powered up.
- 4. Start the XCTU software.
- 5. At the PC Settings screen, choose the correct com port for your computer and set the baud and other communication parameters to those of the XBee on the Ren-W board (see picture above).
- 6. Check the API box to "Enable API." This checkbox is on the far left side of the PC Settings tab about half-way down the screen. Leave the Use escape characters box unchecked (see picture above).
- 7. Click the Test/Query button. If the communication parameters match the module, you should receive a connection message that displays the serial number of the XBee radio but not much else (see picture above).
- 8. Select the Terminal tab.
- 9. Type +++ by itself but DO NOT PRESS THE ENTER KEY. Wait about 4 or 5 seconds.
- 10. Type ATMM=1 and press ENTER, then wait about 4 seconds. This command sets the MAC mode to the No Acks setting.
- 11. Type ATBD=6 and press ENTER, then wait about 4 seconds. This command sets the BAUD rate to 57,600.
- 12. Type ATRO=0 and press ENTER, then wait about 4 seconds. This sets the packetization timeout to zero.
- 13. Type ATWR and press ENTER, then wait about 10 seconds. This writes the changes to the XBee's internal memory.
- 14. Remove power to the Ren-W board so when you restart it, it has a cold boot.
How to change the XBee's address:
- Access the XBee as described in steps 1-8 above. Remember to change the baud rate to 57600 or the software will not connect to it.
- Type +++ by itself but DO NOT PRESS THE ENTER KEY. Wait about 4 or 5 seconds.
- Type ATMY=1234 and press ENTER on your keyboard. Wait about 4 seconds. This sets the radio's address to 1234. You may substitute 1234 with any 4-digit number of your choice.
- Type ATWR and press ENTER on your keyboard. Wait about 10 seconds. This command "writes" the setting into the XBee's internal memory.
- The radio's address has now been changed to the number you selected. Power the Ren-W off so the XBee gets a cold restart.
How to change the XBee's DESTINATION address:
- Access the XBee as described in steps 1-8 above. Remember to change the baud rate to 57600 or the software will not connect to it.
- Type +++ by itself but DO NOT PRESS THE ENTER KEY. Wait about 4 or 5 seconds.
- Type ATDH=3456 and press ENTER on your keyboard. Wait about 4 seconds. This sets the radio's destination address to 3456. You may substitute 3456 with the 4-digit address of the module this XBee should transmit to. Setting the destination address makes the XBee transmit ONLY to that address and only XBees with the address 3456 will receive the signal.
- Type ATWR and press ENTER on your keyboard. Wait about 10 seconds. This command "writes" the setting into the XBee's internal memory.
- The radio's destination address has now been changed to the number you selected. Power the Ren-W off so the XBee gets a cold restart.
Additional Ren-W Links