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

[nRF52840 + zigbee] How to know whether ZED is jointed to ZR or ZC ?

Hi,

I am developing zigbee solutions for sensor monitoring.

situation a)

ZC(1)------------ZR(2)--------------ZED(3)

situation b)

ZC(1)------------ZR(2)

    |

   +--------------ZED(3)

I have known that ZED is joined ZR or ZC.

I have some questions about joining.

1)  If ZED(3) is power on and ZED is joined ZR, ZED is joined to ZR all the time ?

2) If ZED is re-powered, ZED can join to ZC directly ?

3) How does ZED know that it is joined to ZR or ZC ?

Another question.

Is there way to communicate between ZC(1) and ZC(2) with different PAN-ID by zigbee protocol ?

ZC(1) --PANID_a

  |  <-- zigbee communiction

ZC(2) --PANID_b

Thanks.

Parents
  • Hi.

    In a Zigbee network you have one coordinator (ZC). The coordinator is a fixed role and can not be changed. The coordinator is responsible for forming the network and selecting channel and PAN ID.

    The router (ZR) creates the core of the mesh topology, provides routing service to other devices, and allows child nodes to join the network. The Zigbee router does not sleep.

    The end device (ZED) does not participate in routing, it is only a leaf node with one parent. The difference between Sleepy End Device and Non-Sleepy End device is only that the Sleepy End Device is designed for low power operations and will sleep when unless it tries to extract any messages stored in the parent router. The Non-Sleepy End device does all these things except it has the power.

    1)

    Your ZED will communicate with the ZR which as the best Link Margin. When the ZED is powered on it will broadcast a Beacon Request and any coordinator/router in within reach of that message will response, and the ZED will select the coordinator or router with best Link Margin.

    2)

    See the answer above.

    3)

    You can see that if the commissioning is between your ZED and the source 0x0 then the device joined the ZC.

    Is there way to communicate between ZC(1) and ZC(2) with different PAN-ID by zigbee protocol ?

     It might be possible by using INTER-PAN communication and the function zb_zll_send_packet() described in external\zboss\include\zcl\zb_zcl_touchlink_commissioning.h

    * @brief Finish packet and send it to the designated IEEE address.
    * @param buffer [IN] - pointer to the @ref zb_buf_t "buffer" containing packet.
    * @param data_ptr [IN] - pointer to the packet tail.
    * @param dst_addr_long [IN] - destination device's IEEE address.
    * @param callback [IN] - callback to call upon send packet confirmation.
    * @return packet send schedule status (see @ref zb_ret_t).
    */
    zb_ret_t zb_zll_send_packet(zb_buf_t *buffer, zb_uint8_t* data_ptr, zb_ieee_addr_t dst_addr_long, zb_callback_t callback);
    #define ZB_ZLL_SEND_PACKET(buffer, data_ptr, dst_addr_long, callback) \
    zb_zll_send_packet(buffer, data_ptr, dst_addr_long, callback)

    However, we have no examples of this and I'm unsure how you would process the recieved packet.

    Best regards,

    Andreas

  • Thanks for the reply.

    About question 3), is there a API to check short address of the parent ?

    I want zed to know address of the parent after commission.

    Sincerely yours.

    embeddedHolic.

  • Hi again.

    Yes, for example in the zboss_signal_handler(zb_uint8_t param) in the examples, you find something like:

    /**@brief ZigBee stack event handler.
     *
     * @param[in]   param   Reference to ZigBee stack buffer used to pass arguments (signal).
     */
    void zboss_signal_handler(zb_uint8_t param)
    {
        /* Read signal description out of memory buffer. */
        zb_zdo_app_signal_hdr_t * p_sg_p      = NULL;
        zb_zdo_app_signal_type_t  sig         = zb_get_app_signal(param, &p_sg_p);
        zb_ret_t                  status      = ZB_GET_APP_SIGNAL_STATUS(param);
        
        switch(sig)
        {
        case ZB_ZDO_SIGNAL_DEVICE_ANNCE: // Tells that a device joined
            {
                zb_zdo_signal_device_annce_params_t * dev_annce_params = ZB_ZDO_SIGNAL_GET_PARAMS(p_sg_p, zb_zdo_signal_device_annce_params_t);
                NRF_LOG_INFO("Device with a short address 0x%hx commissionned", dev_annce_params->device_short_addr);
                break;    
                ....
                ...
                .. 
                .
        

    Best regards,

    Andreas :-)

  • Thanks..

    But i want ZED know 16 bit address of it's parent.

    Above source is parent side source.

  • Hi.

    Could you please explain some more, I don't think i quite understand this :-)

    Best regards,

    Andreas

Reply Children
  • First ZED is connected to (joined) ZR or ZC.

    At that time ZED want to know the parent short address.

    If ZED joined to ZR, ZED retrieve the ZR's short address.

    If ZED joined to ZC, ZED retrieves the ZC's short address(In this case, parent address will be zero).

  • Hi.

    Sorry that I misunderstood you.

    I've looked around and there is no direct API for getting the short address to a parent node from a ZED.

    You could try to call zb_zdo_mgmt_lqi_req destined to itself (child node), this will give you zb_zdo_neighbor_table_record_t. The response should then be parsed and you can search for entry with type_flags corresponding to the parent node you're looking for.

    I haven't tried this myself and I don't have any more details right now so I will need to ask around if this is a approach you would want to try.

    Best regards,

    Andreas

Related