mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #1826] Question: proper use of autoConnect #1535
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#1535
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 @ChumKiu on GitHub (Jul 24, 2025).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1826
I'm using an ESP32 WROOM32 module, my system can be used away from the WiFi acces point so the connection can be lost, but after some time the module is again into the Access Point range and have to reconnect to the Access Point stored credentials automatically.
Now in my loop() method I handle the reconnection task in this way, but I'm not sure if this is the proper way:
// --------------------------------------------------
// WiFi connection monitor
// If WiFi is down try to reconnect
// --------------------------------------------------
curWiFiMillis = millis();
if ( (WiFi.status() != WL_CONNECTED) &&
(curWiFiMillis - prevWiFiMillis >= WiFiCheckInterval))
{
Serial.println("(Main) Reconnecting to WiFi...");
//WiFi.disconnect();
//WiFi.reconnect();
wm.autoConnect();
prevWiFiMillis = curWiFiMillis;
}
so the expected behavior should be when the Access Point is again available (module is again near the Access Point) the module should be reconnect in automatic way and then I should be able to reconnect it through websocket from the client code that is running on a Raspberry computer board linked to same SSID Wi-Fi network.
I'm using the autoConnect() feature in a proper way or I've to use another approach?
Thanks for clarification.
BR
@jimbo1969 commented on GitHub (Jan 31, 2026):
I have the same question, more-or-less. So I was hoping you found the answer and would share your knowledge. I've been reading the docs to try to figure out if it "checks" for the originally-configured WiFi availability (and reconnects to it) AFTER having previously given up on it and entered "AP mode" with all the captive portal stuff. I don't want a few minutes of downtime of my infrastructure WAP to result in this thing being kicked out until a knowledgeable human intervenes -- I want it to just go back to its already-configured WiFi settings, reconnect, and resume its tasks, so long as there is no client connected to it in AP mode.