XBee device examples Print a list of AT commands
Digi MicroPython Programming Guide
183
'DO', 'DL', 'DE', 'MY', 'BD', 'NB', 'SB', 'RO', 'TD', 'FT', 'AP',
'D8', 'TP', 'SM', 'SP', 'ST', 'CC', 'CT', 'GT', 'VL']:
print(cmd, '=', x.atcmd(cmd))
print("The following AT values are in HEX format:")
for hexcmd in ['VR', 'HV', 'AI', 'DI', 'CI', 'HS', 'CK']:
print(hexcmd, '=', hex(x.atcmd(hexcmd)))
def dump_iocmds(): # This function outputs multiple IO parameter values.
print("Here is a summary of all IO values:")
for cmd in ['D0', 'D1', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7', 'D8',
'D9',
'P0', 'P1']:
print(cmd, '=', x.atcmd(cmd))
print("The following IO values are in HEX format:")
for hexcmd in ['PR', 'PD']:
print(hexcmd, '=', hex(x.atcmd(hexcmd)))
dump_atcmds()
print()
dump_iocmds()
For XBee 3 Zigbee RF Module:
import xbee
at_cmds = {
"01. Network": ["CE", "ID", "ZS", "CR", "NJ",
"NW", "JV", "JN", "DO", "DC"],
"02. Operating_Network": ["AI", "OP", "OI", "CH", "NC"],
"03. Security": ["EE", "EO", "KY", "NK", "KT", "I?"],
"04. Addressing": ["SH", "SL", "MY", "MP", "DH",
"DL", "NI", "NH", "BH", "AR",
"DD", "NT", "NO", "NP"],
"05. Zigbee Addressing": ["TO", "SE", "DE", "CI"],
"06. RF Interfacing": ["PL", "PP", "SC", "SD", "DB"],
"07. UART Interface": ["BD", "NB", "SB", "AP", "AO",
"RO", "D6", "D7", "P3", "P4"],
"08. AT Command Options": ["CT", "GT", "CC"],
"09. MicroPython Options": ["PS"],
"10. Sleep Modes": ["SM", "SP", "ST", "SN", "SO",
"WH", "PO"],
"11. I/O Settings": ["D0", "D1", "D2", "D3", "D4",
"D5", "D6", "D7", "D8", "D9",
"P0", "P1", "P2", "P3", "P4",
"P5", "P6", "P7", "P8", "P9",
"PR", "PD", "LT", "RP"],
"12. I/O Sampling": ["IR", "IC", "V+"],
"13. Diagnostics": ["VR", "VH", "HV", "%V", "TP", "CK"]
}
print("Here is a summary of all AT values:\n")
for category, cmds in sorted(at_cmds.items()):
print("\n{}:".format(category))
for cmd in cmds:
try:
value = xbee.atcmd(cmd)
except KeyError: