STM32WB Bluetooth® LE Mesh Lighting Application

Revision as of 15:55, 22 February 2022 by Registered User

1. Presentation

This page describes how to quickly handle Bluetooth® LE-MeshLightingPRFNode example.
This project can be found on latest STM32CubeWB MCU Package[1], and generates a basic Node supporting Proxy-Relay-Friend features.
It is a good introduction to handle and have a first approach of ST Bluetooth® LE-Mesh solution.

PRF Node project directory
Connectivity PRF-directory.png

Some of the following information can be retrieved in the STM32WB Bluetooth® LE-mesh hands-on[2] video .

2. Functioning

Bluetooth® LE-MeshLightingPRFNode project demonstrates STM32WB application capabilities using ST Bluetooth® LE-Mesh with basic models.

PRF-Node project description
Connectivity PRF-demo.png

3. Getting Started

Bluetooth® LE-MeshLightingPRFNode project implement a Bluetooth® LE-mesh Node supporting Proxy, Relay and Friend features, these features are sufficient to setup a first mesh Network, see Bluetooth® LE mesh wiki page.

3.1. Requirements

Software and System requirements
The software required are the following (minimum IDEs version):

  • IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2
  • RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.23
  • STM32CubeIDE toolchain V1.7.0 [3].

Programmer:

  • STM32CubeProgrammer[4] : To flash the board with an already generated binary

Smartphone application:

More information about software and system requirements are available in the ST Bluetooth® LE-Mesh Application Note[5].

Hardware requirements
P-NUCLEO-WB55[6] is necessary to setup the demonstration.

P-NUCLEO-WB55
Connectivity nucleo-description.png
Connectivity dongle.png

More details about the board and other hardware required are available in the Application Note[5], or in the online ST Bluetooth® LE-Mesh MOOC[7].

3.2. Build and install the application

Details about application build and installation are given into the Application Note[5].
However, some more details about the build process using STM32CubeIDE[8] are available below.

Launch the Cube IDE[8] .project of the demonstration, ensure your project is correctly visible into Project Explorer view.

CubeIDE: project file
Connectivity PRF-Demo-CubeIDE-1.png

Build you project by reproducing the following steps:

CubeIDE: build project
Connectivity PRF-Demo-CubeIDE-1-bis.png

Flash it on the board (only for nucleo board):

CubeIDE: flash project
Connectivity PRF-Demo-CubeIDE-2.png

3.3. Install the application from Cube Programmer

It is either possible to flash the previously build binary using STM32CubeProgrammer software[9].

Select your device and connect to it:

  • For USB dongle, move the SW2 switch on Boot0 before, then connect it to the computer and use the USB mode
CubeProgrammer: board connection
Connectivity CubeProgrammer-1.png


Once connected, device information is displayed on Cube Programmer interface. Click on programming icon, in the left column, and select the project binary to flash (here BLE_MeshLightingPRFNode.hex). Then, click ok Start Programming button:

CubeProgrammer: flash project
Connectivity CubeProgrammer-3.png


When the programming is complete the following logs are displayed:

CubeProgrammer: logs
Connectivity CubeProgrammer-4.png

3.4. UART Interface

The board is connected to a PC via a USB connection. Use any convenient software terminal to open the serial communication port of the PC to check the messages from the board. Select your Serial port and setup your connection as follow (example done with Tera Term software).

Set a new serial connection to the ST platform:

Tera Term setup (1/2)
Connectivity tera-term-1-2.png

Setup your serial connection as below:

Tera Term setup (2/2)
Connectivity tera-term-3-4.png

Once the board is connected and the terminal window setup, press the reset button of the board. The following messages are printed to the virtual COM window when the firmware starts successfully:

Terminal logs at startup
Connectivity PRF-Demo-terminal.png

3.5. Application Handle

A full description of ST BLE Mesh smartphone application can be found on the Android Application User Manual[10], and the iOS Application User Manual[11].

Ensure the board is un-provisioned:

  • For nucleo board, press RESET puce1violette.png and SW1 puce2violette.png buttons simultaneously, release RESET and keep SW1 pressed until the LED1 puce3violette.png is blinking:
STM32WB Nucleo un-provisioning process
Connectivity LightLC-demo20-bis.png


  • For USB dongle, press SW1 puce1violette.png, plug the dongle and keep SW1 pressed until the LED1 puce2violette.png is blinking:
STM32WB Dongle un-provisioning process
Connectivity dongle SW1 LED1.png


Launch the ST Bluetooth® LE Mesh smartphone application, the illustrations below are based on the Android version of the application.

Provision the device:

Bluetooth® LE Mesh application: provisioning steps
Connectivity 1-Prov.png


Configure the device using Quick Configuration Button, select the App Key and set the publication and subscription addresses:

Bluetooth® LE Mesh application: configuration steps
Connectivity 2-Conf.png


The node is now provisioned. You can click on the first settings button to rename the node. The second button to access the elements and models setup. This allows to change the subscription and publication addresses for each model.

Bluetooth® LE Mesh application: node renaming
Connectivity 3-Settings.png


If an issue occurs during provisioning, for example the App Key binding failed for one or more models, you can bind the App Key from this interface, and change the publication/subscription addresses.

Bluetooth® LE Mesh application: address binding
Connectivity 4-Binding-Addr.png


From the Node interface, you can send a Generic OnOff command to pilot the board LED puce1violette.png. You can also switch to the model interface, where you can select the model available on the nodes of your network. Generic Model interface allows to play with the Generic OnOff puce2violette.png, Generic Level puce3violette.png and Generic Power OnOff puce4violette.png commands. Lighting Model interface allows to play with the Light Lightness Commands puce5violette.png and puce6violette.png.

Bluetooth® LE Mesh application: Generic and Lightness interfaces
Connectivity 5-Model-Interfaces.png


You can add several nodes to your network by repeating the provisioning process on other boards.

Bluetooth® LE Mesh application: nodes interface
Connectivity 6-Nodes.jpg


Info white.png Information
You can find complementary information in the Hands-on[2] video.

4. References