mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #122] Reconnect? #92
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#92
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 @matthuisman on GitHub (Mar 7, 2016).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/122
Just wondering how WiFiManager manages WiFi disconnects.
Does it automatically try to reconnect etc?
@matthuisman commented on GitHub (Mar 7, 2016):
I just tried and it doesn't seem to.
Is there any code to make it re-connect.
I would have this in my loop function
void loop(void){
if (WiFi.status() != WL_CONNECTED) {
disconnects++;
Serial.println("Disconnects: "+String(disconnects));
wifiManager.reconnect() ????
return;
}
server.handleClient();
}
@matthuisman commented on GitHub (Mar 7, 2016):
OK.
Using autoconnect again will not work, as that may start the config portal instead of waiting for Wifi.
So, looks like
wifiManager.connectWifi("","");
would be the way to go.
Oh, that's a private function... Bugger..
Might just need to use
WiFi.begin();
@tzapu commented on GitHub (Mar 7, 2016):
hello,
Usign WiFi.begin() should be fine and work togther with wifi manager.... but... the sdk itself has some auto reconnect functions. it should do it, indifferent of WiFiManager usage, once it s connected
This is my guess, and observations of the esp8266 core and nodes i have online, i have not double checked exactly what is happening behind the scenes
@tablatronix commented on GitHub (Mar 9, 2016):
it is supposed to
Not sure what the sdk default is...
try a
WiFi.getAutoConnect()@hemalchevli commented on GitHub (Apr 5, 2016):
I'm facing a similar problem of not reconnecting after power cycle. I'm using on demand configuration with 18 custom parameters(changed
WIFI_MANAGER_MAX_PARAMSin header).As a work around I'll try adding ssid and password as custom parameters and use the following in loop to reconnect
if(WiFi.status() != WL_CONNECTED){ WiFi.begin(ssid,password); }@tzapu commented on GitHub (Apr 5, 2016):
hi, are you using the latest github version or a release?
@hemalchevli commented on GitHub (Apr 5, 2016):
I downloaded it via PlatformIO library manager, so it must be a release as far as I know.
@tzapu commented on GitHub (Apr 5, 2016):
hi,
jsut released a new version, 0.11 about 1 hour ago.
don t know if it appears on platform io yet. this one has some fixes for connection issues in it
cheers
alex
@hemalchevli commented on GitHub (Apr 5, 2016):
I'll manually download it and copy to it to lib folder and check if the issue still persists.
thanks
Great lib by the way!
Cheers!
@tzapu commented on GitHub (Apr 5, 2016):
thank you very much
@hemalchevli commented on GitHub (Apr 5, 2016):
Okay so I did 10 power cycles, and esp connects every time, and also it does not lose connection with time. Looks like problem solved.
Thanks for the support @tzapu
@tzapu commented on GitHub (Apr 5, 2016):
no problem, thanks for using it and the feedback
this is great news
@Gregauriz commented on GitHub (Sep 20, 2018):
I'm still having a similar issue (not sure it's the right place to put it), It reconnect fine if during the setup it is was able to connect to a wifi (or setup vi the portal have been done). But if during setup nothing is done on the portal and there is no wifi available, there is no way to do a reconnection ? I try to do an autoconnect in the loop but it wasn't able to get a connection because the wifi is in WL_IDLE_STATUS...
So here an example of code :
void setup(){ WiFiManager wifiManager; wifiManager.setConfigPortalTimeout(120); wifiManager.setTimeout(20); wifiManager.autoConnect('XXXXXXXX'); } void loop() { if (WiFi.status() != WL_CONNECTED) { Serial.println("Trying to connected to wifi"); WiFiManager wifiManager; wifiManager.setConfigPortalTimeout(120); wifiManager.setTimeout(20); wifiManager.autoConnect('XXXXXXXX'); } else { // do stuff } }This code give this in the serial :
tarting WifiManager
*WM:
*WM: AutoConnect
*WM: Connecting as wifi client...
*WM: Using last saved values, should be faster
*WM: Connection result:
*WM: 1
*WM:
*WM: Configuring access point...
*WM: XXXXXXXX
*WM: AP IP address:
*WM: 192.168.4.1
*WM: HTTP server started
*WM:
*WM: AutoConnect
*WM: Connecting as wifi client...
*WM: Using last saved values, should be faster
*WM: Connection result:
*WM: 0
*WM:
*WM: Configuring access point...
*WM: XXXXXXXX
*WM: AP IP address:
*WM: 192.168.4.1
*WM: HTTP server started
I hope to clear enouth ! Feel free to correct me if I'm wrong... I tried to add a
WiFi.begin();but didn't change anything, it's stuck in idle mode...And I don't want to reset the all ESP....
@tablatronix commented on GitHub (Sep 20, 2018):
new issue please
@Gregauriz commented on GitHub (Sep 20, 2018):
thanks for your quick anwser here is the issue #738
@fzoccara commented on GitHub (Sep 25, 2018):
Hi @Gregauriz ! thank you very much! this help me a lot..
just one note: "setTimeout" seems to be an alias for "setConfigPortalTimeout" function.
Best.
Francesco.
@tablatronix commented on GitHub (Sep 25, 2018):
Its not an alias, its deprecated
@rodrigok1 commented on GitHub (Jun 8, 2020):
dear All,
Is there any way to find the SSID and password saved by WIFImanger lib?
If so, it will be simple to reconnect in case of a Wi-Fi fall during the program execution.
Can anyone help me or US?
I appreciate!