1.. zephyr:code-sample:: ble_mesh 2 :name: Mesh 3 :relevant-api: bt_mesh bluetooth 4 5 Use basic Bluetooth LE Mesh functionality. 6 7Overview 8******** 9 10This sample demonstrates Bluetooth Mesh functionality. It has several 11standard mesh models, and supports provisioning over both the 12Advertising and the GATT Provisioning Bearers (i.e. PB-ADV and PB-GATT). 13The application also needs a functioning serial console, since that's 14used for the Out-of-Band provisioning procedure. 15 16On boards with LEDs, a Generic OnOff Server model exposes functionality for 17controlling the first LED on the board over the mesh. 18 19On boards with buttons, a Generic OnOff Client model will send Onoff messages 20to all nodes in the network when the button is pressed. 21 22Requirements 23************ 24 25* A board with Bluetooth LE support, or 26* QEMU with BlueZ running on the host 27 28Building and Running 29******************** 30 31This sample can be found under :zephyr_file:`samples/bluetooth/mesh` in the 32Zephyr tree. 33 34See :zephyr:code-sample-category:`bluetooth` samples for details on how 35to run the sample inside QEMU. 36 37For other boards, build and flash the application as follows: 38 39.. zephyr-app-commands:: 40 :zephyr-app: samples/bluetooth/mesh 41 :board: <board> 42 :goals: flash 43 :compact: 44 45Refer to your :ref:`board's documentation <boards>` for alternative 46flash instructions if your board doesn't support the ``flash`` target. 47 48To run the application on an :ref:`nrf5340dk_nrf5340`, a Bluetooth controller application 49must also run on the network core. The :zephyr:code-sample:`bluetooth_hci_ipc` sample 50application may be used. Build this sample with configuration 51:zephyr_file:`samples/bluetooth/hci_ipc/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf` 52to enable mesh support. 53 54Interacting with the sample 55*************************** 56 57The sample can either be provisioned into an existing mesh network with an 58external provisioner device, or self-provision through a button press. 59 60When provisioning with a provisioner device, the provisioner must give the 61device an Application key and bind it to both Generic OnOff models. 62 63When self-provisioning, the device will take a random unicast address and 64bind a dummy Application key to these models. 65 66Once provisioned, messages to the Generic OnOff Server will be used to turn 67the LED on or off, and button presses will be used to broadcast OnOff 68messages to all nodes in the same network. 69