• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

boards/29-Dec-2025-6348

src/29-Dec-2025-706483

CMakeLists.txtD29-Dec-2025492 2216

README.rstD29-Dec-20252.3 KiB6647

microbit_gatt.confD29-Dec-20251.4 KiB6235

prj.confD29-Dec-2025798 3832

sample.yamlD29-Dec-2025272 1413

README.rst

1.. zephyr:code-sample:: ble_mesh
2   :name: Mesh
3   :relevant-api: bt_mesh bluetooth
4
5   Use basic Bluetooth 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
31See :zephyr:code-sample-category:`bluetooth` samples for details on how
32to run the sample inside QEMU.
33
34For other boards, build and flash the application as follows:
35
36.. zephyr-app-commands::
37   :zephyr-app: samples/bluetooth/mesh
38   :board: <board>
39   :goals: flash
40   :compact:
41
42Refer to your :ref:`board's documentation <boards>` for alternative
43flash instructions if your board doesn't support the ``flash`` target.
44
45To run the application on an :zephyr:board:`nrf5340dk`, a Bluetooth controller application
46must also run on the network core. The :zephyr:code-sample:`bluetooth_hci_ipc` sample
47application may be used. Build this sample with configuration
48:zephyr_file:`samples/bluetooth/hci_ipc/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf`
49to enable mesh support.
50
51Interacting with the sample
52***************************
53
54The sample can either be provisioned into an existing mesh network with an
55external provisioner device, or self-provision through a button press.
56
57When provisioning with a provisioner device, the provisioner must give the
58device an Application key and bind it to both Generic OnOff models.
59
60When self-provisioning, the device will take a random unicast address and
61bind a dummy Application key to these models.
62
63Once provisioned, messages to the Generic OnOff Server will be used to turn
64the LED on or off, and button presses will be used to broadcast OnOff
65messages to all nodes in the same network.
66