How to use the Power Config cluster on a device acting as a Coordinator within a Centralized Zigbee network.
The purpose of this application is to show how to create a Zigbee centralized network, and how to communicate from one node to another one using the Power Config cluster. Once the Zigbee mesh network is created, the Server sends regularly the Battery availability in Percent to Client.
Connectivity, Zigbee, Zigbee protocol, 802.15.4 protocol, Power config cluster
For this application it is requested to have:
The Power Config Server updates regularly (30 s) its ZCL_POWER_CONFIG_ATTR_BATTERY_PCT attributes (via the measure of a sensor or by random).
The Power Config Client sends a Report Request to obtain regularly the ZCL_POWER_CONFIG_ATTR_BATTERY_PCT attributes.
The Power Config Server sends regularly (60 s) a Report with the latest value of ZCL_POWER_CONFIG_ATTR_BATTERY_PCT attributes.
Coord. SED +-------------+ +-------------+ | | | | | PowerConfig | | PowerConfig | | Client | | Server | - PowerConfig Server during Init | | Blue LED toggling (at report rx - 60 seconds) | | launch a 30 s Periodic Timer | | | | | | | | - Every 30 s | | | | * Read the battery (if exist - it does not) | | | | or simulate it with RNG. | | | | * <= ZbZclAttrIntegerWrite(ZCL_POWER_CONFIG_ATTR_BATTERY_PCT) | | After a Router was connected : | | | | ZbZclAttrReportConfigReq(ZCL_POWER_CONFIG_ATTR_BATTERY_PCT, 60sec)| | Green LED toggling (if CFG_FULL_LOW_POWER=2) | | -----------------------------------------------------------------> | | | | <----------------------------------------------------------------- | | | | | | | | <-------------- Report (every 60 seconds) -------------------------| | | | | | <= PushB SW1 : Start/Restart 30 s Periodic Timer. | | | | | | | | | | | | | | | | | | | | +-------------+ +-------------+
Start the first board. It must be the coordinator of the Zigbee network, so in this demo application it is the device running Zigbee_PowerConfig_Client_Coord application.
Wait for the Blue LED ON.
On Client side, every 60 s, the battery voltage is reported from the Server and the Blue led is toggling. To stop battery voltage evolution on Server, push SW1 push button (in wireshark EndDeviceTimeout immediatly sent with value 3), and to restart it push again SW1 (in wireshark EndDeviceTimeout immediatly sent with value 2).
Note: When LED Red, Green and Blue are toggling it is indicating an error has occurred on application.
This example runs on STM32WBA55xx devices.
This example has been tested with an STMicroelectronics STM32WBA55CGA_Nucleo board and can be easily tailored to any other supported device and development board.
On STM32WBA55CGA_Nucleo, the jumpers must be configured as described in this section. Starting from the top left position up to the bottom right position, the jumpers on the Board must be set as follows:
JP1: 1-2: [ON] 3-4: [OFF] 5-6: [OFF] 7-8: [OFF] 9-10: [OFF]
JP2: 1-2: [ON]
To get the traces you need to connect your Board to the Hyperterminal (through the STLink Virtual COM Port).
The UART must be configured as follows:
BaudRate = 115200 baud Word Length = 8 Bits Stop Bit = 1 bit Parity = none Flow control = none Terminal “Go to the Line” : <LF>