user:kluong:feature_idea_-_change_attached_xbee_s_panid

Feature Idea - Change attached xbee's panid

It might be useful to be able to change the panid of the xbee for a sensor node without having to remove it. Instead, it should be possible to just issue a command to the node through a serial port and the MCU will do this automatically for us.

This might be useful when it's ready to transition a node to production after testing it in the staging environment for a bit.

Here's what the flow would look like:

  • Test node in the staging network (panid 1111)
  • Determine it's working, ready to change the node to the production network (panid 8888)
  • Connect node to a computer
  • Enter command mode
  • Type in command: `panid 8888`
  • Xbee on the node is configured to use panid 8888
  • Packets go to the production gateway instead

This is possible by issuing AT commands from the atmega328p on the node, to the xbee through uart. There's an AT command that let's you configure the panid (ATID): https://www.digi.com/resources/documentation/Digidocs/90001456-13/concepts/c_at_commands.htm?TocPath=XBee%20transparent%20mode%7CCommand%20mode%7C_____1

XBees also have a command mode, which you have to enter to send it AT commands. The serial code to do this would look something like:

serial_port.write("+++\r");
 
// Write the panid 8888 to the xbee
serial_port.write("ATID 8888\r");
 
// This command writes the current configuration to non-volatile memory so that it persists the next time the device powers up. Otherwise, parameters are restored to previously saved values after the device is reset.
serial_port.write("ATWR\r");
 
// This command explicitly exits the module from command mode. Remember that if you don't type anything for 10 seconds, the device automatically drops out of Command mode.
serial_port.write("ATCN\r");

Authors

Contributing authors:

kluong

Created by kluong on 2021/03/23 23:03.

  • user/kluong/feature_idea_-_change_attached_xbee_s_panid.txt
  • Last modified: 2021/09/19 21:59
  • (external edit)