XBee radios Command reference
Configuring radios to pass DIO

This is how to set up two radios so that pin signals (high or low) from one radio will be passed to the other

In this instance, we will show how to set up sending from to another, but having bi-directional communication should be similar

On the transmitter radio:

  1. Under I/O Settings, set the pins that will be transmitted to "3 - DI" (data in)
  2. Set IC - DIO to FF (this will make it look at all the pins and transmit when they change)
  3. Set sample rate to 0 (unless you want synchronous updates)

On the receiver radio:

  1. Set the corresponding pins to "4 - DO (LOW)" or "5- DO (HIGH)"
  2. Under I/O Line Passing set "Input Addresses" to 0xFFFF (allow any radios)
  3. Set IU - I/O Output enable to Disabled
Changing baud rates

You can change the baud rate using the ATBD command

-> AT (check if xbee modem is responding)
<- OK
-> ATBD (get current baud rate as above)
<- 3 (9600)
-> ATBD 4 (set baud rate to 19200)
<- OK
-> ATBD (check again)
<- 4
-> ATWR (write the baud rate change to flash)
<- OK

Setting a pin direction

Use ATDx where x is the pin number from 0 to 8

For example to set pin D4 to be a digital input

-> AT (check if xbee modem is responding)
<- OK
-> ATD4 (get current pin state)
<- 0 (disabled)
-> ATD4 3 (set pin to digital input)
<- OK
-> ATD4 (check again)
<- 3
-> ATWR (write the change to flash)
<- OK

Changing the PAN ID

By default all XBee's use PAN ID #3332. The ID is 4 bytes of hexadecimal and can range from 0000 to FFFF. XBees will only send/receive data to other modems on the same PAN

Use ATID #### where #### is the 4 digit hex ID

For example to set the PAN ID to 3137

-> AT (check if xbee modem is responding)
<- OK
-> ATID (get current PAN)
<- 3332 (default, or something else)
-> ATID 3137 (set new id)
<- OK
-> ATID (check again)
<- 3137
-> ATWR (write the change to flash)
<- OK

Changing the Retry Rate

Use ATRR to change the rate from 0 to 6 (default is 0). A higher retry rate such as 6 will provide a more 'rugged' connection but if you prefer to drop packets as long to get better response, set this to 0

Changing the Packetization Timeout

Use ATRO to change the rate from 0 to FF (255 in hex) the default is 3. The PT sets how long to wait before sending serial characters in a wireless packet. If you are sending lots of data, use a higher timeout to make sure theres more sent in each packet. If you're not sending a lot of data and want better response rate, set it to 0.

May 17, 2011 20:07