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.

the Zigbee ZR did not resend the MSG to ZC issue

Other Parts Discussed in Thread: Z-STACK

Hi all :

there are 4 ZEDs ,1 ZR and  1 ZC in the network.

those ZEDs were all connect to  the ZR ,  and  the ZR connect the ZC。

i set a timer to sending the Active EP request from ZR to ZC again and again  to checking the link state.

  if(events & NETLINK_CHECK_EVT)
  {      
     if(Being_Link == FALSE)
     {
      #ifdef LEDShow
        HalLedSet ( HAL_LED_2, HAL_LED_MODE_OFF);
        if(!BasicReset)
          HalLedBlink ( HAL_LED_1, 0,LOST_NETWROK_FLASH, LOST_NETWROK_CYCLE );
      #endif 
     }
     else
     {
      #ifdef LEDShow
        HalLedSet ( HAL_LED_1 | HAL_LED_2, HAL_LED_MODE_OFF);
      #endif
     }
     
     if(FailedLinkCnt >= LoseLinkCnt_Limit)
     {
       Being_Link = FALSE;
       FailedLinkCnt =0;
     }
     else
     {
       FailedLinkCnt++;
     }
     
     ZDP_ActiveEPReq(&Coordinator_dstAddr,Coordinator_dstAddr.addr.shortAddr,0);
     osal_start_timerEx( zclVrouter_TaskID, NETLINK_CHECK_EVT, NETLINK_CHECK_CYCLE);//8second
     return ( events ^ NETLINK_CHECK_EVT );
  } 

this network running 30~40 minutes latter, i found that all ZEDs and ZR were “lose connect” with ZC.

Those ZED sent a Msg to ZC via ZR , but ZR receive it and didn't resend to ZC.

and there is not any ACtive EP request more....

 

here is the log :ZR lose connect with ZC.rar

  • Which Z-Stack version and example do you run as ZR?
  • Hi yikai
    it is zstack1.2.2a
  • Do you modify anything to it?
  • just add the timer to send ACTIVE EP request again and again。

    as show above!
  • I suspect your ZR is not working when this happens. As you can see, there is no active endpoint request from ZR to ZC at this moment. I would suggest you debug to see where ZR stuck.
  • where should i set the break point?
  • You can try to set it in NETLINK_CHECK_EVT and see if it is hit after the problem happens.
  • Hi yikai !
    when the problem happens, it could hit the break point in the NETLINK_CHECK_EVT。

    and i saw it always running the

    osal_start_timerEx( zclVrouter_TaskID, NETLINK_CHECK_EVT, NETLINK_CHECK_CYCLE);//8second



    but never going into NETLINK_CHECK_EVT again!
  • Since it is hit, do you see active endpoint request is sent in Ubiqua Packet Analyzer?
  • No ,there is not more active endpoint request in ubiqua, but IAR shows it had run below code

    ZDP_ActiveEPReq(&Coordinator_dstAddr,Coordinator_dstAddr.addr.shortAddr,0);
    osal_start_timerEx( zclVrouter_TaskID, NETLINK_CHECK_EVT, NETLINK_CHECK_CYCLE);//8second
  • You should check return value of ZDP_ActiveEPReq when this issue happens.
  • it  (AF_DataRequest)returns  0x10

    #define afStatus_SUCCESS            ZSuccess           /* 0x00 */
    #define afStatus_FAILED             ZFailure           /* 0x01 */
    #define afStatus_INVALID_PARAMETER  ZInvalidParameter  /* 0x02 */
    #define afStatus_MEM_FAIL           ZMemError          /* 0x10 */
    #define afStatus_NO_ROUTE           ZNwkNoRoute        /* 0xCD */

    i  think that is i forgot to free the memory  when receive active ep response !!!!

    #ifdef NetLinkCheck       
       case Active_EP_rsp:
         {
           pActiveEndpoint = ZDO_ParseEPListRsp( pMsg );
           if(pActiveEndpoint->status == ZSuccess)
           {
             FailedLinkCnt =0;
             if(Being_Link == FALSE)
             {
               Being_Link = TRUE;
               #ifdef LEDShow
                 HalLedBlink ( HAL_LED_1 | HAL_LED_2, 5, CANCEL_EZMODE_FLASH, CANCEL_EZMODE_CYCLE ); 
                 UserEvtItem = Turn_Off_LED;
                 osal_start_timerEx( zclVrouter_TaskID, USERAPP_EVT, 1000 );
               #endif 
             }
           }
           osal_mem_free( pActiveEndpoint );
         }
         break;
    #endif

    maybe  add  this code  should be work!!!!!

    BR!

  • This error mean there is not enough memory. You have to check if there is memory leak in your application.