README.rst
1.. zephyr:code-sample:: ble_mesh_provisioner
2 :name: Mesh Provisioner
3 :relevant-api: bt_mesh bluetooth
4
5 Provision a node and configure it using the Bluetooth Mesh APIs.
6
7Overview
8********
9
10This sample demonstrates how to use the Bluetooth Mesh APIs related to
11provisioning and using the Configuration Database (CDB). It is intended
12to be tested together with a device capable of being provisioned. For
13example, one could use the sample in
14:zephyr_file:`samples/bluetooth/mesh`
15or :zephyr_file:`tests/bluetooth/mesh_shell`.
16
17The application provisions itself and loads the CDB with an application
18key, then waits to receive an Unprovisioned Beacon from a device. If the
19board has a push button connected via GPIO and configured using the
20``sw0`` :ref:`devicetree <dt-guide>` alias, the application then waits
21for the user to press the button, which will trigger provisioning using
22PB-ADV. If the board doesn't have the push button, the sample will
23provision detected devices automatically. Once provisioning is done, the
24node will be present in the CDB but not yet marked as configured. The
25application will notice the unconfigured node and start configuring it.
26If no errors are encountered, the node is marked as configured.
27
28The configuration of a node involves adding an application key, getting
29the composition data, and binding all its models to the application key.
30
31Requirements
32************
33
34* A board with Bluetooth LE support, or
35* QEMU with BlueZ running on the host
36
37Building and Running
38********************
39
40This sample can be found under
41:zephyr_file:`samples/bluetooth/mesh_provisioner` in the Zephyr tree.
42
43See :zephyr:code-sample-category:`bluetooth` samples for details on
44how to run the sample inside QEMU.
45
46For other boards, build and flash the application as follows:
47
48.. zephyr-app-commands::
49 :zephyr-app: samples/bluetooth/mesh_provisioner
50 :board: <board>
51 :goals: flash
52 :compact:
53
54Refer to your :ref:`board's documentation <boards>` for alternative
55flash instructions if your board doesn't support the ``flash`` target.
56
57To run the application on an :ref:`nrf5340dk_nrf5340`, a Bluetooth controller application
58must also run on the network core. The :zephyr:code-sample:`bluetooth_hci_ipc` sample
59application may be used. Build this sample with configuration
60:zephyr_file:`samples/bluetooth/hci_ipc/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf`
61to enable mesh support.
62