Revision as of 17:56, 18 December 2023 by Registered User (→‎How-To Join Zigbee Network)

For the sake of brevity, we will refer to Realistic Use Case (RUC) as an abbreviation throughout this discussion.

1. Introduction

The Zigbee protocol has developed for mesh networking capabilities of the internet of things (IoT) like home and building automation [1]. In the context of “Home automation”, the “Realistic Use Case” create and maintain a Zigbee mesh that runs 24h a day with a mix of different functionalities. The goal is to put our product in real-world situations that customers use to test and find potential problems before customers do.

Connectivity Realistic Use Case-Wiki-Overview logo.png

2. Zigbee Network

Without exception, the network is a “Home automation” network and the coordinator is only a Coordinator that is intended to become a “Home Gateway Device” (Zigbee HUB).
For more information about Zigbee network, refer to Wiki: Zigbee Network
The coordinator can be replaced by another such as Amazon Alexa, Google Home,… to add voice commands or test interoperability with other products.

Home Automation Example
Connectivity Realistic Use Case-Wiki-Overview Exemple.png

3. Zigbee RUC with STM32WB

The STM32CubeWB MCU Package[2] provides a lot of Zigbee applications that can be used to extend the main network.
But these applications should be adapted to run correctly in the RUC (Realistic Use Case) environment.
For this, the applications below have been created to reflect this reality:

  • On/Off Dimmable light [3]
  • Window covering [4]
  • Weather station [5]

4. Zigbee RUC SW architecture

To provide a more user-friendly working environment, the code architecture was modified. It enhances scalability, ease of maintenance and debugging. For this, some templates are developed to create Zigbee applications even more effortlessly. Previously, all the code was in a single file app_zigbee.c. In the RUC source code version, it has been split in several files and folders:

  • app_core.c : the main part where the application runs (start Zigbee stack, call services…).
  • app_menu_cfg.c : soft driver, enabling a colorful menu on UART interface [6]
  • app_zigbee.c : Manages the Zigbee primary functions to initialize stack, join network, binding…
  • app_nvm.c : Service to save Zigbee informations, enabling retrieval of the application’s state after reset or wake-up (Zigbee network, security keys, binding table, persistable attributes, …) [7]
  • Cluster Folder/File : containing all clusters files needed by the application (ex app_onoff.c)
Modification of code Architecture
Standard source code RUC source code
Connectivity Standard-source code exemple.png
Connectivity RUC-source code exemple.png


Soft Menu
This software driver enables a colorful menu via the UART. In all RUC examples, the implementation is almost same for all boards.
It displays whether messages comes from M4 or M0, the file name from which the message was emitted, and allows switching to the next/previous menu element or executing the current element on button press.
To avoid losing Menu, it appears always at the top of the Terminal.

Example of display on UART terminal


Different time press is using for different action; a short press is using to move left/right in menu choice and long/middle press is using to back menu or execute action.

  • Switch/User 1: short press moves to left item, long press back to previous menu
  • Switch 3/User 2: short press moves to right item, long press launch action (enter sub-menu, launch command)

When selected, a submenu displays in yellow surrounded by [...], while a command to launch is in yellow only.
As seen below, from the main menu it appears the [Network] submenu. From this submenu, it is possible to launch the Join Network command.

Soft Menu

5. How-To Join Zigbee Network

In the RUC examples, to put in a place the Zigbee Network it is the same procedure details in this section.
It is assumed by default that a Coordinator will be in charge to create the network and that you wish to add a new device (light switch or other).
Below the procedure assumes it on a Nucleo Board [8] for button name, but it is same on a DK board [9].

Coordinator side

  1. Select the [Network] sub-menu (press 2s on Switch 3)
  2. Launch the Permit join request action (press 2s on Switch 3)
  3. Displays in the Terminal if the action was launched correctly and how many time to executes the join Network on the new device
Permit Join


New Device side

  1. Select the [Network] sub-menu (press 2s on Switch 3)
  2. Launch the Join Network action (press 2s on Switch 3)
  3. If all steps are done correctly, you will get a message on the device: Join Channel : xx.
Join Network


Don't forget to back to main menu (press 2s on Switch 1)

6. How-To bind devices

This section describe only how to launch and bind two devices together in RUC via Soft Menu.
Please see Wiki: Zigbee Binding, for more information on the Zigbee binding functionality.
For all RUC, the process is the same:

  1. Target: Launch the Identify mode
  2. Initiator: Launch the Find & Bind query
Identify Mode start


Launch Find&Bind



7. Acronyms and definitions

Term Definition
ZC Zigbee Coordinator
ZR Zigbee Router
ZED Zigbee End Device
RUC Realistic Use Case
DK Discovery Kit

8. References