Xbee Programming¶
Very basic stuff. For more details, see the XBee manual or Brian Coltin Chris Mar.
Set your serial port to:
- BAUD rate 9600
- 8 data bits
- no parity
- 1 stop bit.
Sequence of Commands (press Enter after every command beginning with "AT")¶
- +++
- Wait for XBee to send "OK"
- AT**
- ATWR
- ATCN
- "+++" enters the XBee command mode
- "AT**" is one or more AT** commands to read and/or write setting on XBee
- see below for useful/common examples
- NOTE: any changes made will only be in effect until the XBee loses power unless you use ATWR
- "ATWR" writes any changes you made to the XBee's long-term memory to persist through power cycles
- "ATCN" exits the XBee command mode
Changing the BAUD rate¶
- ATBD (N)
- Replace (N) with 3 for 9600 or 7 for 115200
- You can omit (N) to read the current BAUD rate
Changing the Address (ID)¶
- ATMY (N)
- Replace (N) with a hex value between 0 and FFFF (0 - 65535 decimal)
- You can omit (N) to read the current address
Changing the Channel¶
- ATCH (N)
- Replace (N) with a hex value between 0C and 1A (12 - 26 decimal)
- You can omit (N) to read the current channel
Changing the PAN id (to create separate networks)¶
- ATID (N)
- Replace (N) with the PAN id (in range 0x0000-0xFFFF)
- You can omit (N) to read the current PAN
Reading the Firmware Version¶
- ATVR
- XBee will respond with fimware version number
- ATVL
- Verbose output (you probably don't need this)