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

Combine zigbee roles or start a network of two devices

Hello. I'm a CS student and I've bought myself two NRF52840 Dongles. I've downloaded NRF Zigbee SDK and wanted to flash and try out some examples. But the simplest light_control example needs 3 devices to be in a network - Coordinator, Router and End Device. I need for my project only 2 though - actuator and sensor. So how is it possible to combine roles - Coordinator + end device or router + end device. Or how to communicate Coordinator-router or Coordinator-End Device?

Would really greatly appreciate your help)

  • Hello,

    Unfortunately, you can't use one device as both coorinator and router in Zigbee. However, the coordinator may do other things than just forwarding messages back and forth.

    We have an example called the cli_agent_router, which can act as a coordinator, and form the network for the other device (light_bulb) to join. But unfortunately, that application is not suited for the dongle, as the dongle doesn't route the UART pins to the USB. The example, running on a DK uses the programmer to translate from UART to USB, and send USB to the computer. 

    The dongle does have USB, but the example doesn't utilize that.

    I suggest that you get hold of at least one DK. Even if this was to work with the dongle, the dongle is not intended for development, but to be used with our development tools, such as nRF Connect. Since it doesn't have a debugger, it is very difficult to figure out what's actually going on after you upload your application. 

  • Unfortunately, due to the current situation in the world and troubles with shipment to my country, it's not an option for now. 

    Is it possible to transfer data between only two devices, without anything more in the zigbee network?

  • As I tried to say in the previous answer, yes. This is possible, as long as one of them are the coordinator. You can e.g. look at the example description of the multi_sensor example here:

    https://infocenter.nordicsemi.com/topic/sdk_tz_v4.0.0/zigbee_multi_sensor_example.html?cp=7_3_3_8_5_3_1#zigbee_multi_sensor_example_test

    I thought the cli example wouldn't run on the dongle, but it seems like I was wrong. There are both CLI and multi_sensor examples for the dongle (in the pca10059 folders).

    Please check the description from the link above, and try to follow it.

    Best regards,

    Edvin

  • I want to modify light_control example to send data from switch to coordinator. As I've seen here and as far as I understood, to send message from light_switch to coordinator I need in coordinator implement an endpoint for light_bulb. And from light_switch send data to address 0. 

    But how should address node 0? 

    I tried to change this:

    ZB_ZCL_ON_OFF_SEND_REQ(bufid,
                               m_device_ctx.bulb_params.short_addr,
                               ZB_APS_ADDR_MODE_16_ENDP_PRESENT,
                               m_device_ctx.bulb_params.endpoint,
                               LIGHT_SWITCH_ENDPOINT,
                               ZB_AF_HA_PROFILE_ID,
                               ZB_ZCL_DISABLE_DEFAULT_RESPONSE,
                               cmd_id,
                               NULL);

    to this:

    ZB_ZCL_ON_OFF_SEND_REQ(bufid,
                               0,
                               ZB_APS_ADDR_MODE_16_ENDP_PRESENT,
                               m_device_ctx.bulb_params.endpoint,
                               LIGHT_SWITCH_ENDPOINT,
                               ZB_AF_HA_PROFILE_ID,
                               ZB_ZCL_DISABLE_DEFAULT_RESPONSE,
                               cmd_id,
                               NULL);

    But I got an error: 

    zb_zcl_common.h:1682:17: error: lvalue required as unary '&' operand
    (zb_addr_u *)(&(addr)), dst_addr_mode, dst_ep, ep, prof_id, cluster_id, cb)

  • Fortunately, I've just implemented light_bulb in coordinator, and by using cli agent router able to control it. I send command on address 0: 

    >zdo match_desc 0xfffd 0xfffd 0x0104 1 6 0
        returns:src_addr=0 ep=10
    >zdo simple_desc_req 0 10
    >zcl cmd f4ce360d1d592d25 10 0x0006 -p 0x0104 0x02 //toggles light_bulb

    Now I'm looking for a solution to automate this in my switch code. Thanks for your help) 

Related