nRF5 SDK for Mesh v3.0.0
EnOcean switch translator client demo
Note
This example is not supported by the nRF52810 Series.

Purpose

This demo project shows how a PTM215B EnOcean switch can be integrated in the mesh eco system.

It demonstrates how to capture the commissioning data of the EnOcean switch and how to translate the EnOcean switch messages into equivalent mesh messages. It uses two instances of the Generic OnOff client model. These On/Off clients can be configured to control desired servers by the provisioner. Following diagram shows the illustration of such hybrid network containing non-Bluetooth Mesh device, translator client, and servers. All servers have relay functionality enabled thereby allowing EnOcean switch to control state of any of the servers in the network.

example_nw_config.png
Integrating EnOcean switches in the Mesh Network

To see the demonstration, this example has to be used with a Provisioner and one or more Servers from the light_switch examples folder.

Getting started

Hardware requirements

See Compatibility for information about the supported boards.

Running the demo

To build the example, follow the instructions in Building the Mesh Stack. For commands required to program a device using nrfjprog, see the Running examples using nrfjprog section on the Running examples page.

To run the examples, the boards must be provisioned first. It can be done using either the development board or nRF Mesh mobile app.

Provisioning using the development board

To complete the provisioning process:

  1. Erase the device flash of your development boards and program the SoftDevice on each board.
  2. Flash the provisioner firmware on one board, this example on another board, and the server firmware on other board or boards.
  3. Connect RTT viewer to view the RTT output generated by the translator client and the provisioner.
  4. Press Button 1 on the provisioner to start the provisioning process.

The provisioner prints details about the provisioning and the configuration process in the RTT log. When provisioner is scanning and provisioning a device, LED 1 on the Provisioner board is turned ON. When configuration procedure is underway, LED 2 on the provisioner board is turned ON.

The provisioner configures the On/Off client model instances on the client board to control various servers as follows:

If provisioner encounters an error during the provisioning or configuration process for a certain node, you can reset the provisioner to restart this process for that node.

Any unhandled error is indicated by turning on all the LEDs on the board in steady state. You will need to reset the board to restart the application.

Provisioning with nRF Mesh app

To provision using the mobile app, both on iOS and Android:

  1. Erase the device flash of your development boards and program the SoftDevice.
  2. Flash this example on one board and the server firmware on other boards.
  3. Download nRF Mesh mobile app (iOS or Android).
  4. Provision the nodes. The client board is nRF5x Mesh Enocean Translator, the server board is nRF5x Mesh Light.
  5. Bind the Generic Level client and server model instances on the nodes with the same app key.
  6. Set the publish address of the first Generic Level client model instance on the client example to the unicast address of any server node.
  7. Use buttons on the Enocean Switch to toggle the LED state on the associated server.

Capturing the commissioning data of the EnOcean switch

Note
These steps can be done either before or after the translator client has been provisioned.

To capture the commissioning data of the EnOcean switch, put the EnOcean switch in the radio-based commissioning mode by pressing the special button sequence:

To enter commissioning mode:

  1. Make sure that the Disable Radio Commissioning flag in the Configuration register of the NFC interface is set to 0b0 (default state).
  2. Start by selecting one button contact of PTM 215B. Any button of PTM 215B (A0, A1, B0, B1) can be used. This button is referred to as Button_X in Figure 20 above.
  3. Execute the following sequence:
    1. Press and hold the selected button for more than 7 seconds before releasing it.
    2. Press the selected button quickly (hold for less than 2 seconds).
    3. Press and hold the selected button again for more than 7 seconds before releasing it.

Upon detection of this sequence, PTM 215B enters the commissioning mode. See EnOcean PTM215B Datasheet for reference.

Once entered in the radio commissioning mode, PTM215B transmits the commissioning telegrams. These telegrams will be captured by the translator, and the security material contained within those telegrams will be stored in the flash.

Once one of the commissioning telegrams is captured by the translator, 4 LEDs will blink 4 times.

Note
The example supports two Enocean switches to be connected in parallel. You can repeat the above mentioned steps to commission the second switch.

Testing

Once the provisioning and the configuration of the EnOcean translator client node and at least one of the server nodes are completed and the commissioning data is captured, you can press buttons on the EnOcean switch to toggle the LED state on the associated servers.

If any of the devices is powered off and back on, it will remember its configuration in flash, and will rejoin the network. More information about the flash manager can be found in the flash manager documentation.

Details

For details about the provisioning and configuration process, see the Exploring Mesh APIs guide. See Light switch demo README to get more information about the provisioner and server examples.

EnOcean switch translator client

The EnOcean switch translator client has a provisionee role in the network. The client receives messages from the PTM215B switch and converts them to equivalent On/Off client messages to control the state of LED 1 on servers. It instantiates two instances of the Generic OnOff Client model and can either be provisioned and configured by the provisioner device or by a GATT-based provisioner. The provisioner configures these client model instances to communicate with servers.

The example is configured to store security material for two EnOcean switch. If you want to reset the application data without re-flashing the firmware, press Button 4. LED 1 will blink twice to indicate that application specific data and mesh related data has been erased. Press Reset button to reset the board and start the application.

If you want this example to support more than two EnOcean switches in parallel, set the value of MAX_ENOCEAN_DEVICES_SUPPORTED to the desired number of switches.


Documentation feedback | Developer Zone | Subscribe | Updated