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.
To see the demonstration, this example has to be used with a Provisioner and one or more Servers from the light_switch examples folder.
See Compatibility for information about the supported boards.
SERVER_NODE_COUNT
(in light_switch_example_common.h
) to the number of boards available and rebuild the provisioner example.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.
To complete 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.
To provision using the mobile app, both on iOS and Android:
nRF5x Mesh Enocean Translator
, the server board is nRF5x Mesh Light
.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:
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.
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.
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.
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.