Zigbee Bluetooth® LE Smart Home Mesh Solution

Revision as of 11:51, 12 April 2023 by Registered User

1 Overall description

This page describes the functioning of the smart home mesh solution (Zigbee-Bluetooh® LE) and how to handle it.

This project demonstrates the STM32WB application capabilities using Zigbee-Bluetooh® LE mesh solutions in a smart home application, with the additional use of a smartphone and the Amazon virtual assistant (Alexa).

Zigbee and BLE (Bluetooh® Low Energy) mesh connects multiple Zigbee and BLE devices with mesh networking capability for IoT (internet of things) solutions.


Zigbee BLE mesh illustration
Connectivity mesh-illustration 2.png


Mesh network has a many-to-many topology, with each device able to communicate with every other device in the network.

The BLE mesh communication is done using messages relayed by devices, which are part of the mesh network (called nodes). In this way, the end-to-end communication range is extended far beyond the radio range of each individual node.

A quick description of the BLE mesh vendor model is available in the ST BLE-Mesh application note[1].


Project overview
Connectivity EW2022 demo board-Page-4.jpg


To realize this project, seven STM32WB5MM-DK Discovery kits[2] were used. In addition, one Amazon Alexa assistant and two Android or iOS phones have to be included.

The three Zigbee nodes, the three BLE nodes, and the BLE/Zigbee bridge node can be controlled with the Zigbee hub built-in to the new Echo Show 10 Alexa assistant, or with a smartphone for the BLE mesh part.

2 Demonstration setup

2.1 Device requirement

The required material to set up the demonstration is as follows:

  • Seven STM32WB5MM-DK Discovery kits[2]: three as Zigbee routers, one as BLE mesh proxy, one as BLE mesh node, one as BLE mesh bridge, and one as Zigbee/BLE dynamic concurrent mode router.
  • One Amazon Alexa Echo assistant.
  • One smartphone to use the Alexa app using an Alexa account.
  • One smartphone with ST BLE Mesh application

2.2 Network setup

The different nodes are the following:

• 3x BLE mesh node o 1x BLE mesh bridge – GATT server proxy that connects to the Zigbee/BLE bridge GATT client o 1x BLE mesh proxy node – Connects with the smartphone app, "ST BLE Mesh" o 1x BLE mesh node – Generic BLE mesh node

• 1x BLE/Zigbee bridge node – BLE GATT client and Zigbee server node

• 3x Zigbee nodes – Zigbee server router node


Zigbee BLE smart home network
Connectivity Network.png



3 Device programming

Three STM32WB5MM-DK boards are used as BLE mesh nodes.

a. 1x STM32WB5MM-DK as the BLE mesh bridge

b. 1x STM32WB5MM-DK as the BLE mesh proxy node

c. 1x STM32WB5MM-DK as the BLE mesh node


Zigbee BLE smart home network
Connectivity Ble1.png



With CubeProgrammer, program the following firmware images on the respective STM32WB5MM-DK being used. But before programming these, perform a flash mass erase on each of the boards.

• 3x BLE mesh node


Connectivity M0.png




For reference, below is a trace log that the user should see after the BLE mesh firmware is loaded on the BLE mesh nodes.


Connectivity tera1.png



• 1x BLE/Zigbee bridge node – BLE GATT client and Zigbee server node

Connectivity bridge1.png



For reference, below is a trace log that the user should see after the BLE/Zigbee bridge firmware is loaded.

Connectivity tera2.png



• 3x Zigbee nodes – Zigbee server router-node

Connectivity zb node.png



Connectivity M0-2.png



4 BLE mesh node setup (provisioning)

Provision the three BLE mesh nodes from the iOS or Android ST BLE Mesh app following the procedure below for all:

• BLE mesh bridge

• BLE mesh proxy node

• BLE mesh node

Start by powering on the boards from a USB power hub.


Connectivity usb power hub.png



ST BLE

Start the provisioning process from the ST BLE Mesh app.


Connectivity smart1.png



Connectivity smart2.png



Connectivity smart3.png



When the three devices are provisioned, they appear under the devices window of the app.

Connectivity smart4.png



For reference, below is the trace log (115200 baud rate) from the BLE mesh nodes during provisioning.

Connectivity tera3.png



For reference, below is the trace log (115200 baud rate) from the BLE mesh proxy node in operation when being connected and controlled by the smartphone ST BLE Mesh app.

Connectivity tera4.png



5 Zigbee/BLE bridge node setup (provisioning)

It is important that the Zigbee/BLE bridge node setup is performed after setting up the BLE mesh nodes. Indeed, the Zigbee/BLE bridge is to connect to the BLE mesh bridge proxy node. Also, it is recommended to perform this step before running the rest of the Zigbee nodes, to prevent the Zigbee nodes from interfering.

Connectivity p2p.png




Note that it is critical that the BLE/Zigbee bridge node is connected and powered by a PC to connect to the board from a serial terminal (baudrate 115200) to see the trace logs, since the user has to visually verify if the BLE and Zigbee connections are established successfully. Note that this is the most complex step in the demo!

Note that while all other Zigbee and BLE mesh nodes are powered from a USB power hub, the “BLE/Zigbee Bridge” need to be powered from a PC or equivalent that permits you to run a serial terminal to view its traces.


Connectivity p2p2.png




Power on “Zigbee/BLE Bridge” board, and it comes up in BLE client mode and begin scanning for the BLE mesh proxy server device. It should discover it and connect to it automatically, as shown in the trace log below. However, if the GATT service and characteristic discovery fail and do not show as highlighted in the trace below, then the user should retry by resetting the board to retry the connection.


Connectivity tera5.png




Once the BLE client establishes the connection with the BLE mesh proxy server, the user should then manually start the Zigbee network scan, by pressing the user button 1 on the board to start the Zigbee network scan and join the request.


Connectivity DK BT1.png




The user button 1 press action shows up in the log as highlighted below.


Connectivity tera6.png




The user can now command Alexa to start the device discovery with one of two methods:

1. Using the Amazon Echo’s voice assistant by saying “Alexa, discover devices”

2. Using the Alexa app, as shown below:


Connectivity alexa1.png




Connectivity alexa2.png



Connectivity alexa3.png



Connectivity alexa4.png





From the trace log, the user should verify that the device joined the network successfully by verifying the highlighted trace.

If this trace is not displayed, the user should reset the “Zigbee/BLE bridge” board and retry the process.

Note that the Zigbee part in the “Zigbee/BLE bridge” device does not support data persistence. Therefore it must be added to the Alexa Zigbee network after every power cycle (in other words it repeats the cycle ).


Connectivity tera7.png





Note: In the event that the BLE/Zigbee bridge is power cycled or reset, the process to connect to the BLE mesh and Zigbee networks, described in section 6, must be repeated.

The previous added device need to be deleted from the Alexa app, as shown below.


Connectivity alexa5.png



6 Zigbee node setup (provisioning)

Power on reset of Zigbee nodes by connecting these to a USB power supply (or PC).

Unlike the Zigbee/BLE bridge, the Zigbee nodes start the network scan automatically after power on. Thus, no need for any user button to be pressed.


Connectivity znode.png




Next, command Alexa starts the device discovery with one of two methods:

1. Using the Amazon Echo’s voice assistant by saying “Alexa, discover devices”

2. Using the Alexa app, as shown below:


Connectivity alexa6.png




Connectivity alexa7.png




Connectivity alexa8.png




Connectivity alexa9.png




If the board is connected to a PC, the user can connect to the board using a serial terminal (baudrate 115200) to see traces. Ultimately, this step is optional while useful when troubleshooting.

For reference, Log should appear as shown below when scanning for the network to join.


Connectivity tera8.png





Connectivity tera9.png




When the user is setting up the Zigbee nodes for the first time, the user should press the user button 2 to clear any persistent data that could be stored in the flash memory.

However, once the Zigbee nodes have joined the network once, the user should not clear the persistent data to avoid having to repeat the provisioning process from section 6.

Then, press the RESET (B3) button to restart the application. Once the node has joined the Zigbee network, the network information is stored in the flash memory (called persistent data). This avoids having to go through this network join procedure again, even after the boards have been power cycled. The persistent data remains unless the user presses the user button 2.


Connectivity DK BT13.png




Connectivity tera10.png



7 Demo operation

For demo operation instructions, watch the Bluetooth® LE Mesh and Zigbee Smart Home Solutions video

8 References