nRF5 SDK for Thread and Zigbee v4.1.0
Zigbee Multi Sensor Example

Table of Contents

This information applies to the following SoCs: nRF52833 and nRF52840.

The Zigbee Multi Sensor example demonstrates the Temperature and Pressure sensor built on top of the Zigbee stack.

The device operates on one endpoint, which incorporates among others the ZCL Temperature Measurement Cluster and ZCL Pressure Measurement Cluster. While the Temperature Measurement Cluster is built-in in the stack, the Pressure Measurement is implemented in the application and is available as a reference.


Setup

You can find the source code in the following folder: <InstallFolder>\examples\zigbee\experimental\multi_sensor

LED assignments

The example uses LED assignments as described in Thread BSP LED and button reference for the following LEDs:


Testing

Precondition
To test the example, prepare two nRF52 Development Kits.
  1. Compile and program the application.
  2. Prepare the Zigbee coordinator using the Zigbee CLI Agent example. Refer to Zigbee CLI Reference for complete reference of the Zigbee Command Line Interface.
  3. Run the state command to set the state of the CLI device in the Zigbee network and then start it:
    > bdb role zc
    Coordinator set
    Done
    > bdb start
    Started coordinator
    Done
  4. Check that the device with the the Basic and Identify Clusters is present in the network.
    > zdo match_desc 0xffff 0xffff 0x0104 2 0x0402 0x0403 0
    src_addr=05B9 ep=10
    Done
    Note
    The short address of the device returned by the Match Descriptor Request may differ in your case.
  5. Check the long address of the sensor.
    > zdo ieee_addr 0x05B9
    0b010e1585785ce7
    Done
    Note
    The long address of the device returned by the Extended Address Request may differ in your case.
  6. Check your own long address.
    > zdo eui64
    0b010ee031137990
    Done
    Note
    The long address of the device may differ in your case.
  7. Bind the remote endpoint to the CLI so that the Sensor shall be able to report to it. Bind both Temperature and Pressure Measurement clusters.
    > zdo bind on 0b010e1585785ce7 10 0b010ee031137990 64 0x0402 0x05b9
    Done
    > zdo bind on 0b010e1585785ce7 10 0b010ee031137990 64 0x0403 0x05b9
    Done
  8. Enable sending the reports on the sensor for both Temperature and Pressure Measurement clusters.
    > zcl subscribe on 0b010e1585785ce7 10 0x0402 0x0104 0 41
    Done
    > zcl subscribe on 0b010e1585785ce7 10 0x0403 0x0104 0 41
    Done
  9. Enable displaying of reports in the CLI.
    > log enable info zigbee.report
  10. Observe the incoming reports.
    <info> zigbee.report: Received value updates from the remote node 0x05B9
    <info> zigbee.report: Profile: 0x0104 Cluster: 0x0402 Attribute: 0x0000 Type: 41 Value: 3550
    <info> zigbee.report: Received value updates from the remote node 0x05B9
    <info> zigbee.report: Profile: 0x0104 Cluster: 0x0403 Attribute: 0x0000 Type: 41 Value: 1060

Documentation feedback | Developer Zone | Subscribe | Updated