This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2652P: why ZC send a Leave request to ZED automatically?

Part Number: CC2652P
Other Parts Discussed in Thread: CC2340R5

Tool/software:

Hi TI team, I only used one CC2652P ZC and one CC2340R5 ZED test, and the two devices sent ZCL data to each other every 50ms.  After about 4 hours of testing, the ZC automatically sent an off-grid request to the ZED (rejoin field is 1). Please help me analyze what causes this phenomenon to occur. I've added sniff log to the attachment.

Note: In the ZC project, End Device Timeout is set to 9-512minutes. 

 leave request log.zip

by the way,  for CC2340 ZED projects, when I receive the ZB_ZDO_SIGNAL_LEAVE notification from the function zboss_signal_handler(), what can I do to know whether rejoin is yes or no, can you give me an example

I tried the following, but it didn't work.

case ZB_ZDO_SIGNAL_LEAVE:

{

zb_zdo_signal_leave_params_t *req_param = ZB_BUF_GET_PARAM(param, zb_zdo_signal_leave_params_t);

 Log_printf(LogModule_Zigbee_App, Log_INFO, "leave_type (%d) ", req_param->leave_type);

}

break;

  • Hi Senjin,

    The default ZC's end device timeout setting is rewritten by the nd Device Timeout Request from the ZED.

    256 minutes is rather close to your observation of the issue occurring after 4 hours of operation, and please note that the Private Cluster ZCL messages from the ZED are not sufficient to reset the age out timer on the ZC.  Here is a comment excerpt from zglobals.h in the F2 SDK

    //=======    Child Aging PARENT ROUTER (ZR/ZC) configuration   ========
    // You can setup a router to support Child Table Aging in 1 of 2 modes of
    // operation.  The first mode is NWK_PARENT_INFO_END_DEVICE_TIMEOUT_MSG and it
    // expects end devices to use End Device timeout message periodically as a means of a keep-alive
    // notification to the parent.  The other mode is NWK_PARENT_INFO_MAC_DATA_POLL
    // which uses the end device's MAC POLL request as the keep-alive notification.
    // The first method is preferred for new devices that will be RxOnIdle = FALSE as
    // it does not requires constantly sending data request frames other than needed by polling data from parent.
    // The second method is compatible with older end devices without the need for
    // specific child aging support.
    //
    // The method supported by the router (or coordinator) is determined at build time
    // by setting zgNwkParentInformation to either NWK_PARENT_INFO_END_DEVICE_TIMEOUT_MSG
    // or NWK_PARENT_INFO_MAC_DATA_POLL.
    //
    // End device built with Child Table Aging support both methods, the method is
    // determined by the parent and communicated at run-time.
    #if ( ZG_BUILD_RTR_TYPE )
    uint8_t zgNwkParentInformation = NWK_PARENT_INFO_MAC_DATA_POLL;

    So other than delaying the issue by increasing the value of ED_TIMEOUT_VALUE in ti_zigbee_config.h of your F3 SDK project, which would only delay the issue, you should also consider allowing the ZED to occasionally send out a Data Request or End Device Timeout Request depending on your F2 ZC preferences.

    Here is a code excerpt I haven't fully evaluated for processing a ZB_ZDO_SIGNAL_LEAVE message:

        case ZB_ZDO_SIGNAL_LEAVE:
        {
          zb_zdo_app_signal_hdr_t *sg_p = NULL;
          zb_zdo_signal_leave_params_t *leave_params = NULL;
    
          zb_get_app_signal(param, &sg_p);
          leave_params = ZB_ZDO_SIGNAL_GET_PARAMS(sg_p, zb_zdo_signal_leave_params_t);
          //...
        }

    Regards,
    Ryan

  • Hi Ryan,

    I would like to ask further, for CC2340R5 ZED device, how to send out a Data Request or End Device Timeout Request. The Rx_alwasy_on was set to true in my project, I used the following API interface to test, but I did not observe the device sending out keep alive packets. 

    zb_set_keepalive_timeout(ZB_MILLISECONDS_TO_BEACON_INTERVAL(ED_POLL_RATE));

    I tried to set the mode to ED_TIMEOUT_REQUEST_KEEPALIVE using zb_set_keepalive_mode(), but it still worked the same way.

  • Hi Senjin,

    I'm able to observe that my always-on ZED is still sending Data Requests at the default rate using the v8.40 F3 SDK.

    #elif defined ZB_ED_ROLE
      zb_set_network_ed_role(DEFAULT_CHANLIST);
    
      /* Set end-device configuration parameters */
      zb_set_ed_timeout(ED_TIMEOUT_VALUE);
      zb_set_rx_on_when_idle(ED_RX_ALWAYS_ON);
    //#if ( ED_RX_ALWAYS_ON == ZB_FALSE )
      zb_set_keepalive_timeout(ZB_MILLISECONDS_TO_BEACON_INTERVAL(ED_POLL_RATE));
    #ifdef DISABLE_TURBO_POLL
      // Disable turbo poll feature
      zb_zdo_pim_permit_turbo_poll(ZB_FALSE);
      zb_zdo_pim_set_long_poll_interval(ED_POLL_RATE);
    #endif // DISABLE_TURBO_POLL
    //#endif // ED_RX_ALWAYS_ON
    #endif //ZB_ED_ROLE

    Can you please help identify the difference between our two setups?

    Regards,
    Ryan

  • Hi Ryan, 
    I figured out how to reproduce the problem
    1, in syscfg configuration, zigbeee->enabled device types, and select zigbee end device and zigbee router at the same time.

    2. Modify the source code and set the device to zigbee end device mode.

    #ifdef ZB_COORDINATOR_ROLE
      zb_set_network_coordinator_role(DEFAULT_CHANLIST);
    #ifdef DEFAULT_NWK_KEY
      zb_uint8_t nwk_key[16] = DEFAULT_NWK_KEY;
      zb_secur_setup_nwk_key(nwk_key, 0);
    #endif //DEFAULT_NWK_KEY
      zb_set_max_children(MAX_CHILDREN);
    
    //#elif defined ZB_ROUTER_ROLE && !defined ZB_COORDINATOR_ROLE
    //  zb_set_network_router_role(DEFAULT_CHANLIST);
    //  zb_set_max_children(MAX_CHILDREN);
    
    //#elif defined ZB_ED_ROLE
    #elif defined ZB_ROUTER_ROLE
      zb_set_network_ed_role(DEFAULT_CHANLIST);
    
      /* Set end-device configuration parameters */
      zb_set_ed_timeout(ED_TIMEOUT_VALUE);
      zb_set_rx_on_when_idle(ED_RX_ALWAYS_ON);
    //#if ( ED_RX_ALWAYS_ON == ZB_FALSE )
      zb_set_keepalive_timeout(ZB_MILLISECONDS_TO_BEACON_INTERVAL(ED_POLL_RATE));
    #ifdef DISABLE_TURBO_POLL
      // Disable turbo poll feature
      zb_zdo_pim_permit_turbo_poll(ZB_FALSE);
      zb_zdo_pim_set_long_poll_interval(ED_POLL_RATE);
    #endif // DISABLE_TURBO_POLL
    #endif // ED_RX_ALWAYS_ON
    //#endif //ZB_ED_ROLE
    

  • Thanks Senjin, with this additional information I am also able to replicate the behavior.  I've notified the Zigbee R&D Team to advise on the best resolution path.

    Meanwhile, as a workaround would you be able to maximize the timeout rate (ED_AGING_TIMEOUT_16384MIN) and initiate a device rejoin when the Leave Request is delivered?  Practically this is a brief (~10s pause) in application operation every 273 hours.

    Regards,
    Ryan