This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Which SDK, examples need to download for the generic zigbee application for the 2 devices of nrf52840 dongle

Hi to all team,

I have two units of nrf52840 dongle with me.

I have to develop the generic application firmware where data send from one dongle(coordinator) is getting received by another dongle(Router/End Device) based on zigbee 802.15.4.

I have search the SDK from the nordic site but there i am getting confused because SDK i have found is for home automation based where coordinator is do commisioning.

So i have to need only SDK, examples which while programmed to nrf52840 dongle fulfills the concept of sending data from one dongle to other dongle based on zigbee.

So can anyone who has worked on this dongle, please let me know which soft-device, SDK and examples i have to download for these generic application from the nordic site.

Thanks & regards,

Ronak Jain  

Parents
  • Hi,

    The Zigbee examples in NCS (nRF Connect SDK) does not have support for the nRF52840 Dongle as of now, so it would be easiest to use the examples from nRF5 SDK for Thread and Zigbee. To download the SDK please go to nRF5 SDK for Thread and Zigbee download.

    You can see a list over the examples at the page Zigbee-only examples in our documentation. At the bottom of that page you will find a table showing which examples are supported on which devices, to see which examples you can use on your dongles.

    For your coordinator you should either use the Zigbee Light Coordinator from the light control example or the Zigbee CLI Agent example.The light coordinator is a very simple coordinator example which for now only has functionality for the network steering commissioning mechanism. The rest of the functionality you want your device to have, you will have to implement yourself. The CLI agent might be a better example to use. This example can be used as a coordinator or a router. If you want to use it as a coordinator, simply set the device role with "bdb role zc" before starting the network, as explained in the documentation of the example. With the CLI agent you can easily send messages to other devices using the CLI (command line interface) library. The list of supported CLI commands can be found in Zigbee CLI Reference.

    The examples you can use for your other device are the Zigbee Light Bulb example, the Zigbee Multi Sensor example, and the Zigbee CLI Agent example. The light bulb is a router, and acts as a light bulb. If you want to test out controlling the light bulb using the CLI agent (on the coordinator) you can read about how to do this in Using CLI to control lighting devices. The multi sensor example is programmed as an end device, and demonstrates how to use the the Temperature Measurement and Pressure Measurement clusters. The Zigbee CLI Agent example can, as I mentioned earlier, be used as both a coordinator and a router. So you can have this example on both devices, and set the device role as coordinator on one of them, while letting the other one be a router. You can then use CLI commands to send messages as explained above.

    Best regards,

    Marte

Reply
  • Hi,

    The Zigbee examples in NCS (nRF Connect SDK) does not have support for the nRF52840 Dongle as of now, so it would be easiest to use the examples from nRF5 SDK for Thread and Zigbee. To download the SDK please go to nRF5 SDK for Thread and Zigbee download.

    You can see a list over the examples at the page Zigbee-only examples in our documentation. At the bottom of that page you will find a table showing which examples are supported on which devices, to see which examples you can use on your dongles.

    For your coordinator you should either use the Zigbee Light Coordinator from the light control example or the Zigbee CLI Agent example.The light coordinator is a very simple coordinator example which for now only has functionality for the network steering commissioning mechanism. The rest of the functionality you want your device to have, you will have to implement yourself. The CLI agent might be a better example to use. This example can be used as a coordinator or a router. If you want to use it as a coordinator, simply set the device role with "bdb role zc" before starting the network, as explained in the documentation of the example. With the CLI agent you can easily send messages to other devices using the CLI (command line interface) library. The list of supported CLI commands can be found in Zigbee CLI Reference.

    The examples you can use for your other device are the Zigbee Light Bulb example, the Zigbee Multi Sensor example, and the Zigbee CLI Agent example. The light bulb is a router, and acts as a light bulb. If you want to test out controlling the light bulb using the CLI agent (on the coordinator) you can read about how to do this in Using CLI to control lighting devices. The multi sensor example is programmed as an end device, and demonstrates how to use the the Temperature Measurement and Pressure Measurement clusters. The Zigbee CLI Agent example can, as I mentioned earlier, be used as both a coordinator and a router. So you can have this example on both devices, and set the device role as coordinator on one of them, while letting the other one be a router. You can then use CLI commands to send messages as explained above.

    Best regards,

    Marte

Children
  • Hi,

    Thanks for the reply.

    Going through the reply, have following queries mentioned under the below cases.

    Case -1)  NRF52840 dongle have with me is PCA100059 board. 

    So if I  program the "nrf52840_xxaa_mbr_pca10059.hex" file of  Zigbee Light Coordinator from the light control example in my one NRF52840 dongle considering as a coordinator and load "nrf52840_xxaa_mbr_pca10059.hex" file from Zigbee light bulb example in another dongle considering as a router, than can you clear my below queries.

    A) can i able to see the data communication  between 2 dongle for data send receive? What kind of output i can able to see.

    B) If not than i can only able to see the network joining means that router device is joined with coordinator without any data send receive?

    C) To see the data send receive from coordinator(dongle 1) to router(dongle 2) or vice versa, i have to implement the logic right? If yes than what section i have to refer to use the api or function for zigbee data send receive.

    Case - 2) If I use Zigbee CLI agent example to download in nrf52840 dongle, than in that i have to configure all the board via uart utility right to configure it as a coordinator, start zigbee stack and other things.

    Thanks and regards,

    Ronak Jain

  • Hi,

    Case 1)

    The light coordinator only works as a coordinator, and commissions devices that want to join the network. So if you program the examples without making any changes to them, the only messages sent between the two devices will be the messages during joining, as well as Link Status messages periodically.

    If you want the coordinator to send other messages to the light bulb you will have to implement that yourself. If you just want to send a generic command you can use ZB_ZCL_SEND_COMMAND_SHORT. You will have to construct the packet and fill it with data, finish it, and then send it. You can take a look at the function generic_cmd_send in components/zigbee/cli/zigbee_cli_cmd_generic_cmd.c to see how this can be used. It would look something like this. You will have to set the different parameters to correspond with your message.

    zb_uint8_t* ptr = ZB_ZCL_START_PACKET_REQ(buffer)
    ZB_ZCL_CONSTRUCT_SPECIFIC_COMMAND_REQ_FRAME_CONTROL(ptr, def_resp)
    ZB_ZCL_CONSTRUCT_COMMAND_HEADER_REQ(ptr, ZB_ZCL_GET_SEQ_NUM(), command_id);
    
    // Fill the packet data using one or more of the following primitives:
    // ZB_ZCL_PACKET_PUT_DATA8
    // ZB_ZCL_PACKET_PUT_DATA16
    // ZB_ZCL_PACKET_PUT_DATA32
    // ZB_ZCL_PACKET_PUT_DATA_IEEE
    // ZB_ZCL_PACKET_PUT_DATA_N
    ZB_ZCL_PACKET_PUT_DATA8(ptr, (data));
    
    ZB_ZCL_FINISH_PACKET(buffer, ptr);
    ZB_ZCL_SEND_COMMAND_SHORT(buffer,
                              addr,
                              dst_addr_mode,
                              dst_ep,
                              ep,
                              prof_id,
                              CLUSTER_ID,
                              cb);

    You can also send cluster specific commands. If you for example want to turn the light bulb on or off, you can send a On/Off command from the coordinator. You will have to implement the On/Off cluster on the coordinator in that case.

    ZB_ZCL_ON_OFF_SEND_REQ(buffer,
                           addr,
                           dst_addr_mode,
                           dst_ep,
                           ep,
                           prof_id,
                           dis_default_resp,
                           cmd_id,
                           NULL);

    When the light bulb receives a ZCL command, it will enter the callback function zcl_device_cb(). If you want to do something when receiving a command, you can add that functionality there, for the specific command.

    Case 2)

    You should find the explanations regarding this in the CLI Agent example documentation. After programming the example to the devices, you can use a terminal emulator, such as PuTTY or Termite, to use the CLI library. Use the following settings in the emulator:

    • 115200 bit/s
    • 8-bit-long word
    • no parity
    • 1-bit stop

    Then you can issue the commands in the documentation of the example and in the CLI reference to the device using the terminal emulator. To start the device as a coordinator issue the following commands:

    bdb role zc

    bdb start

    The first command will set the role as coordinator, and the second one will start the Zigbee network.

    For the router, you only need to call "bdb start", and the router will join the network if the coordinator has created the network and the network is open. The coordinator will keep the network open for 180 seconds at a time. If it has closed and you need to open it, you can do so by simply calling "bdb start" again. After this you can issue commands to your devices to send messages to the other device, using the commands in the documentation.

    Best regards,

    Marte

Related