STM32WB BLE MESH Vendor Model

1. Technical Description

This page describes the functioning of the BLE Mesh Vendor Model Project and how to handle it.

A quick description of the BLE Mesh Vendor Model is available in the following Application Note:

Further information about the Vendor Model are available in chapter 3 of this page.

This project demonstrates STM32WB application capabilities using BLE-Mesh solution and with a sensor module and using specific Vendor commands. The goal of the application is to indicate the temperature measured by the discovery kits using the STM32WB55 and a LED bar connected on it.

Project Overview

To realize this project, we use two Discovery Kits including temperature and time of flight sensors, and two STM32WB55 boards. In addition, we have the possibility to add USB dongles as relay nodes.

The temperature is sent periodically on the Mesh network by the discovery kits. The LED bar changes color regarding the temperature, from blue for cold temperature to red for high temperature.

BLE Mesh Vendor Project Description

Each Nucleo boards have a RGB LED bar connected to it, which reflect the temperature measured in their respective rooms, and implement a Vendor Server Model.
The Discovrery Kits include temperature sensors and can be placed far from the user, for example in different rooms, and implement a Vendor Server Model.
The temperature is measured and sent to the STM32WB through BLE-Mesh Vendor Commands to update the LEDs status periodically.

2. Demonstration Setup

2.1. Device Requirement

Required material to setup the demonstration is the following:

  • 2 STM32WB55RG : as temperature information boards
  • 2 Blinkt! LED: RGB LED bar
  • 2 Discovery Kit : As temperature sensing boards
  • 1 or more USB Dongles (Optional) : As relay nodes. Can be bought with the in the Nucleo boards in the ST Nucleo Pack.
  • 1 Smartphone with Android or iOS

Click on Component Hyperlink to see resellers.

2.2. BLINKT LED Connection

Connect the LED bar to CN7 connector (left side of the board). The rounded edges of the LED bar must be placed towards the inside of the board. Let 7 Pins free from the beginning of CN7 connector, the LED will be connected from PIN15.

LED Bar Connection

2.3. Software Patch

Thermometer Application for Discovery Kit can be found on latest STM32CubeWB release :

Project BLE Mesh Thermometer - STM32WB5MM-DK



The Nucleo LED Indicator project is not included in this package as it required external Drivers.

A patch is available to include the Nucleo LED Indicator project and his dependencies to the Firmware package v1.12.0: STM32Cube_FW_WB_BLEMeshVendorThermometer_DEMO_V1.12.0.exe

Launch this .exe file and follow the instructions. In the Select Destination Location step, select the path to your Firmware Package.

Note: be careful to remove the \New Folder added automatically at the end of the path you selected

3. Architecture

3.1. Firmware Architecture

3.2. Vendor Model Code Architecture

4. Vendor Model Code Description TODO

4.1. Setup your nodes and enable the Vendor Model

For both Nodes, here Thermometer and Indicator nodes. In mesh_cfg_usr.h file, setup your node:

  • Number of Element, you can define up to 5 elements per nodes:
/* Max elements: 5 */
#define APPLICATION_NUMBER_OF_ELEMENTS                                         1
  • Number of Models per elements, you can define up to 11 models per elements:
/* Max total Models per element = (SIG + Vendor) = 11 */
/* Max SIG Models per element */
#define USER_SIG_MODELS_MAX_COUNT                                              1
/* Max Vendor Models per element */
#define USER_VENDOR_MODELS_MAX_COUNT                                           1
  • Enable Models required for your demonstration, here Vendor Model Server:
#define ENABLE_VENDOR_MODEL_SERVER                                           (1)

This Number defines in which element the model is enable and works as a bitmap:
- Bit 0 corresponds to element 1
- Bit 1 corresponds to element 2
- Bit 2 corresponds to element 3
- …
For example (5) means the model is enabled on element 1 and element 3

4.2. Define your Vendor Command

4.3. Publish a Vendor Command

5. Receive and manage a Vendor command TODO

  1. The new Vendor Command is included in an existing group
  2. The new Vendor Command is included in a new group


6. Demonstration Handle TODO