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.

ZED behavior after its parent leaves

Other Parts Discussed in Thread: Z-STACK

When the parent of a ZED leaves the network (via ZDP_MgmtLeaveReq), I found that the ZED is also disconnected.

I have set the RemoveChildren = 0 and would expect the ZED to do an orphan join or rejoin.

But the fact is it does associate join after a power cycle.

Is that normal? If so, how can I leave only the parent not the ZED child?

  • Hello Kyle 

    Do you have the compile option NV_RESTORE defined when building the ZED application?

    Regards

  • Hi Suyash,

    Yes, I have both NV_INIT and NV_RESTORE defined.

    If the ZED's parent does not leave, power cycling the ZED will result in an orphan join perfectly.

    Actually, I think that I found where the problem is after examining ZDApp.c.

    In ZDO_LeaveInd(), there are these codes:

    if ( ind->srcAddr == NLME_GetCoordShortAddr() )    {

          if ( ( ind->removeChildren == TRUE               ) ||

               ( ZDO_Config_Node_Descriptor.LogicalType ==

                 NODETYPE_DEVICE                           )    )

          {

            leave = TRUE;

          }

        }

    So even if removeChildren == FALSE, as long as node type is end device, it will leave itself on receipt of the Leave Indication sent from its parent (which will always happen once the parent leave).

    This is not a natural behavior to me, since I specifically ask for removeChildren = FALSE. The expected behavior of the ZED should be rejoining (looking for new parent) rather than leave itself.

    Can any TI employee confirm if this is a bug?

  • Hi Kyle,

    I have tested this on Z-Stack Home 1.2.1 and there is no such problem. Would you specify which Z-Stack you use?

  • Hi Yikai,

    I am using Z-Stack 2.5.1a since I do not have the IAR that works with Home 1.2.1.

    However, I checked the source code of 1.2.1, the ZDApp.c has the same codes as the 2.5.1a version.

    So nothing has changed in this issue.

    To be accurate, you can reproduce the problem like this:

    1 ZC, 1 ZR, 1 ZED (Rx ON when Idle). Yes, please do not use a sleep ZED as the Leave command broadcast will not reach ZED with RXONIDLE=FALSE. Sorry I was not clear about this in my first post.

    Let ZED join ZR as a child, and then leave ZR.

    100% you will see ZED leaves and resets within 5 seconds.

    then it tries associate join rather than orphan/rejoin.