mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #990] WiFiManager fails to reconnect when predefined WiFi credentials are used and default AP is off. #843
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#843
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mrdc on GitHub (Jan 8, 2020).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/990
Basic Info
Hardware
WiFimanager Branch/Release: 0.15.0-Beta
Esp8266/Esp32:
Hardware: ESP-12e, esp01, esp25
ESP Core Version: 2.4.0, staging
Description
Hello,
I'm trying to use WiFiManager with predefined WiFi credentials when I use ESP32 in my office and still be able to connect to WiFi when I'm somewhere else. Code below works when my office AP is ON (predefined credentials in my code):
WiFiManager is not making it's own AP to configure credentials, so everything is fine. When my office AP is OFF when ESP32 restarts there is a bug: WiFiManager makes it's own AP as it should, I can go to Web interface, etc. But if I do nothing in Web interface, turn on my predefined office AP and restart ESP32 it won't connect to it but instead WiFiManager's AP is created again and again.
To overcome the issues I need to go to WiFiManager's portal -> Info -> Remove WiFi credentials -> then after restart it successfully connects to the predefined office AP.
Settings in IDE
Module: ESP32 Dev Module
Sketch
Serial output during the issue:
@tablatronix commented on GitHub (Jan 8, 2020):
Do you expect the esp to automatically reconnect somehow? Do you mean even if you restart the esp, it it will not reconnect to the router?
Try erasing your NVS it could be corrupt
@mrdc commented on GitHub (Jan 8, 2020):
No, there is no code for reconnect. I was manually pressing the reset button on ESP32. When predefined (SSID&Pass in code) office AP is on, I can press reset 10 times and each time ESP32 successfully connects to it and in logs I see
*WM: [1] AutoConnect: ESP Already Connected, so everything is fine. But when I turn off office AP, press the reset button, ESP32 reboots, WiFiManager creates AP to configure credentials and if after that I turn on my predefined in code office AP, press the reset button, ESP32 reboots, but fails to connect to my office AP.@tablatronix commented on GitHub (Jan 9, 2020):
interesting. Sounds like corrupt NVS, have you replicated on multiple esps? or tried a full erase?
@mrdc commented on GitHub (Jan 9, 2020):
I've tried
#define WM_ERASE_NVSthe same behaviour.Adding
and using
erase(true)gives me an error.At the moment I have only one ESP32 for tests. A new one will be available later this week. Will test my code.
@tablatronix commented on GitHub (Jan 9, 2020):
Hmm try a full erase from arduino ide that should do the same
@pczekalski commented on GitHub (Jan 11, 2020):
Had similar behaviour.
Full erase did the trick (using external tool in VS Code + PlatformIO), not #def...
@Fasic commented on GitHub (Jan 22, 2020):
i have same problem, but after testing i found that using static (ip/gw/sn) it fails to connect, using DHCP it connects, funny part is it gets same ip from DHCP that i try to use as static...idk why, for now i don't need static ip, but i would like to fix this...and best part is it worked on old project, now it doesn't
@tablatronix commented on GitHub (Jan 22, 2020):
Hmm have example code to test?
@Fasic commented on GitHub (Jan 22, 2020):
I will try to make "short" version, tomorrow, now it is few files...or if i don't make to make it, i will put on git (but that would be pain to test for you)
@tablatronix commented on GitHub (Jan 23, 2020):
Ill try the static ip examples and see, you are using development branch correct?
@Fasic commented on GitHub (Jan 23, 2020):
Forget on my comment, i was like debugging for last 2h, and i found out (all works) but in same time, that i am stupid (i didn't plug in mqtt server, that is why i was debugging for 2h)...
For others,
-make sure to update library (i was on 0.14, 0.15 all works fine),
-plus be sure to check did you wipe all flesh contents (i was 100% sure i did it, but i didn't)
all fine all good, sorry for wasting your time DEV
@tablatronix commented on GitHub (Jan 23, 2020):
heh, no problem, I did the same thing the other day, my ide was
lockedto the wrong build file and uploading the same wrong program over and over, NOT the one I was actually testing..