STM32WB Bluetooth® LE Mesh Low Power and Friendship Nodes

1. Low power node and friendship process

A low power node must establish a friendship relationship with another node supporting the friend feature to reduce its receiver duty cycles and save energy. The friend node scans, and caches messages targeted to its associated low power node. The procedure involved is called friend establishment.

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

Programmer:

  • STM32CubeProgrammer[2]: 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[3].

Hardware requirements
P-NUCLEO-WB55[4] is necessary to set up the demonstration.

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

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

1.2. Friend node setup

The friend feature is supported by the PRF node example, described in the ST Bluetooth® LE-Mesh Proxy-Relay-Friend example page.

However, some complementary information about the friend node configurations is available below:

* # of Low Power Nodes that can be associated with a friend node is defined by FN_NO_OF_LPNS, in mesh_cfg_usr.h:
/* 
*  Number of Low power nodes that can be associated with friend node
*  varies from 1 to 10
*/
#define FN_NO_OF_LPNS                                                         6U
  • Number of LPN / Friend node associations is limited:
    • 1KB SRAM
    • Radio time
  • Fixed friend node parameters:
    • Friend receive window size: 255 ms
    • Friend subscription list size: 4
    • Friend maximum number of messages: 16

1.3. Low power node setup

Warning white.png Warning
A low power node should not support any other feature (proxy, friend, relay).


Low power node project can be found in the STM32CubeWB MCU Package[6] at the following location.

Low power project directory
Connectivity 2 Low power project.png

Low power nodes don’t support debugger and debug traces, see in app_conf.h:

/******************************************************************************
 * Low Power
 ******************************************************************************/
/**
 *  When set to 1, the low power mode is enable
 *  When set to 0, the device stays in RUN mode
 */
#define CFG_LPM_SUPPORTED                                                     1

[]

/**
 * keep debugger enabled while in any low power mode when set to 1
 * should be set to 0 in production
 */
#define CFG_DEBUGGER_SUPPORTED    0

/**
 * When set to 1, the traces are enabled in the Bluetooth<sup>®</sup> LE services
 */
#define CFG_DEBUG_BLE_TRACE     0

/**
 * Enable or Disable traces in application
 */
#define CFG_DEBUG_APP_TRACE     0

To build and flash LPN project, process in the same way as for friend project (see ST BLE-Mesh Proxy-Relay-Friend example page). Note that the terminal logs are not available for LPN as mentioned previously. You can add several LPNs to the mesh network, one friend node can manage up to 6 LPN.

1.4. Functioning

All the mesh network nodes must subscribe and publish to the default group.

When pressing SW1 button on the friend node, it publishes LED ON command to the default group. The Friend blue LED immediately turns on, as the friend node subscribed to the default group. When the friend receives poll from a LPN, it forward the LED ON message to the respective LPN.

Friendship functioning description
Connectivity 3-Friendship-description.png

Similarly, when pressing SW1 button of one of the LPN (for example LPN1), LPN1 publishes LED ON command to the default group. The LPN1 and the friend node blue LEDs turns on immediately. When the friend receives poll from LPN2, it forward the LED ON message to it.

Friendship functioning description 2
Connectivity 4-Friendship-description.png

2. Energy consumption profiles

  • Friend request sent -- No LPN response
Power consumption: friend request sent -- No LPN response
Connectivity Energy 1.png
  • Friend request followed by friend establishment
Power consumption: friend request followed by friend establishment
Connectivity Energy 2.png
  • Friend establishment sequence
Power consumption: friend establishment sequence
Connectivity Energy 3.png
  • Friend establishment followed by friend poll
Power consumption: friend establishment followed by friend poll
Connectivity Energy 4.png
  • Friend poll retries
Power consumption: friend poll retries
Connectivity Energy 5.png
  • Friend Poll retries and termination
Power consumption: friend poll retries and termination
Connectivity Energy 6.png

3. References