nRF5 SDK for Mesh v4.1.0
Provisioner example

The provisoner example is the default Mesh network configurator. It works in a fixed, predefined way and can be used as the static provisioner with the following examples:

Table of contents

Because of the asynchronous nature of the provisioning and configuration process, the provisioner is implemented as a multi-layered state machine. The application provisions and configures devices when it receives unprovisioned beacons from them.

Every supported example has a unique Uniform Resource Identifier (URI) included in the beacons. The provisioner example uses URI hash to understand the type of example being provisioned and select the suitable configuration to be applied to the node after provisioning. For this reason, this provisioner can provision devices only with the known URI. The list of URIs is predefined.

The static provisioner has its own limitations and is provided as a tool to evaluate SDK examples without the need to use a mobile application provisioner. If you are using a mobile application for provisioning, you can see the models present on the device and configure the nodes accordingly. Moreover, you can also use more sophisticated automated provisioners that can use the UUID, URI, and the device composition data to understand which devices are being provisioned and configure them automatically.

The device being provisioned is configured depending on whether it has the client or the server part of the models:

The following diagram shows how the provisioner configures Mesh examples.

provisioning_cfg.svg
Typical configuration of Mesh examples by the provisioner

The following diagram shows the typical state transitions of the provisioner while provisioning and configuring a light switch client.

light_switch_client_state_diagram.svg
Light switch client state diagram

For more information on how a provisioning process works, see the provisioning guide.


Usage of Mesh APIs

The provisioner uses the following set of APIs:

The provisioner role is much more complex than the provisionee role, both in terms of resource requirements and application complexity. For these reasons, there is no simple API for the provisioning and configuration process.

However, for a specific use case, the API usage can be reduced into a set of simple steps, as implemented in the provisioner example:

  1. Initialize:
    1. Core mesh stack.
    2. Device state manager.
    3. Access layer.
    4. Load provisioner persistent data.
  2. Listen for unprovisioned beacons.
  3. Provision the device.
  4. Configure the device.
  5. If more devices should join the network, go back to step 2.

In the example code, this behavior is split between the following modules:

The following figure shows the details of how provisioning and configuration are implemented with the provided APIs. Note that the figure may simplify some API calls to provide a clearer picture. See the relevant source files for details.

provisioner_interface.svg
Provisioning and configuring devices

Hardware requirements

You need one of the supported boards for the provisioner, in addition to the boards required by the example you are using the provisioner with.

See Compatibility for the supported boards.


Setup

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

LED and button assignments

The buttons (1 to 4) are used to initiate certain actions, and the LEDs (1 to 4) are used to reflect the status of actions as follows:


Testing the example

There is no standalone testing procedure for the provisioner example. You need to use this example together with one of the examples that use the static provisioner example.

After building the example by following the instructions in Building the mesh stack, see the following sections, depending on the example you are using:


Documentation feedback | Developer Zone | Subscribe | Updated