nRF5 SDK for Mesh v5.0.0
Serial example
You can test this example on the following devices: nRF52840, nRF52833, and nRF52832.
This example is not compatible with the nRF52810, nRF52820, and nRF52840 dongle devices.

This example implements the serial interface for the Bluetooth mesh stack. It can be used unaltered as connectivity firmware for Bluetooth mesh devices. You can also modify the example to provide additional functionality.

Table of contents

Serial interface initialization

The example shows how to initialize and use the serial interface. To initialize the serial interface, only two API calls are required:

The nrf_mesh_serial_init() API initializes the serial bearer interface, and the nrf_mesh_serial_enable() API sends the SERIAL_OPCODE_EVT_DEVICE_STARTED event over the serial interface to notify the external host that the device is ready to accept serial commands.

Offloading feature

This example demonstrates how to offload certain Bluetooth-mesh-related tasks to the external host using a serial interface, which improves the performance of the Bluetooth mesh stack. The ECDH operations used in the provisioning process are a suitable candidate for such offloading.

The ECDH offloading allows the device to take advantage of the more powerful processor of the host to perform ECDH operations during provisioning.

The offloading is enabled by calling mesh_opt_prov_ecdh_offloading_set with enabled=true.

When this offloading is enabled, the serial interface sends the SERIAL_OPCODE_EVT_PROV_ECDH_REQUEST event to the host processor with the public and private keys. The host processor then performs the ECDH shared secret calculation and sends the calculated value back using the SERIAL_OPCODE_CMD_PROV_ECDH_SECRET serial command.

Hardware requirements

You need one of the compatible development kits for this example. See Compatibility for more information.


You can find the source code of the serial example in the following folder: <InstallFolder>/examples/serial

Testing the example

To test the serial example:

  1. Build the example by following the instructions in Building the Bluetooth mesh stack.
  2. Program the board by following the instructions in Running examples.
  3. When the the serial example is running, start testing it using the Interactive PyACI. Refer to the Interactive PyACI documentation for details.

Documentation feedback | Developer Zone | Subscribe | Updated