STM32WB Bluetooth® LE Mesh Embedded Provisioning Application

Revision as of 16:04, 22 February 2022 by Registered User

1. Embedded Provisioner Introduction

Embedded Provisioner is a proprietary solution to provision a Bluetooth® LE-Mesh network from a STM32WB platform instead of using a smartphone or tablet.

2. 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 [1].

Programmer:

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

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

Hardware requirements
P-NUCLEO-WB55 Nucleo board[4] is necessary to setup the demonstration.

STM32WB Nucleo board
Connectivity nucleo-description.png

3. Setup

Embedded Provisioner project can be found in STM32CubeWB MCU Package[5] at the following emplacement.

Embedded provisioner project directory
Connectivity 1-Embedded-prov-proj.png

To build and flash Embedded Provisioner project, process on the same way as for ST BLE-Mesh Proxy-Relay-Friend example.

Before building the project, choose between the 2 available configurations by modifying mesh_cfg_usr.h code as described below.

3.1. Embedded Provisioner Feature

With this setup, the provisioner node configure and initialize itself without action required from the user.

#define ENABLE_RELAY_FEATURE
#define ENABLE_PROXY_FEATURE
#define ENABLE_FRIEND_FEATURE
#define ENABLE_PROVISIONER_FEATURE
//#define DYNAMIC_PROVISIONER
[]
#define ENABLE_SERIAL_PRVN                                                     1


3.2. Dynamic Provisioner Feature

With this setup, the provisioner node need to be configured and initialized by user. The configuration setup is described in the below chapters.

#define ENABLE_RELAY_FEATURE
#define ENABLE_PROXY_FEATURE
#define ENABLE_FRIEND_FEATURE
//#define ENABLE_PROVISIONER_FEATURE
#define DYNAMIC_PROVISIONER
[]
#define ENABLE_SERIAL_PRVN



For both setup, ensure the serial commands are enabled, in order to pilot the provisioner from Terminal window.

/* Enables the serial interface using Uart */
#define ENABLE_SERIAL_INTERFACE                                                1
#define ENABLE_SIG_MODELS_AT_COMMANDS                                          1
#define ENABLE_VENDOR_MODELS_AT_COMMANDS                                       0
#define ENABLE_UT                                                              1


4. Getting Started

Before following the steps described below, ensure your project is setup to support the desired feature (embedded or Dynamic provisioner) and flashed into the STM32WB platform.

Open a terminal to communicate with the platform. Terminal setup and utilization is described in ST Bluetooth® LE-Mesh Proxy-Relay-Friend example page.

If you build the provisioner application using ENABLE_PROVISIONER_FEATURE, you can skip the Step 1, as the board is automatically setup and initialized.

4.1. Step 1: Starting provisioner node

In the case of DYNAMIC_PROVISIONER feature, logs on terminal should display:

Unprovisioned device
NEXT NVM ADDRESS []
BLE-Mesh Lighting Demo v1.[]
BLE-Mesh Library v01.[]
BD_MACAddress = []
UUID Address = []



Write below command on Serial terminal to make one node ROOT node for network creation:
ATEP ROOT (Case insensitive)
This command configures the provisioner and bind all the embedded models:

Terminal logs: ATEP ROOT
Connectivity 2-atep-root.png

4.2. Step 2: Scan unprovisioned devices

Write below command on Serial terminal to scan unprovisioned devices in range:
ATEP SCAN (Case insensitive)

Log on terminal indicates unprovisioned devices with their corresponding UUIDs:

Terminal logs: ATEP SCAN
Connectivity 3-atep-scan.png

In the example, two devices (device-0 and device-1) are not provisioned to the network.

4.3. Step 3: Provision and configure devices

Write below command to start provisioning of device-0:
ATEP PRVN-0 (Here 0 indicate the device–0)

Below Log will appear on terminal indicating the device-0 has been provisioned by the provisioner by making the PB-Adv connection link:

Test command executed successfully
PB-ADV Link opened successfully
Device Key: []
App Key: []
Device is provisioned by provisioner


Log on provisioned Node terminal will indicates that the node is provisioned by the provisioner. Finally, the PB-Adv connection link is closed and device-0 will be configured, and models bind.

Terminal logs: Node provisioned
Connectivity 3-atep-prvn.png

4.4. Step 4: Provision other devices

To provision and configure new nodes, reproduce Step 2 and Step 3.

5. References