Zigbee® Green Power (ZGP) is included in the Zigbee 3.0 specification (Z3) (Zigbee Alliance, Zigbee 3.0 specification, https://www.zigbee.org/zigbee-for-developers/greenpower/). It is an end-to-end open standard that allows ultra-low power devices called Green Power Devices (GPDs) to operate on Zigbee networks. The technology requires ultra-low power RF silicon that uses many orders of magnitude less power than required for a Zigbee sleepy or fully-networked wireless connection.
The EFR32xG22 EM2 and EM4 power modes along with the back-up RAM feature make it suitable to implement a periodic or event-based GPD sensor with bidirectional commissioning and secured key exchange.
Description
This KBA demonstrates how to create a Green Power device using an EFR32MG22 and how it interacts with a Z3Light Green Power combo device using the sample applications provided in the EmberZNet SDK. Additionally, we demonstrate a way to disable CLI on both devices and still provision them so that they can work with each other.
Setup
You will need
Hardware
2 WSTK main board (BRD4001A)
1 MG22 radio board (BRD4182/83A or another EFR32xG22 board) acts as a Green Power device.
1 MG12 radio board (BRD4161A or any EFR32xG12/13 radio board) acts as a Z3 light and Green Power Combo device.
Simplicity studio IDE v4 with the following installed:
Wireless and RF Device Support
EmberZNet SDK version 6.7.1.0 or higher.
Usage
Generate, build and flash Green Power device project for EFR32MG22.
Launch Simplicity Studio v4 if you haven’t already and go to the Launcher view to start from the home screen.
Click File > New > Project This will launch the New Project Wizard.
Select Silicon Labs AppBuilder Project and press Next >
While this is part of the EmberZNet stack, this is a different application framework. Locate the Green Power Device Framework and select it, click Next >
Select EmberZNet 6.7.2.0 GA Green Power device Framework 6.7.2.0
Select Green Power Device and click Next >
The Project Configuration page will come up, give your project a name. Leave the location as default. Click Next >
Finally, you will arrive at the Project Setup screen. Here we will select the parts and compiler we are using for this project. They are as follows:
Select Board: EFR32MG22 2.4 Ghz Radio Board (BRD4183A or BRD4182A Rev A01) and the part number will be selected automatically
Compiler: You can use gcc or IAR ARM to compile this project, for this exercise we used gcc: GNU Arm v7.2.1.
Click the Finish button and wait for your project to be generated.
At this point you will be at the General tab of your Green Power Device.The device is ready to go by default, so you can click the Generate button to generate all of the files for your application.
Once generated, you will see a Generation validation dialog box. Make sure that you don't overwrite gpd-callbacks.c file as shown in this image. Click OK.
A Generation successful message should appear next. Click OK.
Click on your GPD project and build using the hammer icon in the toolbar.
Once built successfully, select and flash the .s37 binary file from your on your EFR32MG22 board by right clicking on the file and selecting Flash to device.
Generate, build and flash Z3LightGPComboSoc project for EFR32MG12 or other board.
Launch Simplicity Studio v4 if you haven’t already and go to the Launcher view to start from the home screen.
Click File > New > Project This will launch the New Project Wizard.
Select Silicon Labs AppBuilderProject and press Next >
Locate the Silicon Labs Zigbee and select it, click Next >
Select EmberZNet 6.7.2.0 GA SoC or the SoC project of your EmberZNet stack and click Next >
Select Z3LightGPCombo project and click Next.
The Project Configuration page will come up, give your project a name. Leave the location as default. Click Next >
Finally, you will arrive at the Project Setup screen. Here we will select the parts and compiler we are using for this project. They are as follows:
Board: EFR32MG12 2.4 Ghz Radio Board (BRD4161A Rev A02) or your EFR32MG board.
Compiler: You can use gcc or IAR ARM to compile this project, for this exercise we used gcc: GNU Arm v7.2.1.
Click the Finish button and wait for your project to be generated.
At this point you will be at the General tab of your Z3LightGPCombo isc file. Click Generate on the top right corner.
Once generated, you will see a Generation validation dialog box. Click OK.
A Generation successful message should appear next. Click OK.
Click on your GPD project and build using the hammer icon in the toolbar.
Once built successfully, select and flash the .s37 binary file from your on your EFR32MG22 board by right clicking on the file and selecting Flash to device.
At this point there are two variation to the pairing process which depend on whether CLI is enabled or disabled on the Zigbee Combo device.
CLI enabled on Green Power device and Zigbee Combo device
Modifications
In the green power device software example, CLI is enabled by default. To make it work right, you must increase receive window. You can use CLI for accessing plugins and sending toggle commands. Toggle functionality is enabled by default on the PB1 button in the GP software example. Since CLI and printing is enabled on the Z3Lights by default, we need to account for this when we leave bi-directional communications on the GPD. This is handled via a simple change in the GUI of AppBuilder.
Open the ISC file of your Green Power project.
Click on plugins.
In the top section of the Plugs find GPD App Configuration, you can use the search bar too if you would like. Select it.
You should now see the GPD App Configuration options on the right side of your screen. Look down the list, the 11th item down the list is GPD BiDirectional Rx Window. The value 10 is good for production devices, but too small when you enable CLI/Printing on your light. Increase this value to 100 to allow for proper pairing.
If this is the only modification you are looking to make, click on Generate on the top right corner, acknowledge any follow-up boxes. Once generated, compile and flash the .s37 file to your device.
Commissioning and Testing
Right click on the board under Debug Adapters and select Launch Console.
This should bring up a new view on the main window that says Serial 0 | Serial 1 | Admin | Debug. Click the spot where it says Serial 1. At this terminal window hit enter a few times, you should be presented 1 or more of such prompts:
LabZ3Light4166> If you get this, your board is programed successfully with CLI enabled. At this point you must ensure that a network is formed. In the CLI window of Z3Combo device, type info and check the output for such a statement. You can see that the network is up if the nodeID is assigned.
panID [0x7B8A] nodeID [0xD994] xpan [0x(>)FB780DB2E8C5E776]
If a network isn't created, form a network using the command in the CLI
plugin network-creator start 0
On the CLI of the Z3LightCombo enter the following command: plugin green-power-server commission 9 0 0 1 This will open the Light for joining with your GPD. The parameters are:
Mode Mask 0x0 Leave, 0x1 Commission, 0x8 Proxies, tells the light to enter commissioning mode by itself and also to Broadcast to all devices telling them to be ready to open and find a GP device.
Green Power Manager (GPM) address for security
Green Power Manager (GPM) address for pairing
Sink endpoint
On the Green Power Device you now will want to find button PB0, it is the button under the screen on the right. You will press this button 4 times, waiting 1+ second between each press, for example:
Press once … wait 1+ second
Press twice … wait 1+ second
Press a third time … wait 1+ second
Press a fourth time … done
Each of these button presses are the following steps: Press 1 – Channel request: To find the channel of the Zigbee network and use use that for commissioning requests Press 2 – Commissioning command: Commissioning request Press 3 – Commissioning command: To collect the commissioning reply Press 4 – Commissioning command: To indicate the successful commissioning
On the CLI of Zigbee Combo device, look for an output that looks like the following:
GP CN : Saving the GPDCalling Adding TT and SinkgpdCommandClusterEpMap[0].gpdCommand = 32 gpdCommandClusterEpMap[0].endpoints[0] = 1gpdCommandClusterEpMap[1].gpdCommand = 33 gpdCommandClusterEpMap[1].endpoints[0] = 1gpdCommandClusterEpMap[2].gpdCommand = 34 gpdCommandClusterEpMap[2].endpoints[0] = 1SinkCommissioningModeCallback(Exit) send returned 0
.
.
.
Device Announce: 0x5678
What you really want to see is the device announce. This output means that your GPD has paired and your Light has made entries for it in its tables. You can test this by pressing PB1, it should make your light toggle on and off. If you do not see this or PB1 does not flash your lights, try pressing the reset button on the Zigbee combo device. If you still don't get it, re-run the steps in this section and try again.
CLI disabled on Green Power device and Zigbee Combo device
Modifications
Go to CLI tab in the ISC file of both the Green power and Zigbee combo device project and uncheck the "Enable command line interface" option.
If this is the only modification you are looking to make, click on Generate on the top right corner, acknowledge any follow-up boxes. Once generated, compile and flash the .s37 file to your device.
Commissioning and Testing
Without the CLI, the commissioning process needs to be started through callbacks in the Zigbee Combo device project once the network is up. The callbacks are located in <Your Project name>_callbacks.c file for example Z3LightGPComboSoc_callbacks.c.
The function you are looking for is called void emberAfPluginNetworkSteeringCompleteCallback. Insert the following line in the end of the function. This function call does the same thing as executing the command plugin green-power-server commission 9 0 0 1 from CLI.
emberAfGreenPowerClusterGpSinkCommissioningModeCallback(9,0,0,1); where the parameters are
<uint8_t> Mode Mask 0x0 Leave, 0x1 Commission, 0x8 Proxies tells the light to enter commissioning mode by itself and also to Broadcast to all devices telling them to be ready to open and find a GP device.
<uint16_t> Green Power Manager (GPM) address for security
<uint16_t> Green Power Manager (GPM) address for pairing
<uint8_t> Sink endpoint
void emberAfPluginNetworkSteeringCompleteCallback(EmberStatus status,
uint8_t totalBeacons,
uint8_t joinAttempts,
uint8_t finalState)
{
emberAfCorePrintln("%p network %p: 0x%X", "Join", "complete", status);
if (status != EMBER_SUCCESS) {
// Initialize our ZLL security now so that we are ready to be a touchlink
// target at any point.
status = emberAfZllSetInitialSecurityState();
if (status != EMBER_SUCCESS) {
emberAfCorePrintln("Error: cannot initialize ZLL security: 0x%X", status);
}
status = emberAfPluginNetworkCreatorStart(false); // distributed
emberAfCorePrintln("%p network %p: 0x%X", "Form", "start", status);
emberAfGreenPowerClusterGpSinkCommissioningModeCallback(9,0,0,1);
}
}
Compile and flash to your board. Upon start, the Zigbee Combo device will form a network and open the Light device for joining with your GPD.
On the Green Power Device you now will want to find button PB0, it is the button under the screen on the right. You will press this button 4 times, waiting 1+ second between each press, for example:
Press once … wait 1+ second
Press twice … wait 1+ second
Press a third time … wait 1+ second
Press a fourth time … done
Each of these button presses are the following steps: Press 1 – Channel request: To find the channel of the Zigbee network and use use that for commissioning requests Press 2 – Commissioning command: Commissioning request Press 3 – Commissioning command: To collect the commissioning reply Press 4 – Commissioning command: To indicate the successful commissioning
Since we don't have CLI, the only way to find out if this process is successful is by pressing PB1 on the GP device to see if the light on the Combo device toggles.
Zigbee & Thread Knowledge Base
Getting Started with Silicon Labs Green Power Device using EFR32MG22
Background
Zigbee® Green Power (ZGP) is included in the Zigbee 3.0 specification (Z3) (Zigbee Alliance, Zigbee 3.0 specification, https://www.zigbee.org/zigbee-for-developers/greenpower/). It is an end-to-end open standard that allows ultra-low power devices called Green Power Devices (GPDs) to operate on Zigbee networks. The technology requires ultra-low power RF silicon that uses many orders of magnitude less power than required for a Zigbee sleepy or fully-networked wireless connection.
The EFR32xG22 EM2 and EM4 power modes along with the back-up RAM feature make it suitable to implement a periodic or event-based GPD sensor with bidirectional commissioning and secured key exchange.
Description
This KBA demonstrates how to create a Green Power device using an EFR32MG22 and how it interacts with a Z3Light Green Power combo device using the sample applications provided in the EmberZNet SDK. Additionally, we demonstrate a way to disable CLI on both devices and still provision them so that they can work with each other.
Setup
You will need
Hardware
2 WSTK main board (BRD4001A)
1 MG22 radio board (BRD4182/83A or another EFR32xG22 board) acts as a Green Power device.
1 MG12 radio board (BRD4161A or any EFR32xG12/13 radio board) acts as a Z3 light and Green Power Combo device.
Simplicity studio IDE v4 with the following installed:
Wireless and RF Device Support
EmberZNet SDK version 6.7.1.0 or higher.
Usage
Generate, build and flash Green Power device project for EFR32MG22.
Launch Simplicity Studio v4 if you haven’t already and go to the Launcher view to start from the home screen.
Click File > New > Project This will launch the New Project Wizard.
Select Silicon Labs AppBuilder Project and press Next >
While this is part of the EmberZNet stack, this is a different application framework. Locate the Green Power Device Framework and select it, click Next >
Select EmberZNet 6.7.2.0 GA Green Power device Framework 6.7.2.0
Select Green Power Device and click Next >
The Project Configuration page will come up, give your project a name. Leave the location as default. Click Next >
Finally, you will arrive at the Project Setup screen. Here we will select the parts and compiler we are using for this project. They are as follows:
Select Board: EFR32MG22 2.4 Ghz Radio Board (BRD4183A or BRD4182A Rev A01) and the part number will be selected automatically
Compiler: You can use gcc or IAR ARM to compile this project, for this exercise we used gcc: GNU Arm v7.2.1.
Click the Finish button and wait for your project to be generated.
At this point you will be at the General tab of your Green Power Device.The device is ready to go by default, so you can click the Generate button to generate all of the files for your application.
Once generated, you will see a Generation validation dialog box. Make sure that you don't overwrite gpd-callbacks.c file as shown in this image. Click OK.
A Generation successful message should appear next. Click OK.
Click on your GPD project and build using the hammer icon in the toolbar.
Once built successfully, select and flash the .s37 binary file from your on your EFR32MG22 board by right clicking on the file and selecting Flash to device.
Generate, build and flash Z3LightGPComboSoc project for EFR32MG12 or other board.
Launch Simplicity Studio v4 if you haven’t already and go to the Launcher view to start from the home screen.
Click File > New > Project This will launch the New Project Wizard.
Select Silicon Labs AppBuilder Project and press Next >
Locate the Silicon Labs Zigbee and select it, click Next >
Select EmberZNet 6.7.2.0 GA SoC or the SoC project of your EmberZNet stack and click Next >
Select Z3LightGPCombo project and click Next.
The Project Configuration page will come up, give your project a name. Leave the location as default. Click Next >
Finally, you will arrive at the Project Setup screen. Here we will select the parts and compiler we are using for this project. They are as follows:
Board: EFR32MG12 2.4 Ghz Radio Board (BRD4161A Rev A02) or your EFR32MG board.
Compiler: You can use gcc or IAR ARM to compile this project, for this exercise we used gcc: GNU Arm v7.2.1.
Click the Finish button and wait for your project to be generated.
At this point you will be at the General tab of your Z3LightGPCombo isc file. Click Generate on the top right corner.
Once generated, you will see a Generation validation dialog box. Click OK.
A Generation successful message should appear next. Click OK.
Click on your GPD project and build using the hammer icon in the toolbar.
Once built successfully, select and flash the .s37 binary file from your on your EFR32MG22 board by right clicking on the file and selecting Flash to device.
At this point there are two variation to the pairing process which depend on whether CLI is enabled or disabled on the Zigbee Combo device.
CLI enabled on Green Power device and Zigbee Combo device
Modifications
In the green power device software example, CLI is enabled by default. To make it work right, you must increase receive window. You can use CLI for accessing plugins and sending toggle commands. Toggle functionality is enabled by default on the PB1 button in the GP software example. Since CLI and printing is enabled on the Z3Lights by default, we need to account for this when we leave bi-directional communications on the GPD. This is handled via a simple change in the GUI of AppBuilder.
Open the ISC file of your Green Power project.
Click on plugins.
In the top section of the Plugs find GPD App Configuration, you can use the search bar too if you would like. Select it.
You should now see the GPD App Configuration options on the right side of your screen. Look down the list, the 11th item down the list is GPD BiDirectional Rx Window. The value 10 is good for production devices, but too small when you enable CLI/Printing on your light. Increase this value to 100 to allow for proper pairing.
If this is the only modification you are looking to make, click on Generate on the top right corner, acknowledge any follow-up boxes. Once generated, compile and flash the .s37 file to your device.
Commissioning and Testing
Right click on the board under Debug Adapters and select Launch Console.
This should bring up a new view on the main window that says Serial 0 | Serial 1 | Admin | Debug. Click the spot where it says Serial 1. At this terminal window hit enter a few times, you should be presented 1 or more of such prompts:
LabZ3Light4166> If you get this, your board is programed successfully with CLI enabled. At this point you must ensure that a network is formed. In the CLI window of Z3Combo device, type info and check the output for such a statement. You can see that the network is up if the nodeID is assigned.
panID [0x7B8A] nodeID [0xD994] xpan [0x(>)FB780DB2E8C5E776]
If a network isn't created, form a network using the command in the CLI
plugin network-creator start 0
On the CLI of the Z3LightCombo enter the following command:
plugin green-power-server commission 9 0 0 1
This will open the Light for joining with your GPD. The parameters are:Mode Mask 0x0 Leave, 0x1 Commission, 0x8 Proxies, tells the light to enter commissioning mode by itself and also to Broadcast to all devices telling them to be ready to open and find a GP device.
Green Power Manager (GPM) address for security
Green Power Manager (GPM) address for pairing
Sink endpoint
On the Green Power Device you now will want to find button PB0, it is the button under the screen on the right. You will press this button 4 times, waiting 1+ second between each press, for example:
Press once … wait 1+ second
Press twice … wait 1+ second
Press a third time … wait 1+ second
Press a fourth time … done
Each of these button presses are the following steps: Press 1 – Channel request: To find the channel of the Zigbee network and use use that for commissioning requests Press 2 – Commissioning command: Commissioning request Press 3 – Commissioning command: To collect the commissioning reply Press 4 – Commissioning command: To indicate the successful commissioning
On the CLI of Zigbee Combo device, look for an output that looks like the following:
GP CN : Saving the GPD
Calling Adding TT and Sink
gpdCommandClusterEpMap[0].gpdCommand = 32 gpdCommandClusterEpMap[0].endpoints[0] = 1
gpdCommandClusterEpMap[1].gpdCommand = 33 gpdCommandClusterEpMap[1].endpoints[0] = 1
gpdCommandClusterEpMap[2].gpdCommand = 34 gpdCommandClusterEpMap[2].endpoints[0] = 1
SinkCommissioningModeCallback(Exit) send returned 0
.
.
.
Device Announce: 0x5678
What you really want to see is the device announce. This output means that your GPD has paired and your Light has made entries for it in its tables. You can test this by pressing PB1, it should make your light toggle on and off. If you do not see this or PB1 does not flash your lights, try pressing the reset button on the Zigbee combo device. If you still don't get it, re-run the steps in this section and try again.
CLI disabled on Green Power device and Zigbee Combo device
Modifications
Go to CLI tab in the ISC file of both the Green power and Zigbee combo device project and uncheck the "Enable command line interface" option.
If this is the only modification you are looking to make, click on Generate on the top right corner, acknowledge any follow-up boxes. Once generated, compile and flash the .s37 file to your device.
Commissioning and Testing
Without the CLI, the commissioning process needs to be started through callbacks in the Zigbee Combo device project once the network is up. The callbacks are located in <Your Project name>_callbacks.c file for example
Z3LightGPComboSoc_callbacks.c
.The function you are looking for is called
void emberAfPluginNetworkSteeringCompleteCallback
. Insert the following line in the end of the function. This function call does the same thing as executing the commandplugin green-power-server commission 9 0 0 1
from CLI.emberAfGreenPowerClusterGpSinkCommissioningModeCallback
(9,0,0,1);
where the parameters are<uint8_t> Mode Mask 0x0 Leave, 0x1 Commission, 0x8 Proxies tells the light to enter commissioning mode by itself and also to Broadcast to all devices telling them to be ready to open and find a GP device.
<uint16_t> Green Power Manager (GPM) address for security
<uint16_t> Green Power Manager (GPM) address for pairing
<uint8_t> Sink endpoint
Compile and flash to your board. Upon start, the Zigbee Combo device will form a network and open the Light device for joining with your GPD.
On the Green Power Device you now will want to find button PB0, it is the button under the screen on the right. You will press this button 4 times, waiting 1+ second between each press, for example:
Press once … wait 1+ second
Press twice … wait 1+ second
Press a third time … wait 1+ second
Press a fourth time … done
Each of these button presses are the following steps: Press 1 – Channel request: To find the channel of the Zigbee network and use use that for commissioning requests Press 2 – Commissioning command: Commissioning request Press 3 – Commissioning command: To collect the commissioning reply Press 4 – Commissioning command: To indicate the successful commissioning
Since we don't have CLI, the only way to find out if this process is successful is by pressing PB1 on the GP device to see if the light on the Combo device toggles.