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.

new devices join the network soon will automatically leave?

Other Parts Discussed in Thread: CC2530, Z-STACK

security network running for a long time,new devices join the network soon will automatically leave?


    SECURE = 1, ZG_SECURE_DYNAMIC = 0, zgPreConfigKeys = TRUE, compile option enabled NV_RESTORE, NV_INIT.
I use NLME_PermitJoiningRequest function allows devices to join the network through the serial command . When open network permitjoin device sends beacon try

to join the network. After joining the network ,devices will conduct coordinator with heartbeat communication, other option is the default configuration.
        Atfirst the network is operating normally, during many devices join the network and running for a long time ,
suddenly the new devices try to join the network after tens of seconds, they will automatically leave. Debugging found devices will enter ZDO_LeaveInd

function, but can not find where call this function. If the new device join the network, immediately turn off coordinator, then this device will always in

the network ultil the coordinator rejoin this network. So I suspect that the coordinator let the new device leave the network , but my program does not call such as ZDP_MgmtLeaveReq() function to let the devices leave the network, do anyone who have this problem? How to solve it? Packet Sniffer capture data for reference in the insert file.


Thanks !

4201.new devices join the network soon will automatically leave.psd

  • Hello,

    I'm using z-stack core 2.6 from Lightlink download in cc2530 devices. I have a similar problem. In f8wConfig.cfg I have

    /* Enable ZigBee-Pro */
    -DZIGBEEPRO
    /* Set to 0 for no security, otherwise non-0 */
    -DSECURE=1
    -DZG_SECURE_DYNAMIC=0

    Then in the project options in preprocessor defines I have set following defines for the router since I implemented OAD firmware upgrade

    OSAL_CLOCK
    TC_LINKKEY_JOIN
    NV_RESTORE
    MAKE_CRC_SHDW
    OAD_ENABLE

    For the coordinator I have

    OSAL_CLOCK
    TC_LINKKEY_JOIN
    NV_RESTORE

    In ZGlobals.c I am using 

    uint8 zgPreConfigKeys = TRUE;

    uint8 zgApsLinkKeyType = ZG_GLOBAL_LINK_KEY;

    I'm using keys values as they came from z-stack installation because I'm doing testing. I've checked and I'm using the same f8Config.cfg, ZGlobals.c and ZGlobals.h for both devices, same file from same source so keys should definitely match.

    If I use the packet sniffer I see that the router tries to join the coordinator, the coordinator even assigns the router a short address but then the router keeps asking again and again for association and the loop never ends. There is another network in the area and sometimes the router asks for association with that network and it rejects it, but that's ok because keys are not set up in that network. Please see attached packet sniffer capture

    I have read this post which also describes something similar http://e2e.ti.com/support/low_power_rf/f/158/t/132572.aspx?pi216036=2 If I comment the line mentioned in that post //if ( keyItems.frameCounter > 0 ) in the coordinator the same thing happens so it's not that problem.

    However if I set the variable uint8 zgPreConfigKeys = FALSE; in the Coordinator and leave every other settings the same. Then the system works and I can send data between devices without problem. Please see packet sniffer capture.

    I don't understand why this is happening, I've searched the forum extensively and read the Z-Stack developer's guide but all I find is the configuration I have set-up. And it should work, all I can think of is that the pre-configured keys somehow don't match but I don't see how that's possible if I'm using the same source files for both devices. I don't see when the key is sent in the packet sniffer, please see next image.

    I need to use pre-configured keys so the keys aren't sent over the air because of security issues. Shouldn't zgPreConfigKeys be set TRUE in all devices?

    Any help will be appreciated. I'll post any findings I make as well.

  •         I set zgPreConfigKeys = TRUE in my program. My problem is caused by my little mistake. I check the AssociatedDevList, if AssociatedDevList[loopi].age > NWK_ROUTE_AGE_LIMIT then I remove stale node, I think the NWK_ROUTE_AGE_LIMIT is too short, then I  change to a long time such as 60. Sometimes the new node's AssociatedDevList[loopi].age == 0xFF,I don't konw why.

            for(loopi = 0; loopi < NWK_MAX_DEVICES; loopi++)
        {       
          //{          
                nr = AssociatedDevList[loopi].nodeRelation;      //
          if((nr == CHILD_FFD_RX_IDLE)||(nr == CHILD_FFD)||(nr == CHILD_RFD)||(nr == CHILD_RFD_RX_IDLE))
          {
              if((AssociatedDevList[loopi].age > 60)&&(0xFF != AssociatedDevList[loopi].age )) 
              {
                RemoveStaleNode(loopi);
              }
                }
            }

    void RemoveStaleNode( uint8 index )
    {
      AddrMgrEntry_t addrEntry;
      NLME_LeaveReq_t req;
      uint8 i = Z_EXTADDR_LEN + 1;
     
      addrEntry.user = ADDRMGR_USER_DEFAULT;
      addrEntry.index = index;
     
      if (AddrMgrEntryGet( &addrEntry ))
      {
        for (i = 0; i < Z_EXTADDR_LEN; i++ )
        {
          if ( addrEntry.extAddr[i] != 0 ){ break;}
        }
      }
      if(i < Z_EXTADDR_LEN)
      {
      // Remove device
        req.extAddr = addrEntry.extAddr;
        req.removeChildren = TRUE;
        req.rejoin = TRUE;
        req.silent = FALSE;
        NLME_LeaveReq( &req );
      }
      else
      {
        AssocRemove(addrEntry.extAddr);
        ZDApp_NVUpdate();
      }
    }

  • Hi,

    thank you for your help!!

    However I don't check "AssociatedDevList" and I don't have any similar functions in my application code. The weird thing is that if I set zgPreConfigKeys = FALSE everything works fine. I just want to avoid sending the keys Over-The-Air for security issues.

  • Hi Francisco,

    Do you have any modification on your ZStack? If so, I would suggest you to use a clean installation to test again.

  • Thank you!! I had extracted the 2.6 core from the Lightlink download and I was using that but I guess I shouldn't have done that. I tried it in a clean 2.5.1 Z-Stack download and it worked without problem.

    I still think it should work in the 2.6 version too but maybe it's not completely ready for general purpose applications.