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.

CC2538: Device trying to connect to a network that doesn't exist

Part Number: CC2538
Other Parts Discussed in Thread: Z-STACK

Hello,

My device is trying to join an network that doesn't exist. I am erasing its memory and flashing it so as to make sure that the nv is clear and after about 5 minutes ZDO_SyncIndicationCB is triggered and it's devStartMode changes to MODE_REJOIN. What could be the cause of this?

  • It might join an open Zigbee network. I would suggest you to use sniffer to check what exactly happens over the air.

  • That is not the case as there aren't any zigbee networks with enable join, but used a sniffer and I don't see anything

  • Do you use sniffer to check all channels?

  • Hello Panagiotis,

    What Z-Stack version are you using, what example project/build configuration is referenced, and what changes have you made to the default settings?  ZDO_SyncIndicationCB indicates loss of synchronization with a parent device, and neither that or MODE_REJOIN is expected for a fresh device which has no parent relation.  How are you erasing the device memory and have you tried performing a factory reset through software?  Please share the exact location in code where devStartMode changes to MODE_REJOIN.  Is the Touchlink feature used?  Also, confirm your channel configurations and provide sniffer logs of at least the beacon requests sent from the device.

    Regards,
    Ryan

  • Hello,

    I am using Z-Stack 1.2.2a, the project referenced is a SampleLight end device but the project has progressed so much that it's like its own project. I was given this project to fix this issue so I don't have a lot of info about its configuration. I haven't tried performing a factory reset through software but I have tried to leave the "network" with no results and also have tried restarting the device. devStartMode changes to MODE_REJOIN in ZDApp.c at line 1669. If I remember correctly touchlink isn't available in home automation. About the sniffer, because of high zigbee traffic, I set both the device and the sniffer to channel 21. Here is the link to the sniffer logs (not all beacon requests are from my device, but most of them are): https://drive.google.com/file/d/1z1Mdkc9o0aBPe6yBKazf9qBgyphUTT8x/view?usp=sharing

    In case ZDApp is modified here is the exact code snippet

        if (nwkStatus == ZSuccess)
        {
          .....
        }
        else
        {
          if ( devStartMode == MODE_RESUME )
          {
            if ( ++retryCnt <= MAX_RESUME_RETRY )
            {
              if ( _NIB.nwkPanId == 0xFFFF )
                devStartMode = MODE_JOIN;
              else
              {
                devStartMode = MODE_REJOIN;
                _tmpRejoinState = true;
                prevDevState = DEV_NWK_SEC_REJOIN_CURR_CHANNEL;
              }
            }

    I managed to figure out when the callback is triggered. When the program starts, after one minute it sets the poll rate with NLME_SetPollRate to an x number and unless the device joins a network, after 6 minutes, it will set again the poll rate to the same x number and then the callback will be triggered. On subsequent set poll rates (as it will happen every 6 minutes if the device doesn't join a network), the callback is not triggered

  • As the code snippet shows, MODE_REJOIN is set if _NIB.nwkPanId is not equal to 0xFFFF.  _NIB.nwkPanId is set to INVALID_NODE_ADDRESS in NIB_init and is otherwise changed in ZDApp_ProcessOSALMsg for case ZDO_NWK_DISC_CNF when devStartMode is equal to MODE_REJOIN.  You can can further monitor the _NIB contents and modify ZDApp.c according to your needs.  I recommend referencing the Z-Stack 3.0.2 version as it is more refined and robust, for example it also sets _NIB.nwkPanId to 0xFFFF inside ZDOInitDevice.  The six minutes you describe sounds like the REJOIN_BACKOFF and REJOIN_SCAN defined in the f8wConfig.cfg file.  Do you have any Beacons from ZC/ZR devices on this network?  They aren't appearing on the sniffer log and should respond to Beacon Requests even if the ZED intends on a "rejoin".  Have you also tried testing a default Z-Stack 1.2.2a ZED SampleLight project?

    Regards,
    Ryan