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

This example demonstrates how you can use the Scene model to store and recall states of other models.

The example is composed of the Scene client minor example. It does not provide a standalone Scene server example, but instead uses one of the compatible server examples listed in Server example (model) and Client example (model).

For provisioning purposes, the example requires either the provisioner example that is provided in the Provisioner example or the nRF Mesh mobile app.

The Scene client example has a provisionee role in the network. It supports provisioning over Advertising bearer (PB-ADV) and GATT bearer (PB-GATT) and also support Bluetooth mesh Proxy Service (Server). Read more about the Proxy feature in GATT provisioning and Proxy.

Table of contents


Scene client example

The Scene client example has a provisionee role in the network. It implements two instances of the Scene Client model. These instances are used to store and recall the server states in a scene, and to delete the stored scenes.


Server example (model)

There is no standalone Scene server example. Instead, other example applications showcase the Scene Server models and implement the Scene Server and Scene Setup Server models:

This is because the Scene Server models refer to the scene register table that gathers scenes (with the associated state values) from a number of elements within a node.


Client example (model)

If you plan to evaluate using static provisioner, you need one of the following client examples that can control the state on the server example:

Note
There is no client example for Light LC Client model, therefore scene storage for Light LC Server model cannot be evaluated using static provisioner.

If you plan to evaluate using nRF Mesh mobile app, you do not need the client example, as the mobile application allows you to control server states directly from the application.

Note
As of the nRF SDK for Mesh v5.0.0, the mobile app has a limited built-in client support. Therefore, not all states of all server models can be controlled through this app. The built-in client support is limited to Generic OnOff server and Generic Level servers.

Scene Client and Server model

The Scene Client model is used for manipulating the scene state in the Scene Server model. For more information about the Scene models, see the Scene model documentation, Scene Server behavior documentation, and Bluetooth SIG's Bluetooth mesh model overview.


Hardware requirements

You need at least two compatible development kits for this example:

Additionally, you need one of the following for provisioning:

See Compatibility for information about the compatible development kits.


Software requirements

Depending on the provisioning method:


Setup

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

See the Setup section in the documentation of the server example you want to use for the source code of the server example.

LED and button assignments


Testing the example

To test the example, build both the Scene client example and the server example you want to use by following the instructions in Building the Bluetooth mesh stack.

After building is complete, use one of the following methods, depending on the preferred provisioning approach:

Evaluating using the static provisioner

See provisioner example testing section for detailed steps required to provision and configure the boards using the static provisioner.

Evaluating using the nRF Mesh mobile app

See Evaluating examples using the nRF Mesh mobile application for detailed steps required to provision and configure the boards using the nRF Mesh mobile app.

The following naming convention is used in the app:

The following model instances must be configured in the app for this example:

Note
To change the states on the server example you decide to use, you can also add and configure a client example associated with the corresponding server example.

Once the provisioning is complete, you can start interacting with the boards.

Note
You can also configure the publish address of the second Scene client model instance. To do this, repeat step 3 from binding nodes and all steps from setting publication.

Interacting with the boards

Once the provisioning and the configuration of the client node and of at least one of the server nodes are complete, you can press buttons on the client or send command numbers using the RTT Viewer to create and recall scenes and observe how the server states change.

The following set of message types is available for this demonstration:

See LED and button assignments section for the full list of available commands.

If any of the devices is powered off and then back on, it will remember its flash configuration and rejoin the network. It will also restore values of the Scene states. For more information about the flash manager, see Flash manager.

Storing scenes

Before storing each scene change the server examples states using client example (see corresponding client example documentation here) or nrf-mesh-mobile-app. Changing server states will allow you to visually distinguish various scenes during evaluation.

To store the states of the servers in a scene, perform the following steps:

  1. Set the states of each server to a desired value by following the Interacting with the boards section in the documentation of the server example you are using. To know which states are stored and recalled, see the Scene model section in the server example documentation.
  2. Use RTT input 1 or Button 1 on the client node to store these states as a scene with scene number 1.
  3. Alter the states on the server nodes.
  4. Use RTT input 6 on the client node to change to scene number 2.
  5. Use RTT input 1 or Button 1 on the client node to store these states as scene number 2.

Recalling scenes

To recall any of the scenes stored in the previous step, use RTT input on the client node:

  1. Use RTT input 5 and 6 to select the scene number to recall.
  2. Use RTT input 2 or press Button 2 to recall the scene.
  3. Observe the change in the states on the server nodes. To know which states are stored and recalled, see the Scene model section in the documentation of the server example you are using.

Getting the current scene and register

To get the currently active scene on the servers, use RTT input 7 on the Scene client. Observe the RTT output to see the Scene status messages.

If you use RTT input 8 on the client node, a Scene Register get message will be sent to the servers. The RTT output will list the scene register content of each server.

Deleting scenes

To delete the stored scene, use RTT input 5 and 6 to select a scene number, and then use RTT input 3 or Button 3 to delete the selected scene. Observe that the deleted scenes can no longer be recalled. They also do not show up in the scene register when you use RTT input 8.


Documentation feedback | Developer Zone | Subscribe | Updated