Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factory Reset doesn't clear WiFi credentials before invoking network.connect() #736

Closed
XuGuohui opened this issue Nov 12, 2015 · 0 comments

Comments

@XuGuohui
Copy link
Contributor

commented Nov 12, 2015

Hi there,

Generically, clearing the WiFi credentials only happens when performing a factory reset and it actually executes when invoking the network.connect(). This would sound fine at most of time.

But there is a situation we must consider in that if we perform a factory reset and following set SYSTEM_MODE(MANUAL); in the sketch, it would not invoke the network.connect() at startup. Thus it will not clear the WiFi credentials even if the flag NVMEM_SPARK_Reset_SysFlag was set. Basing on this situation, It will cause these problems:

  1. If we invoked the function WiFi.hasCredentials() before WiFi.connect(), it would return true, instead of expected false.
  2. If we set WiFi credentials using WiFi.setCredentials() and then invoke WiFi.connect() to trying connecting to local AP, it will enter the listen mode, since in the connect() function it checks the NVMEM_SPARK_Reset_SysFlag and executs clearing the WiFi credentials we just set before. Unless we have to perform a reset so that the NVMEM_SPARK_Reset_SysFlag was cleared and it can connect to local AP.

I think if we actually want to perform a factory reset to clear the credentials, the device should execute this action upon finishing factory firmware reset or at startup of system part 2.

Cheers!
Guohui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.