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.

Endevice would not rejoin when a Leave Command received with rejoin flag set to True

Other Parts Discussed in Thread: Z-STACK

According to the Zigbee Spec, Section 3.4.4.3.1.1 Rejoin Sub-Field:

"The Rejoin sub-field is a single-bit field. If the value of this sub-field is 1, the device that is leaving from its current parent will rejoin the network. If the value of this sub-field is 0, the device will not rejoin the network"

In a simple experiment on ZHA-1.2.0, only on ZC+ZED, when the ZC send out a Leave Command with Rejoin flag set true, the enddevice would leave the network and continuously send out the Beacon Request, but it would not issue the re-join command though received the Beacon Reply from the ZC; thus it could not join the network again...

Is that expected for an endevice to rejoin back to the same network if a Leave Command with rejoin set to true?

  • Finally I have get some clue but need Ti enginner's input.

    I found an old endevice which uses Z-Stack-2.3.0 does not have this issue, while the new enddevice which uses ZHA-1.2.0 Release(which uses Z-Stack2.6.1) has the rejoin issue.

    By comparing code of two z-stack releases, and after making the following modification on ZHA-1.2.0, the rejoin behavior become normal:

    In the response of ZDO_DEVICE_RESET event:
    1: comment zgWriteStartupOptions(...)
    2: replace SystemResetSoft() to SystemReset()

    Detailed code lines below:
    diff --git a/Components/stack/zdo/ZDApp.c b/Components/stack/zdo/ZDApp.c
    index 0681172..d99cde0 100644
    --- a/Components/stack/zdo/ZDApp.c
    +++ b/Components/stack/zdo/ZDApp.c
    @@ -516,12 +516,13 @@ UINT16 ZDApp_event_loop( uint8 task_id, UINT16 events )
    #endif
    {
    // Set the NV startup option to force a "new" join.
    - zgWriteStartupOptions( ZG_STARTUP_SET, ZCD_STARTOPT_DEFAULT_NETWORK_STATE );
    +// zgWriteStartupOptions( ZG_STARTUP_SET, ZCD_STARTOPT_DEFAULT_NETWORK_STATE );

    // The device has been in the UNAUTH state, so reset
    // Note: there will be no return from this call
    #if !defined (ROUTER)
    - SystemResetSoft();
    +// SystemResetSoft();
    + SystemReset();
    #endif
    }
    }