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 reauthentication to ZC after lost key

Other Parts Discussed in Thread: Z-STACK

Hi, I have a question which is probably simple for someone with more experience than myself.  I am using Z-Stack Energy 1.1.0 on SmartRF05EB (x2)


I have a Zigbee Coordinator (ZC) and a Zigbee End Device (ZED) communicating directly with one another.  I have the following options for compilation:
NV_INIT

NV_RESTORE

SECURE=1

zgPreConfigKeys = FALSE;

zgApsLinkKeyType = ZG_GLOBAL_LINK_KEY;

If I erase the entire flash of both devices, and program them with fresh certificates the ZED associates and communicates with the ZC fine.  If for some reason the ZED loses the NWK key (in my case because of re-flashing) it never re-authenticates on the network, it continually re-associates and then goes through a soft reset cycle due to an UNAUTH timeout.


How do I initiate re-authentication when a known device loses its key?

  • I think you have to go through the key establishment procedure again.

  • Thanks,

    Can you give me a quick pointer on where to start?  Is there a function call that will force the device to go through key establishment?


    I can see in the debugger that loading the network key is returning all zero's, I would have thought that the stack would automatically attempt CBKE when the stored key is all zeros?

  • You can refer to Z-Stack Energy Sample Application User's Guide.pdf in C:\Texas Instruments\Z-Stack Energy 1.1.0\Documents

  • RTFM was my first step,  I have been studying the user and developer guides for both zstack and zstack energy for the last 3 days.  I have even found a thread which outlines a possible fix for a bug in the stack which involves commenting out the line

    "//if ( keyItems.frameCounter > 0 )" in ZDApp_RestoreNwkKey,  however this did nothing to solve the problem. 


    I have also found the same question on this forum which was unanswered (and the OP was not kind enough to share his final solution): http://e2e.ti.com/support/wireless_connectivity/f/158/t/379992.aspx

    Does anyone perhaps have some more specific advice?   

    Thanks. 

  • Some more info on the initialisation of the end device, during the process, I get the following states in the ZDO_STATE_CHANGE event:


    DEV_NWK_DISC

    DEV_NWK_DISC

    DEV_NWK_DISC

    DEV_END_DEVICE_UNAUTH

    and then a soft reset.

    Anyone have a clue what's going on?

  • (ASHAMED) From the Smart Energy Sample Application Users Guide:

    Note: NV_RESTORE is not turned on by default, so if you power cycle any of the devices, it
    needs to go through the key establishment procedure again, and a different link key would be
    used. NV_RESTORE is turned off by default to allow rapid development. Also, any device
    joining the ESP wouldn't be able to join more than once since the new link key is used for
    authenticating the device instead of the default TC link key. Power cycle the ESP and then the
    joining device so that it is able to join using the default TC link key.

    so it stands to reason that with NV_RESTORE enabled the new link key would permanently be saved in the ZC meaning that re-joining with the previously shared TCLK would fail.

    Yikai Chen was right,  I should read more closely.