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

SmartConfig is not saving credentials after upgrading esp8266 board from 2.7.4 to 3.0.2 #8540

Closed
shajvarg opened this issue Apr 11, 2022 · 1 comment

Comments

@shajvarg
Copy link

the code below works perfectly in 2.7.4 version of the esp8266 board, but in 3.0.2 it does not connect and goes to smartconfig everytime..

void wifiSetup() {
/* Set ESP8266 to WiFi Station mode /
WiFi.mode(WIFI_STA);
int cnt = 0; bool smartcfg = false;
/
Wait for WiFi to connect to AP /
Serial.println("Waiting for WiFi");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
if((cnt++ >= 40) && !smartcfg) {
/
start SmartConfig /
int scnt = 0;
WiFi.beginSmartConfig();
/
Wait for SmartConfig packet from mobile */
Serial.println("Waiting for SmartConfig.");
while (!WiFi.smartConfigDone()) {
delay(500);
Serial.print(":");
if(scnt++ >= 120) ESP.reset();
}
Serial.println("");
Serial.println("SmartConfig done.");
smartcfg = true;
}
}
Serial.println("WIFI CONNECTED");
Serial.print("IP Address: ");
Serial.println(WiFi.localIP());
}

@mcspr
Copy link
Collaborator

mcspr commented Apr 27, 2022

See release notes, doc and #7902 ? By looking at the minimal example above, I'd suggest to add enableWiFiAtBootTime(); call somewhere the setup(); of you sketch. By default, WiFi station is disabled and there's no auto connect happening at boot anymore.
Otherwise, just try to start the connection by calling WiFi.begin() (notice that there are no arguments, it will use the saved ones)

@mcspr mcspr closed this as completed Apr 27, 2022
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

2 participants