Open alfo opened 4 years ago
I should also mention that if I change the WiFiManager version to 0.1.5, everything works as expected, so it's a problem specific to ~v2.x.x
There has been alot of talk of this and wifi working everyother restart.
I think this is an esp bug, did you do a full erase?
*WM: [3] lastconxresult: WL_STATION_WRONG_PASSWORD
Try to full erase memory from esptool or arduino, corrupt flash can cause this, or sdk changes etc.
also enable all debugging in esp, to see what its wifi is doing
You can try this and see if it changes, some esps hang mid connect, we do not know why, might be related to routers
// This is sometimes necessary, it is still unknown when and why this is needed but it may solve some race condition or bug in esp SDK/lib
// wm.setCleanConnect(true); // disconnect before connect, clean connect
Ah, I think clearing the flash completely has fixed it, my bad. Must be because I've switched between 0.15 and 2.0.1 in the same project while developing.
Actually, I'm an idiot, sorry. This only fixed it once, which it seems is the same as the "every other problem".
Thanks , yeah I have no idea what causes this.
I was never able to reproduce it, there are a few issues on it, I will try to reference them all and see what could be the common cause..
My workaround is that disabling config portal and calling autoConnect() again until wifi connects. (tested on M5Paper, using 2.0.3-alpha from Arduino Board Manager)
On the second or third try, autoConnect() outputs failure log like first attempt (WL_STATION_WRONG_PASSWORD) , but the connection is actually established. I don't know why but it's working now.
To show config portal, I added checking of button press on launch and call startConfigPortal() if the button has pressed.
wifiManager.setEnableConfigPortal(false);
while(true) {
setupWiFi(); // call autoConnect()
if (WiFi.isConnected()) {
break;
}
canvas.drawString("Waiting to retry WiFi connection...", 30, 30);
canvas.pushCanvas(0,0,UPDATE_MODE_DU4);
delay(3000);
}
I have the same thing on my project. Except it's when I've just uploaded the firmware (platformio + VSCode) through USB. If I use OTA the issue doesn't happen. If I hit the reset button on the ESP it comes back straight away.
I have noticed the same behavior before I was using WifiManager, and just the regular ESP Wifi.h. I thought it was a bug in my router perhaps, not allowing a client to join so quickly after leaving. A throttling function perhaps? Which could explain the different behaviors people are seeing?
I'm also running into the same issue, the connection is failing with every other restart, and every time the program is reuploaded. Is there any news regarding a potential fix for this issue?
Nevermind, the setConnectRetries() function worked around this issue for me, as described here: https://github.com/tzapu/WiFiManager/issues/979#issuecomment-831057723
Basic Infos
Hardware
WiFimanager Branch/Release:
Esp8266/Esp32:
Hardware: ESP-12e, esp01, esp25
ESP Core Version: 2.4.0, staging
Description
After a successful storing of WiFi details, the first time the ESP8266 boots up (from no power, or new sketch upload), it will fail to join the new WiFi with the stored details (and therefore will switch to AP mode).
Pressing the hard reset button to reboot and/or using
ESP.restart()
, the next time the ESP boots it will work fine.See debug messages at the bottom of the issue:
Settings in IDE
Module: Wemos D1 v2 Module: Wemos D1 32
(tried both)
Sketch
Debug Messages
Then I press the hard reset button/or call
ESP.restart();