How to form Zigbee 3.0 network with EmberZnet stack?
As you know, currently the Zigbee Alliance only certificates the Zigbee 3.0 devices, some customers are familiar with HA1.2 network, but for Z3.0 network, there are many differences. This article is talking about how to form Z3.0 network with EmberZnet stack. Hope it is helpful for some junior Zigbee engineers who develop the Z3.0 devices.
Before we talk about the Z3.0 network, let's review the HA1.2 network quickly. It is easy to setup HA1.2 network, especially, Silicon labs provide lots of CLI commands which can be used conveniently. Here are the examples:
1. For HA1.2 network
// Form HA1.2 network on coordinator >> network form [channel:1] [power:1] [panId:2] eg: >> network form 12 3 0x1234
If you want to search for an unused Channel and Pan Id, and automatic form a network on the first unused Channel and Pan Id it finds, you can use below CLI command.
// Form HA1.2 network >> network find unused
Permit joining after the network is formed.
// Permit joining >> network pjoin [time:1] eg: >> network pjoin 200
// Joining a network >> network join [channel:1] [power:1] [panId:2] eg: >> network join 12 3 0x1234
2. For Z3.0 network
The Zigbee Alliance specifies the details of Z3.0 network in docs-13-0402-13-00zi-Base-Device-Behavior-Specification.pdf, any customers can download this file on Zigbee website if they are members of Zigbee Alliance.
First, you should know the difference between the Centralized and Distributed network in Z3.0 network.
Centralized security network:
A centralized security network is a ZigBee network formed by a ZigBee coordinator with the functionality of a Trust Center. Each node that joins such a network is authenticated with the Trust Center before it can operate on the network.
Distributed security network:
A distributed security network is a ZigBee network formed by a ZigBee router and which does not have a Trust Center. Each node that joins such a network is authenticated by its parent before it can operate on the network.
Then, let's use CLI commands to form the Z3.0 network. If you want to form Z3.0 network, you can use below CLI command:
// Form Z3.0 network. >> plugin network-creator form [centralized:1] [panId:1] [radioTxPower:1] [channel:1] //Form centralized network. >> plugin network-creator form 1 0x1234 3 12 //Form distributed network. >> plugin network-creator form 0 0x1234 3 12
If you want to search for an unused Channel and Pan Id, and automatic form a network on the best unused Channel and Pan Id it finds, you can use below CLI command.
// Form Z3.0 network. >>plugin network-creator start [useCentralizedSecurity:1] //Form centralized network. >> plugin network-creator start 1 //Form distributed network. >> plugin network-creator start 0
Open network after the network formed. If you go through the detailed implementation of this CLI command, it sets the TC policy and opens the network, but additionally puts the well known key into the transient key table.
// open network >> plugin network-creator-security open-network
If you want to join the network for routers or end devices, you can use below CLI command:
//option = 0 means the device will update TCLK after joining centralized network succeed, //otherwise it won’t. >> plugin network-steering start [options:1] // Update TCLK after joining network succeed. >> plugin network-steering start 0
Please note that, for router devices, it will form distributed network once it fails to join centralized network.
In conclusion, you can use above CLI commands to setup Z3.0 network, meanwhile, we have Z3Gateway/Z3LightSoc/Z3SwitchSoc samples in stack, you can build these samples to do testing quickly. If you want to get more details about the implementation of the CLI commands, please refer to the source code in plugins (Network Creator/Network Creator Security/Network Steering/Update TC Link Key).
CLi is just debug right?
if i want to automatic form a network with a unused channel, panID, which APIs i can refer to? i don't want to use CLI
By using Z3light, I made one as coordinator and another as router and I done successfully and able to transmit messages. But I am not able to pair similar router with coordinator, it overwrites the queue index. How to solve this?
after "plugin network-creator start", is it possible to destroy the network?
@ada li, this API is emberAfPluginNetworkCreatorStart(), you can refer to the source code of the network-creator-cli.c.
@Shreekant Prasad, of course you can put other router devices join network. Please note that you should make sure the network is opened, since the open network time is 180s by default. If you want to join the network out of the 180s you should type "plugin network-creator-security open-network" again.
@Pasquale Cimmino you can use CLI command "network leave" to let the device left the network.