Skip to content

Instantly share code, notes, and snippets.

@jeffskinnerbox
Last active December 23, 2015 16:39
Show Gist options
  • Save jeffskinnerbox/6663187 to your computer and use it in GitHub Desktop.
Save jeffskinnerbox/6663187 to your computer and use it in GitHub Desktop.
Script to configure XBee radio as a end device
# To remove comments, white spaces, and blank lines, use the following:
# sed '/^#/d; s/\([^$]\)#.*/\1/' Config-End-Device.txt | sed 's/[ \t]*$//' > endd.txt
# Run this script to configure the XBee radio using the following:
# python XBeeTerm.py endd.txt
#
baudrate 9600 # (XBeeTerm command) set the baudrate used to comm. with the XBee
serial /dev/ttyUSB0 # (XBeeTerm command) serial device which has the XBee radio
+++ # (XBee command) enter AT command mode on the XBee
ATRE # (XBee command) restore XBee to factory settings
ATAP 2 # (XBee command) enable API mode with escaped control characters
ATCE 0 # (XBee command) make this XBee radio an end device
ATMY AAA1 # (XBee command) set the address of this radio to eight byte hex (must be unique)
ATID B000 # (XBee command) Set the PAN ID to eight byte hex (all XBee's must have this same value)
ATCH 0E # (XBee command) set the Channel ID to a four byte hex (all XBee's must have same value)
ATPL 0 # (XBee command) power level at which the RF module transmits (0 lowest / 4 highest)
ATWR # (XBee command) write all the changes to the XBee non-volatile memory
ATFR # (XBee command) reboot XBee radio
exit # (XBeeTerm command) exit python shell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment