XBee®/XBee‐PRO® ZB SMT RF Modules
Channel Scanning
As mentioned previously, routers and end devices must scan one or more channels to discover a valid network
to join. When a join attempt begins, the XBee sends a beacon request transmission on the lowest channel
specified in the SC (scan channels) command bitmask. If a valid PAN is found on the channel, the XBee will
attempt to join the PAN on that channel. Otherwise, if a valid PAN is not found on the channel, it will attempt
scanning on the next higher channel in the SC command bitmask. The XBee will continue to scan each channel
(from lowest to highest) in the SC bitmask until a valid PAN is found or all channels have been scanned. Once all
channels have been scanned, the next join attempt will start scanning on the lowest channel specified in the SC
command bitmask.
For example, if the SC command is set to 0x400F, the XBee would start scanning on channel 11 (0x0B) and scan
until a valid beacon is found, or until channels 11, 12, 13, 14, and 25 have been scanned (in that order).
Once an XBee router or end device joins a network on a given channel, if the XBee is told to leave (see "Leaving
a Network" section), it will leave the channel it joined on and continue scanning on the next higher channel in
the SC bitmask.
For example, if the SC command is set to 0x400F, and the XBee joins a PAN on channel 12 (0x0C), if the XBee
leaves the channel, it will start scanning on channel 13, followed by channels 14 and 25 if a valid network is not
found. Once all channels have been scanned, the next join attempt will start scanning on the lowest channel
specified in the SC command bitmask.
Managing Multiple ZigBee Networks
In some applications, multiple ZigBee networks may exist in proximity of each other. The application may need
provisions to ensure the XBee joins the desired network. There are a number of features in ZigBee to manage
joining among multiple networks. These include the following:
•PAN ID Filtering
•Preconfigured Security Keys
•Permit Joining
•Application Messaging
PAN ID Filtering
The XBee can be configured with a fixed PAN ID by setting the ID command to a non-zero value. If the PAN ID
is set to a non-zero value, the XBee will only join a network with the same PAN ID.
Preconfigured Security Keys
Similar to PAN ID filtering, this method requires a known security key be installed on a router to ensure it will
join a ZigBee network with the same security key. If the security key (KY command) is set to a non-zero value,
and if security is enabled (EE command), an XBee router or end device will only join a network with the same
security key.
Permit Joining
The Permit Joining parameter can be disabled in a network to prevent unwanted devices from joining. When a
new device must be added to a network, permit-joining can be enabled for a short time on the desired network.
In the XBee firmware, joining is disabled by setting the NJ command to a value less than 0xFF on all routers and
coordinator devices. Joining can be enabled for a short time using the commissioning push-button (see Network
Commissioning chapter for details) or the CB command.
Application Messaging
If the above mechanisms are not feasible, the application could build in a messaging framework between the
coordinator and devices that join its network. For example, the application code in joining devices could send a
transmission to the coordinator after joining a network, and wait to receive a defined reply message. If the
application does not receive the expected response message after joining, the application could force the XBee
to leave and continue scanning (see NR parameter).
© 2010 Digi International, Inc.
48