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

ESP.eraseConfig() and ESP.restart() not erase WPS config. #2885

Closed
rudacs opened this issue Jan 19, 2017 · 6 comments
Closed

ESP.eraseConfig() and ESP.restart() not erase WPS config. #2885

rudacs opened this issue Jan 19, 2017 · 6 comments

Comments

@rudacs
Copy link

rudacs commented Jan 19, 2017

Basic Infos

Hardware

Hardware: ESP-12e
Core Version: 2.3.0

Description

I need to clear the WPS configuration directly by code.
I Tried to do:

ESP.eraseConfig();
ESP.restart();

Sketch

#include <Arduino.h>
#include <ESP8266WiFi.h>

void setup() {
Serial.begin(74880);
}

void loop() {
if (Serial.available() > 0)
  {
    String text = Serial.readString();
    text.trim();

    Serial.print("Command: ");
    Serial.println(text);

    if (text == "CLEAR")
    {
      ESP.eraseConfig();
      ESP.restart();
    }
    else if (text == "WPS")
    {
      startWPSPBC();
    }
  }
}
@frankalicious
Copy link

Does replacing
ESP.restart();
with
ESP.reset();
work?
See #1494

@bestpika
Copy link

WiFi config not erase.

void formatConfig() {
    Serial.println(ESP.eraseConfig());
    delay(5000);
    ESP.reset();
}

@devyte
Copy link
Collaborator

devyte commented Oct 4, 2017

@rudacs @bestpika Could you please try PR #3215 ? It has the latest SDK. I'm not aware of any relevant changes, but it's worth a try.

@igrr
Copy link
Member

igrr commented Oct 4, 2017 via email

@tablatronix
Copy link
Contributor

tablatronix commented Oct 29, 2017

Only #3635 fixes this for me, I am unable to get eraseConfig to do anything in 2_3_0 1.5.3. FYI

@devyte
Copy link
Collaborator

devyte commented Jan 8, 2018

The referenced PR is already merged, and there is confirmation by @tablatronix , so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants