Device types
Zigbee defines three different device types: coordinator, router, and end device.
Coordinator
Zigbee networks may only have a single coordinator device. This device:
- Starts the network, selecting the channel and PAN ID (both 64-bit and 16-bit).
- Buffers wireless data packets for sleeping end device children.
- Manages the other functions that define the network, secure it, and keep it healthy.
- Cannot sleep; the coordinator must be powered on all the time.
Router
A router is a full-featured Zigbee node. This device:
- Can join existing networks and send, receive, and route information. Routing involves acting as a messenger for communications between other devices that are too far apart to convey information on their own.
- Can buffer wireless data packets for sleeping end device children. Can allow other routers and end devices to join the network.
- Cannot sleep; router(s) must be powered on all the time.
- May have multiple router devices in a network.
End device
An end device is essentially a reduced version of a router. This device:
- Can join existing networks and send and receive information, but cannot act as messenger between any other devices.
- Cannot allow other devices to join the network.
- Uses less expensive hardware and can power itself down intermittently, saving energy by temporarily entering a non responsive sleep mode.
- Always needs a router or the coordinator to be its parent device. The parent helps end devices join the network, and stores messages for them when they are asleep.
Zigbee networks may have any number of end devices. In fact, a network can be composed of one coordinator, multiple end devices, and zero routers.
The following diagram shows a generic Zigbee network.
Note Each Zigbee network must be formed by one, and only one, coordinator and at least one other device (router or end device).
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 can 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 an end device to join becomes the “parent” of the end device. Since the end device can sleep, the parent must be able to buffer or retain incoming data packets destined for the end device until the end device is able to wake and receive the data.
A device can only operate as one of the three device types. The device type is selected by configuration rather than by firmware image as was the case on earlier hardware platforms.
By default, the device operates as a router. To select coordinator operation, set CE to 1. To select end device operation, set SM to a non-zero value. To select router operation, both CE and SM must be 0.
If a device is a coordinator and it needs to be changed into an end device, you must set CE to 0 first. If not, the SM configuration will conflict with the CE configuration. Likewise, to change an end device into a coordinator, you must change it into a router first.
Another complication is that default parameters do not always work well for a coordinator.
For example:
- DH/DL is 0 by default, which allows routers and end devices to send transparent data to the coordinator when they first come up. If DH/DL is not changed from the default value when the device is changed to a coordinator, then the device sends data to itself, causing characters to be echoed back to the screen as they are typed. Since this is probably not the desired operation, set DH/DL to the broadcast address or some specific unicast address when the device is changed to a coordinator.
- Another example is EO for smart energy builds. Set this value to 08 for routers and end devices and 02 for the coordinator to designate it as the trust center. Therefore, if using authentication, which is the normal case for Smart Energy builds, change EO from 02 to 08 when CE is set to 1.
- Another example is EO for Zigbee builds. By default the value is 0x00. But if EO and EE are set to 0x01 on all radios in a network, then the network key will be sent in the clear (unencrypted) at association time. This may be a useful setting in development environments, but is discouraged for security reasons for product deployment.
In general, it is your responsibility to ensure that parameters are set to be compatible with the new device type when changing device types.