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.

z-Stack restore factory setting

Other Parts Discussed in Thread: Z-STACK, CC2530

Hi,

I am in trouble resetting enddevices/routers to their factory settings (to let them join another network).

Currently I initialate a NLME_LeaveReq() (rejoin off) and after the device comes up in DEV_HOLD I do a SystemResetSoft().

This works as long as the device is connectet to a network, but when the network is not available or the connection isn't established this method doesn't work.

Is there a smart/easy way to do a reset to factory settings?

Thanks

Felix

  • Hi Felix,

     

    I am not fully understand what exactly you mean by "factory settings".

    Can you please describe in a more detailed way, what is exactly you

    are trying to achieve here?

     

    Br,

    Igor

     

  • Hi,

     

    By  "factory settings" I mean the following:

    I have a device which is working in network 1.

    Now I want to join this device to network 2.

    So the device has to "forget" network 1 in order to join network 2.

     

    After the "reset" the device should be in the same state as after programming (with "Erase Flash" on, except user defined NV variables) without reprogramming.

     

    I hope this is clear enouth?!

     

    Thanks,

    Felix

  • Hi Felix,

     

    Yes, this clarifies a few things.

    I have one more question, how exactly the end device knows (what is the criteria)

    that at this moment it should be trying to connect to network 2, or to network 1?

     

    By the way, network 1 differs from network 2 by PAN_ID, by ZigBee Channel, or by both?

     

    Br,

    Igor

  • Hi,

     

    the reset is initialized by a button press sequence done by the user.

    After the sequence the device should search for networks and connect to the strongest (this can be network 1 or any other network, exactly the same way as it does during the first boot).

    The difference can be pan ID, Channel, extended pan ID or non of the listed items (When there is no other network it should join the "original" network).

     

    Thanks

     

  • Hi,

     

    Ok, let's say that the user has pressed the right sequence and now let's assume for

    a moment that somehow you've managed to store your application's current state

    (so it could be restored later).

    If the device's FW was precompiled with the following configurations:

    1. -DDEFAULT_CHANLIST=0x00000800  // 11 - 0x0B
    2. -DZDAPP_CONFIG_PAN_ID=0xFFFF
    3. NV_INIT and NV_RESTORE options are OFF
    4. No HOLD_AUTO_START option initiated

    Calling SystemReset(); will reset the device (hard reset). After this type of reset the device

    will scan for available network.

     

    Is that what you are trying to do, or am I mistaken somewhere?

     

    Br,

    Igor

  • Hi,

     

    I forgot to mention that I'm using NV_INIT and NV_RESTORE - sorry about that.

     

    ad 1) yes

    ad 2) yes

    ad 3) no

    ad 4) yes

     

    NV_INIT and NV_RESTORE are turned on, because normaly when a power cycle is done the device should rejoin its network.

    Just image a situation in the field: (how it should work)

    My device is a Home Automation Mains Power Outlet.

    It has been working in its network for a longer period of time, survived a few balckouts, ...

    Now I wan't to join this device into a new network.

    I press the "magic sequence" and the device does a reset into a state where it is ready to join a new network.

    Device joins the found network.

    Everyone is happy :)

     

    Thanks

    Felix

  • Hi Felix,

     

    Ok, so you've pressed the "magic sequence" and now your device

    restored to "factory setting", while the PAN_ID configured to 0xFFFF.

    What can possibly prevent from this device to join the network it has been

    associated with prior the "magic sequence" was entered?

     

    Br,

    Igor

  • Hello Felix,

    Please see the Z-Stack API Document (Page 9 section 3.1.2 ZDO Device Network Startup) which explains how to configure the Z-Stack to reset previous network configuration and start/join a new network.

    If you are using ZNP, please refer to the ZNP Interface specfication document section 4.2.3.1.

    You can find these documents in the Z-Stack install -

    1. Z-Stack API.pdf document at -  C:\Texas Instruments\ZStack-CC2530-2.5.0\Documents 

    2. ZNP Interface Specification at - C:\Texas Instruments\ZStack-CC2530-2.5.0\Documents\CC2530

    Regards,

    Suyash Jain 

  • Hi,

     

    please corret me if I'm wrong:

    I have to add "HOLD_AUTO_START" to my compile options and initialise network start on my own by calling "ZDOInitDevice()" (e.g. from "xxx_Init()" function). To let the device join a new network I do a reboot (SystemSoftReset()) and set "ZCD_STARTOPT_DEFAULT_NETWORK_STATE" before calling "ZDOInitDevice()"?

     

    Thanks

    Felix

  • Hi Felix,

     

    You are correct, except one thing, you must set ZCD_STARTOPT_DEFAULT_NETWORK_STATE

    before you doing the SystemSoftReset() (or other reboot).

     

    Br,

    Igor

  • Hi,

     

    thank you, I will try it on friday.

     

    Felix

  • Hi,

     

    this worked for me. I set "ZCD_STARTOPT_DEFAULT_NETWORK_STATE" before resetting the device and afterwards it joins a new network.

     

    Big thanks

    Felix

     

    Felix Bruckmüller said:

    Hi,

     

    please corret me if I'm wrong:

    I have to add "HOLD_AUTO_START" to my compile options and initialise network start on my own by calling "ZDOInitDevice()" (e.g. from "xxx_Init()" function). To let the device join a new network I do a reboot (SystemSoftReset()) and set "ZCD_STARTOPT_DEFAULT_NETWORK_STATE" before calling "ZDOInitDevice()"?

     

    Thanks

    Felix

     

  • where exactly you have added "ZCD_STARTOPT_DEFAULT_NETWORK_STATE" ?
    Thanks in advance
  • You can refer to zclSampleLight_BasicResetCB in SampleLight example of Z-Stack Home 1.2.2a.