Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

How to create a Bluetooth Mesh Low Power Node (LPN) - KBA231327

lock attach
Attachments are accessible only for community members.

How to create a Bluetooth Mesh Low Power Node (LPN) - KBA231327

ChaitanyaV_61
Employee
Employee
50 questions asked 25 likes received 25 sign-ins

Version: **

Translation - Japanese: Bluetoothメッシュ低電力ノード(LPN)の作成方法 - KBA231327 - Community Translated (JA)

This article explains how to enable Bluetooth Mesh Low Power Feature in the mesh vendor model app (Vendor_specific_app).

The Bluetooth Mesh specification (SIG spec) defines the Low Power feature which can be implemented on the following two Mesh nodes to optimize the power consumption for power-constrained devices:

  • Low Power Node (LPN):  A power-constrained Mesh node. It supports the Mesh Low Power feature.
  • Friend Node: A Power-rich device. It supports the Mesh Friend feature.

When a Low Power node (LPN) is added to a Mesh network, it broadcasts a request (Friend Request) for a Friend. Each friend in the range that can handle a new LPN replies (Friend Offer); the LPN selects the best Friend based on how many messages the Friend can store, the RSSI, and the timing accuracy. Once the relationship is established, the LPN can go to sleep and periodically wake up to poll the Friend node to get the cached messages. In this way, the LPN does not need to listen continuously for Mesh packets. See AN227069 - Getting Started with Bluetooth Mesh for details of the Low Power feature.

Creating an LPN node

The Mesh Low Power feature is implemented in Mesh Core libraries. The application developer/user can create an LPN node with minimal settings as follows. Because the messages related to Friend/LPN (e.g., friend poll, friend update, friend request, friend offer, etc.) are Mesh “control messages”, the user application does not need to be concerned about these.

Note: Control messages are internally generated by the stack and are sent between upper transport layers on different nodes.

           Access messages are "normal" Mesh messages that devices send and receive to convey information.

Do the following to enable the Low Power feature in vendor_specific_app (Mesh vendor model implementation).

1. Enable Low Power feature

Set LOW_POWER_NODE ?= 1 in the application Makefile to enable the Low Power feature.

Its value can be normal node (0), or LPN (1).

2. Configure the Mesh device

Specify the supported features of the node in the device configuration structure (wiced_bt_mesh_core_config_t) as shown below. If the node is an LPN (or a Friend node), the related parameters also must be configured in this structure. 

WICED_BT_MESH_CORE_FEATURE_BIT_LOW_POWER indicates that the node supports the Low Power feature.

Because it is an LPN application, its parameters such as .poll_timerout, .receive_delay, and .rssi_factor must be configured.

pastedImage_12.png

3. Register the LPN Sleep callback

The application should define a sleep callback function in wiced_bt_mesh_app_func_table_t structure (i.e., for  wiced_bt_mesh_app_lpn_sleep_t). The stack calls this function when it is safe to enter a low-power mode, and provides the amount of time (in milliseconds) that the Mesh core does not require processing. Based on it, the application can implement a decision logic to select the sleep mode.

The callback function will be called when the stack generates the WICED_BT_MESH_CORE_STATE_LPN_SLEEP event. The implementation is done in mesh_application.c inside the mesh_state_changed_cb () callback function.

The prototype for this function is:

typedef void (*wiced_bt_mesh_app_lpn_sleep_t)(uint32_t duration);

pastedImage_22.png

4. Configure and initialize Device Sleep

The application should configure wiced_sleep_config_t and call wiced_sleep_configure() to enable low-power operation on the device. See the respective datasheets for supported power modes of each chip. See AN225270 - CYW208xx BLE Low-Power Guidelines for details of low-power parameters and configuration.

A sleep permission callback function (sleep_permit_handler) must be provided in the wiced_sleep_config_t structure to poll for sleep permission, and a post-sleep callback function (post_sleep_cback_handler) can be defined to perform post-sleep actions/configurations (e.g., re-initialize the configured peripherals).

pastedImage_30.png

Note:

  • The LPN app should include wiced_sleep.h to get the WICED Sleep Framework definitions.
  • The Friend offer delay is calculated as follows:
    Friend offer delay = (receive_window_factor * receive_window) – (rssi_factor * RSSI).

See the attached vendor-specific LPN app based on the CYW920819EVB-02 platform.

You can use the default vendor_specific_app or any node enabled with the Friend feature as a Friend node for testing.

Note: This modified Mesh app has not been tested with the standard validation process of ModusToolbox® BTSDK applications.

Attachments
0 Likes
1516 Views
Contributors