otInstanceFactoryReset does not work properly.

Hi,

Added a function to the coap_client sample code that executes otInstanceFactoryReset by pressing a button and sets it to factory shipping mode. However, it appears that the device just reset and did not delete all settings stored in non-volatile memory.
The CLI factroyreset command removes configurations stored in non-volatile memory.

I'm using the same API that I'm running in the CLI, so why would there be a difference?

I'm using SDK v2.5.0.

Best regards,

Hiroki

Parents Reply
  • Hi,Jorgen

    I'm doing it without using openthread_start. Therefore, by default it is not affected by network keys or CONFIG_OPENTHREAD_JOINER_AUTOSTART.
    Just to be sure, I deleted the network key and enabled CONFIG_OPENTHREAD_JOINER_AUTOSTART, but there was no change.
    After further investigation, implementing a process that runs otInstanceFactoryReset when otDatasetIsCommissioned is enabled in the coap_client_utils_init method results in a factory default state. However, if otInstanceFactoryReset is executed within the button process instead of within the coap_client_utils_init method, the factory default state will not be set.
    Is there a rule to determine when to call otInstanceFactoryReset?

    Best regards,

    Hiroki

Children
Related