nRF5 SDK for Mesh v5.0.0
Integrating Low Power node feature

The nRF5 SDK for Mesh provides the Low Power node feature that you can use in your application.

To support the LPN feature, your application must handle the friendship establishment procedure using the available Mesh Low Power node (LPN) API. Once the friendship is established, the communication between the LPN and the Friend is based on a set of timing parameters exchanged during the friendship establishment procedure.

Table of contents

For an example of the Low Power node feature, see Low Power node example.


Handling friendship establishment procedure

Make sure you implement the following points in your code:

Timing parameter Short description Chosen by Timing value Reference
ReceiveDelay Delay interval from the moment the Friend node received a suitable request message. LPN node 10-255 ms, steps of 1 ms MESH_LPN_RECEIVE_DELAY_MIN_MS, MESH_LPN_RECEIVE_DELAY_MAX_MS
ReceiveWindow Interval within which the Friend node must send a response. Friend node 1-255 ms, steps of 1 ms MESH_LPN_FRIEND_REQUEST_RETRY_COUNT, MESH_LPN_POLL_RETRY_COUNT
PollTimeout Interval within which the LPN node must send a request message. LPN node max. 95.9 hours MESH_LPN_POLL_TIMEOUT_MIN_MS, MESH_LPN_POLL_TIMEOUT_MAX_MS
msc_inline_mscgraph_1

Once the friendship is established, the communication between the LPN and the Friend node happens through a request-response mechanism.

If the Bluetooth mesh stack is unable to receive a response to the previously sent request, it will resend the previous request. If there is no response after multiple attempts (MESH_LPN_POLL_RETRY_COUNT), the stack will terminate friendship and generate a termination event (NRF_MESH_EVT_FRIENDSHIP_TERMINATED). The application can start the friendship establishment procedure to re-establish friendship. If required, the application can also terminate the friendship by calling mesh_lpn_friendship_terminate().


Friendship timing parameters and request-response mechanism

There are three important timing parameters that govern the friendship functionality:

The nRF5 SDK for Mesh also provides an additional timing control.

ReceiveDelay and ReceiveWindow

polling_timings_params_v2.svg
Friendship timings: ReceiveDelay and ReceiveWindow

When the Friend node receives any suitable request message from the LPN (Friend Poll or Friend Subscription List Add/Remove), it waits for the ReceiveDelay interval to send the response. From the end of ReceiveDelay interval, the Friend must send a response within an interval called ReceiveWindow. The LPN keeps its scanner turned off until the start of the ReceiveWindow, then it turns the scanner on, and switches it off again as soon as a response is received from the Friend node or when the ReceiveWindow ends.

If the Friend node fails to send a response within ReceiveWindow or the LPN does not receive a response due to RF interference, the LPN will attempt to resend the previous request multiple times (MESH_LPN_FRIEND_REQUEST_RETRY_COUNT, MESH_LPN_POLL_RETRY_COUNT) before terminating the friendship.

PollTimeout

Once the friendship is established, the LPN must send at least one request message within an interval called PollTimeout. The Friend node counts the PollTimeout interval from the last received request message from the LPN. If the LPN does not send a new request within the PollTimeout, the Friend node considers the friendship terminated and it clears the Friend Queue. If this happens, the LPN has to re-establish the friendship.

polling_timings_params_poll_timeout.svg
Friendship timings: PollTimeout

When the LPN determines that it is time to fetch the messages from the Friend node, it starts sending consecutive request messages until the Friend Queue is empty. We call this sequence a poll cycle (see the following image).

Additional timing control

The nRF5 SDK for Mesh provides additional flexibility to the applications by enabling them to control bursts of poll cycles within the long PollTimeout interval. This is done with the optional PollInterval parameter.

polling_timings_poll_interval.svg
Poll cycles and PollInterval

The PollInterval parameter controls the interval between two successive poll cycles within the PollTimeout interval. It affects the responsiveness of the LPN in relation to the rest of the network. The application can change this parameter at runtime by calling mesh_lpn_poll_interval_set().


Practical recommendations for low power applications

When using the LPN feature and developing end applications around this feature, consider the following recommendations:


Documentation feedback | Developer Zone | Subscribe | Updated