Node Parameters
Last updated
Last updated
When configuring a node, it is necessary to set some parameters which will be used lately in the network, and some parameters necessary for using the API functions.
ZigBee defines three different device types: coordinator, router, and end devices. An example of a possible network is shown below:
Coordinator
Each ZigBee network must have one coordinator. A coordinator has the following characteristics:
It selects the channel and PAN ID (both 64-bit and 16-bit) to start the network.
It can allow routers and end devices to join the network.
It can assist in routing data.
It can not sleep. It has to be always awake.
Router
A router has the following characteristics:
It must join a ZigBee network before it can transmit, receive or route data.
After joining, it can allow routers and end devices to join the network.
After joining, it can route data.
It can not sleep. It has to be always awake.
End Device
An End Device has the following characteristics:
It must join a ZigBee network before it can transmit or receive data.
It can not allow devices to join the network.
It must always transmit and receive RF data through its parent.
It can not route data.
It can sleep.
In ZigBee networks, the coordinator must select a PAN ID (64-bit and 16-bit) and channel to start a network. After that, it behaves essentially like a router. The coordinator and routers can allow other devices to join the network and route data.
After an end device joins a router or coordinator, it must be able to transmit or receive RF data through that router or coordinator. The router or coordinator that allowed the end device to join becomes its parent. Since the end device can sleep, the parent must be able to buffer or retain incoming data packets destined for the end device until it is able to wake up and receive the data.
64-bit RF module's unique IEEE address. It is divided in two groups of 32 bits (High and Low).
It identifies uniquely a node inside a network due to it can not be modified and it is given by the manufacturer. Due to ZigBee uses 16-bit addresses to send packets inside a network, MAC address is not as much important as in 802.15.4 modules.
Example of use
Related variables:
xbeeZB.sourceMacHigh[0-3]
→ stores the 32 upper bits of MAC address
xbeeZB.sourceMacLow [0-3]
→ stores the 32 lower bits of MAC address
Besides, XBee modules provide a sticker on the bottom side where the MAC address is indicated. MAC addresses are specified as 0013A200xxxxxxxx.
Firstly, it is important to keep in mind different PAN ID parameters:
Extended PAN ID: This is a readable/writable 64-bit parameter which refers to the PAN ID the XBee module wants to join in the case of routers and end devices. In the case of coordinators, it will set the new operating 64-bit PAN ID.
Operating Extended PAN ID: This is a read-only 64-bit parameter which refers to the 64-bit PAN ID the XBee module is working on.
Operating 16-bit PAN ID: This is a read-only 16-bit parameter which refers to the 16-bit PAN ID the XBee module is working on.
Each ZigBee network is defined by both 64-bit and 16-bit operating PAN IDs. Devices on the same ZigBee network must share the same 64-bit and 16-bit PAN IDs.
ZigBee routers and end devices should be configured with the operating 64-bit PAN ID the coordinator is working on. If a joining node has set its PAN ID, it will only join a network with that operating 64-bit PAN ID. They acquire the 16-bit PAN ID from the coordinator when they join a network.
The Extended PAN ID is a 64-bit number that identifies the network. It must be unique to differentiate a network. All the nodes in the same network should have the same PAN ID.
There are two possibilities to set:
Non-zero PAN ID: If the Coordinator sets this parameter to a non-zero value, this PAN ID will be set as operating 64-bit PAN ID. If Routers and End Devices set a non-zero value, they will only join a network with that PAN ID.
Zero PAN ID: If the Coordinator sets this parameter to a zero value, it will select a random operating 64-bit PAN ID. Routers and End Devices will attempt to join this random network if they are not associated to any network yet.
Example of use
Related variables:
xbeeZB.PAN_ID[0-7]
→ stores the 64-bit Extended PAN ID
The Operating Extended PAN ID is the current 64-bit PAN ID the module is working on. The operating Extended PAN ID is intended to be a unique, non-duplicated value.
When a coordinator starts a network, it can either start a network on a specific configured Extended PAN ID, or it can select a random PAN ID by previously setting the Extended PAN ID to zero.
In the case of Routers and End Devices, they will only join the non-zero Extended PAN ID they have set. If Extended PAN ID has been set to zero, they will try to join any network.
Example of use:
Related variables:
xbeeZB.operating64PAN[0-7]
→ stores the 64-bit Operating PAN ID
The Operating 16-bit PAN ID is the current 16-bit PAN ID the module is working on. The Operating 16-bit PAN ID is used as a MAC layer addressing field in all RF data transmissions between devices in a network. It is used to reduce overheads on application level tasks.
The Operating 16-bit PAN ID is set by the coordinator when the network is created and it is set to routers and end devices when they join the network. Thus, the 16-bit PAN ID can not be configured by the user.
Example of use
Related variables:
xbeeZB.operating16PAN[0-1]
→ stores the 16-bit Operating PAN ID
This is the 16-bit Network Address. When a node joins the network, the Coordinator assigns a 16-bit address that can not be changed until the node leaves the PAN or the Coordinator decides to change it. ZigBee uses 16-bit addresses to send the packets inside the network to reduce overhead. If the 16-bit address of the destination node is not known, a process called 'Address Discovery' will be executed. This process is transparent to the user.
Example of use
Related variables:
xbeeZB.sourceNA[0-1]
→ stores the 16-bit network address
It is an ASCII string of 20 character at most which identifies the node in a network. It is used to identify a node in application level. It is also used to search a node using its NI.
Example of use
Related variables:
xbeeZB.nodeID[0-19]
→ stores the 20-byte max string Node Identifier
ZigBee works on the 2.4 GHz band, using 16 channels. When starting a network, the coordinator must select a "good" channel for the network to operate on. To do this, it performs an energy scan on multiple channels (that is, frequencies) to detect energy levels on each channel. The coordinator removes channels with excessive energy levels from its list of potential channels to start on.
Channel
Number
0x0B -- Channel 11
2.400 -- 2.405 GHz
0x0C -- Channel 12
2.405 -- 2.410 GHz
0x0D -- Channel 13
2.410 -- 2.415 GHz
0x0E -- Channel 14
2.415 -- 2.420 GHz
0x0F -- Channel 15
2.420 -- 2.425 GHz
0x10 -- Channel 16
2.425 -- 2.430 GHz
0x11 -- Channel 17
2.430 -- 2.435 GHz
0x12 -- Channel 18
2.435 -- 2.440 GHz
0x13 -- Channel 19
2.440 -- 2.445 GHz
0x14 -- Channel 20
2.445 -- 2.450 GHz
0x15 -- Channel 21
2.450 -- 2.455 GHz
0x16 -- Channel 22
2.455 -- 2.460 GHz
0x17 -- Channel 23
2.460 -- 2.465 GHz
0x18 -- Channel 24
2.465 -- 2.470 GHz
0x19 -- Channel 25
2.470 -- 2.475 GHz
0x1A -- Channel 26
2.480 -- 2.485 GHz
Figure: Channel Frequency Numbers
Example of use:
Related variables:
xbeeZB.channel
→ stores the operating channel
Device type value. This value can be used to differentiate multiple XBee-based products.
Example of use
Related variables:
xbeeZB.deviceType[0-3]
→ stores the device type identifier
The setCoordinator()
function will set whether the device is a coordinator or not.
The getCoordinator()
function will read whether the device is a coordinator or not. The attribute coordinatorEnable
permits to access to the settings of the module.
In other words, there is only one item, one radio, and it can be both a coordinator or a router/end-device.
There is no function to set or query whether the module is working as a router or as an end device. As described in the "Node types" section, the sleep mode besides the state of coordinatorEnable
will determine the node type. The routers have no sleep mode. The end devices are set to work with a specific sleep mode.
Example of use
Related variables:
xbeeZB.coordinatorEnable
→ stores the coordinator mode (1: coordinator; 0: non-coordinator)