Linux command: xbee
To interact with the XBee RF module inside of the XBee Gateway while using the command shell, use the built-in xbee command line program.
Usage
XBee utilities
syntax:
xbee [option ...] [command ...]
options:
-h, --help {Display this help and exit} commands: refresh {Discover network devices} zigbee {Discover ZigBee devices} clear {Clear list and discover devices} id|network|extended|node|product {Sort node list by field} [node] <CC>[[=]param] {Run AT command on device: <CC> is 2 character upper case command
param is <decimal>, 0x<hex>, or "string"}
load_profile [node] file {Load settings from file}
save_profile [node] [file] {Save settings to file}
factory_default [node] {Restore factory default settings}
restart [node] {Restart node}
child_table [node] {Display child table}
neighbor_table [node] {Display neighbor table}
source_route node {Display source route}
route destination [source] {Display route}
identify {Display identify messages}
identify node [seconds] {Send identify message}
ping node [count size interval_ms] {Send loopback data}
fw_update file {Update gateway radio firmware}
fw_update target [updater] [file] {Schedule remote firmware update}
fw_update target cancel {Cancel remote firmware update}
fw_update {Display firmware status list}
fw_status [node] {Display firmware status for node}
Common xbee command examples
Display node list
To display the list of known devices on the RF network, as well as basic information about the network configuration, run this command:
xbee
Example output:
XBee network device list
Network: 0
PAN ID: 0xe9e4 - 0x0013a20040abe468
Channel: 0x12 (2440 MHz)
Gateway address: 00:13:a2:00:40:ab:e4:68!
Gateway firmware: 0x4061
Node ID Network Extended address Node type Product type
--------------- ------- -------------------------------- ----------- ------------
[0000]! 00:13:a2:00:40:ab:e4:68! coordinator X2e Gateway
1 coordinator
In this example, the XBee module inside of the XBee Gateway is acting as a Zigbee network coordinator, as indicated by the 16-bit network address of 0000. If this network had other devices joined, they would appear in this list.
As seen in the Usage section above, you can sort the node list by any of the fields in the table.
Examples:
xbee id
xbee network
xbee extended
xbee node
xbee product
Perform a node discovery
Use the command xbee refresh to perform a node discovery (ND command). Use the command xbee zigbee to perform a ZDO device discovery.
Use the command xbee clear to clear the cached node list and automatically trigger a discovery. This can be useful if a node has been removed from the network but still appears in the node list.
Perform an AT command
To issue an AT command against the XBee inside of the XBee Gateway, pass that command as a parameter to the xbee command.
Examples:
xbee AI
xbee VR
xbee NI=myxbeegateway
xbee NJ=0xff
You can also send a remote AT command to another XBee on the RF network, by specifying the target node before the command.
Examples:
xbee 1bf2 VR
xbee 00:13:a2:00:12:34:56:78 AI
xbee LightSwitch1 VR
The target node can be specified by its 16-bit network address, 64-bit MAC address, or XBee node ID.
Manage over-the-air firmware updates of XBee devices
Use the command xbee fw_update to display the current firmware update status for all nodes in the cached node list.
Note This command displays only update statuses for nodes which have been updated by the XBee Gateway. If an update is being performed by another device on the network (such as another XBee Gateway, or other tool), this XBee Gateway will not be aware of that.
To update the firmware of the XBee module inside of the XBee Gateway, run the command xbee fw_update FILE, replacing FILE with the path to the firmware file you wish to install.
For example:
xbee fw_update /WEB/python/xbp24c-zb_405F.ebl
To perform an over-the-air update of an XBee module on the RF network, run the command xbee fw_update TARGET FILE, replacing TARGET with the node to update. As with other xbee commands, this can be a 16-bit address, 64-bit address, or XBee node ID.
If the target of an over-the-air update is an XBee Series 2 Zigbee module (S2, S2B, or S2C), when using the xbee fw_update TARGET FILE command, the XBee Gateway will automatically detect candidate updater nodes from the neighbors of the target. To select a specific updater node, use the command xbee fw_update TARGET UPDATER FILE.
When an over-the-air update is triggered using xbee fw_update TARGET ..., the update is scheduled in the XBee engine inside of the XBee Gateway and the command returns immediately. Run xbee fw_update to see the status of the update.
To cancel a scheduled over-the-air update, run xbee fw_update TARGET cancel. Note that if the update has already commenced, this will not interrupt the update operation.