STM32WB Bluetooth® LE Mesh Embedded Provisioning Application

Revision as of 11:53, 21 December 2021 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. Setup

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

Embedded provisioner project directory

To build and flash Embedded Provisioner project, process on the same way as for Basic PRF project.

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

2.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


2.2. DynamicProvisioner 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


3. 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.

3.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

3.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

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

3.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

3.4. Step 4: Provision other devices

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

4. References