[GH-ISSUE #71] AutoConnect does not work all the time #52

Closed
opened 2026-02-28 01:23:07 +03:00 by kerem · 33 comments
Owner

Originally created by @odilonafonso on GitHub (Jan 18, 2016).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/71

I used the example of WiFiManager AutoConnect to connect to my wifi network.
The first time he got in the other can not.
Why that ?
I must disconnect, what am I doing wrong?
The following log made by AutoConnect sketch.
I also tried it with a sketch not based on WiFiManager using directly ESP8266WiFi API, but got the exact same problem:
The first time connecting OK, in the other the connection returns error - sometimes 0, sometimes 4.
Grateful.
AutoConnectLog.txt

Originally created by @odilonafonso on GitHub (Jan 18, 2016). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/71 I used the example of WiFiManager AutoConnect to connect to my wifi network. The first time he got in the other can not. Why that ? I must disconnect, what am I doing wrong? The following log made by AutoConnect sketch. I also tried it with a sketch not based on WiFiManager using directly ESP8266WiFi API, but got the exact same problem: The first time connecting OK, in the other the connection returns error - sometimes 0, sometimes 4. Grateful. [AutoConnectLog.txt](https://github.com/tzapu/WiFiManager/files/94592/AutoConnectLog.txt)
kerem closed this issue 2026-02-28 01:23:07 +03:00
Author
Owner

@r666t commented on GitHub (Jan 18, 2016):

I have the same issue.

<!-- gh-comment-id:172571002 --> @r666t commented on GitHub (Jan 18, 2016): I have the same issue.
Author
Owner

@tzapu commented on GitHub (Jan 19, 2016):

There are a few potential issues that i ve seen similar to this:

  • low quality/ not powerful enough supply
  • using sdk 1.5.0 (install 2.0.0 stable or 2.1.9 rc1 or latest github)
  • router doesn t like esps - i have on that only connects once a day...
  • faulty esp modules
<!-- gh-comment-id:172748206 --> @tzapu commented on GitHub (Jan 19, 2016): There are a few potential issues that i ve seen similar to this: - low quality/ not powerful enough supply - using sdk 1.5.0 (install 2.0.0 stable or 2.1.9 rc1 or latest github) - router doesn t like esps - i have on that only connects once a day... - faulty esp modules
Author
Owner

@aegiacometti commented on GitHub (Jan 19, 2016):

Hello, i have this similar issue since yesterday, previously it was working fine.
I tested the ESP and it seems OK, because i can get connected to WiFi via AT commands.
I have 2 extra things to check.

1.- First the connect time via AT commands is about 3 seconds. But if try the wifiManager it quits instantly witch connect error 0, even with the correct configuration SSI/password. How can i check what is going on? why do not connect? is there an timer wich can be extended to wait a couple of extra seconds?

2.- And second, yestedary i upgraded to Arduino IDE 1.6.7... is that versión verified OK?


edit
ESP core versión 2.0.0
wifimanger 0.5.0

<!-- gh-comment-id:172932446 --> @aegiacometti commented on GitHub (Jan 19, 2016): Hello, i have this similar issue since yesterday, previously it was working fine. I tested the ESP and it seems OK, because i can get connected to WiFi via AT commands. I have 2 extra things to check. 1.- First the connect time via AT commands is about 3 seconds. But if try the wifiManager it quits instantly witch connect error 0, even with the correct configuration SSI/password. How can i check what is going on? why do not connect? is there an timer wich can be extended to wait a couple of extra seconds? 2.- And second, yestedary i upgraded to Arduino IDE 1.6.7... is that versión verified OK? --- edit ESP core versión 2.0.0 wifimanger 0.5.0
Author
Owner

@odilonafonso commented on GitHub (Jan 19, 2016):

I made a little change on the library;
I check if the there is a ssid saved on ESP. If true, I do WiFi.begin() call, without credentials.
Apparently called with no arguments, using existing credentials, it is more efficient.
The code:

/*
 *odi begin
 */
    int wifiMode = WiFi.getMode();
    if ( !(wifiMode == WIFI_STA || wifiMode == WIFI_AP_STA) )
        WiFi.mode(WIFI_STA);
    DEBUG_WM(F("\nWiFi.getMode():"));DEBUG_WM(WiFi.getMode());
    if ( !(ssid.equals("")) ){
        DEBUG_WM(F("Trying to connect with saved credentials..."));
        WiFi.begin();
        int connRes;
        for (int i=0; i<11; i++)
            if ( (connRes = WiFi.waitForConnectResult()) == WL_CONNECTED )
                break;
        DEBUG_WM ("Connection result: ");
        DEBUG_WM ( connRes );
        if (connRes == WL_CONNECTED)
            return true;
    }
/*
 *odi end
 */

into autoConnect() method from WiFiManager.cpp, after line 113
This works for me.

<!-- gh-comment-id:172958415 --> @odilonafonso commented on GitHub (Jan 19, 2016): I made a little change on the library; I check if the there is a ssid saved on ESP. If true, I do `WiFi.begin()` call, without credentials. Apparently called with no arguments, using existing credentials, it is more efficient. The code: ``` /* *odi begin */ int wifiMode = WiFi.getMode(); if ( !(wifiMode == WIFI_STA || wifiMode == WIFI_AP_STA) ) WiFi.mode(WIFI_STA); DEBUG_WM(F("\nWiFi.getMode():"));DEBUG_WM(WiFi.getMode()); if ( !(ssid.equals("")) ){ DEBUG_WM(F("Trying to connect with saved credentials...")); WiFi.begin(); int connRes; for (int i=0; i<11; i++) if ( (connRes = WiFi.waitForConnectResult()) == WL_CONNECTED ) break; DEBUG_WM ("Connection result: "); DEBUG_WM ( connRes ); if (connRes == WL_CONNECTED) return true; } /* *odi end */ ``` into autoConnect() method from WiFiManager.cpp, after line 113 This works for me.
Author
Owner

@odilonafonso commented on GitHub (Jan 19, 2016):

I think the ESP module needs to be "awakened".
If I stop access for a few minutes, so I do a hard reset, I get WL_NOT_CONNECTED (4) and then to give a second hard reset, I get WL_CONNECTED (3)
It is possible to set a greater "timeout" to WiFi.waitForConnectResult() call ?
Where is the low level functions used by the WiFi modules -

wifi_softap_get_config()
wifi_station_get_connect_status()
wifi_get_opmode()
status()
...

and others ?
I searched, but apparently these functions are compiled, must belong to some library included in the link stage.
Without source, without doc... we do not know how to access them.
I found some documentation:
https://github.com/CHERTS/esp8266-devkit/tree/master/Espressif
Can someone confirm that the WiFi libraries hear use this espressif libraries ?
There is a lot of documentation there.

<!-- gh-comment-id:172979888 --> @odilonafonso commented on GitHub (Jan 19, 2016): I think the ESP module needs to be "awakened". If I stop access for a few minutes, so I do a hard reset, I get WL_NOT_CONNECTED (4) and then to give a second hard reset, I get WL_CONNECTED (3) It is possible to set a greater "timeout" to `WiFi.waitForConnectResult()` call ? Where is the low level functions used by the WiFi modules - ``` wifi_softap_get_config() wifi_station_get_connect_status() wifi_get_opmode() status() ... ``` and others ? I searched, but apparently these functions are compiled, must belong to some library included in the link stage. Without source, without doc... we do not know how to access them. I found some documentation: https://github.com/CHERTS/esp8266-devkit/tree/master/Espressif Can someone confirm that the WiFi libraries hear use this espressif libraries ? There is a lot of documentation there.
Author
Owner

@tzapu commented on GitHub (Jan 20, 2016):

the esp8266 core for arduino uses the expressif sdk to build upon. version 1.3 i think in stable and 1.5.1 in latest github

i will experiment with your change and see about adding it

btw, i am doing tests all the time with ssid blank (since i am resetting the settings a lot to test), and this didn t really happen to me at all

i won t be able to release a new version (0.7) until they release esp8266 core 2.1.0 or at least a new rc because i added some new function call, so it may be a while

i am on arduino ide 1.6.6, have not tested with 1.6.7 yet

<!-- gh-comment-id:173097264 --> @tzapu commented on GitHub (Jan 20, 2016): the esp8266 core for arduino uses the expressif sdk to build upon. version 1.3 i think in stable and 1.5.1 in latest github i will experiment with your change and see about adding it btw, i am doing tests all the time with ssid blank (since i am resetting the settings a lot to test), and this didn t really happen to me at all i won t be able to release a new version (0.7) until they release esp8266 core 2.1.0 or at least a new rc because i added some new function call, so it may be a while i am on arduino ide 1.6.6, have not tested with 1.6.7 yet
Author
Owner

@aegiacometti commented on GitHub (Jan 20, 2016):

Update, i quit Arduino IDE 1.6.7, and continue testing with ... (By the way... I'am using an ESP8266-01)

  • Arduino ide 1.6.6. Esp core 2.0.0.
    wifimanager 0.5.0 - OK
    With wifimanager 0.6.0 iam getting the same compile error as this other issue #72. Is something wrong with ESP model?
  • Arduino ide 1.6.5. Esp core 2.0.0.
    wifimanager 0.5.0 - OK
    wifimanager 0.6.0 - OK

BUT, i still have the issue with "Connection result: 0"
I get in wifimanger url and configured again the SSID/Password, and i had "Connection result: 0".
Then i reset the ESP and get "Connection result: 3, connected OK"
The connection process has a wait, because it takes a couple of second to connect. When i get "Connection result: 0" it is displayed at once, no wait.

<!-- gh-comment-id:173313217 --> @aegiacometti commented on GitHub (Jan 20, 2016): Update, i quit Arduino IDE 1.6.7, and continue testing with ... (By the way... I'am using an ESP8266-01) - Arduino ide 1.6.6. Esp core 2.0.0. wifimanager 0.5.0 - OK With wifimanager 0.6.0 iam getting the same compile error as this other issue #72. Is something wrong with ESP model? - Arduino ide 1.6.5. Esp core 2.0.0. wifimanager 0.5.0 - OK wifimanager 0.6.0 - OK BUT, i still have the issue with "Connection result: 0" I get in wifimanger url and configured again the SSID/Password, and i had "Connection result: 0". Then i reset the ESP and get "Connection result: 3, connected OK" The connection process has a wait, because it takes a couple of second to connect. When i get "Connection result: 0" it is displayed at once, no wait.
Author
Owner

@slubb commented on GitHub (Jan 23, 2016):

I have same issue on ESP-12. When connection fails (for example, cable provider resets modem or executes maintenance network) it will no longer connect. It will display connection result:0 and quickly opens a accesspoint. In debugging I do see my Wifi SSID and username and password it doesn't try to connect at all.
I'm now testing the code from odi to see if this will help.

<!-- gh-comment-id:174177003 --> @slubb commented on GitHub (Jan 23, 2016): I have same issue on ESP-12. When connection fails (for example, cable provider resets modem or executes maintenance network) it will no longer connect. It will display connection result:0 and quickly opens a accesspoint. In debugging I do see my Wifi SSID and username and password it doesn't try to connect at all. I'm now testing the code from odi to see if this will help.
Author
Owner

@tzapu commented on GitHub (Jan 25, 2016):

guys, i ve made some changes to the connection code as suggested here and added an example that soft resets if connection is not successful and tries again.
could you give it a try, see if it improves anything for you?

<!-- gh-comment-id:174425754 --> @tzapu commented on GitHub (Jan 25, 2016): guys, i ve made some changes to the connection code as suggested here and added an example that soft resets if connection is not successful and tries again. could you give it a try, see if it improves anything for you?
Author
Owner

@mtnbrit commented on GitHub (Feb 1, 2016):

I found if I have a delay() after serial.begin(), then wifimanager wont connect, this is with latest 2.1.0-rc2 and v0.8.0 of wifimanager. removing delay it works.

<!-- gh-comment-id:178204449 --> @mtnbrit commented on GitHub (Feb 1, 2016): I found if I have a delay() after serial.begin(), then wifimanager wont connect, this is with latest 2.1.0-rc2 and v0.8.0 of wifimanager. removing delay it works.
Author
Owner

@tzapu commented on GitHub (Feb 4, 2016):

btw, if you have that delay, does the config portal get an ip or 0.0.0.0 ?

<!-- gh-comment-id:179710042 --> @tzapu commented on GitHub (Feb 4, 2016): btw, if you have that delay, does the config portal get an ip or 0.0.0.0 ?
Author
Owner

@mtnbrit commented on GitHub (Feb 6, 2016):

Hi, no the AP doesn't start, for me it hung after "Using last saved values, should be faster". Just sits there forever, which is bad because it locked up my sensor project for many hours, no watchdog restart or anything. Its running on a NodeMCU v0.9 powered by a 1A macbook USB port, so I would imaging the power supply is adequate.

<!-- gh-comment-id:180839879 --> @mtnbrit commented on GitHub (Feb 6, 2016): Hi, no the AP doesn't start, for me it hung after "Using last saved values, should be faster". Just sits there forever, which is bad because it locked up my sensor project for many hours, no watchdog restart or anything. Its running on a NodeMCU v0.9 powered by a 1A macbook USB port, so I would imaging the power supply is adequate.
Author
Owner

@tzapu commented on GitHub (Feb 7, 2016):

weird, maybe some more of this weirdness related to connecting will be sorted in 1.5.2 whenever they add it to the arduino core...

<!-- gh-comment-id:180995101 --> @tzapu commented on GitHub (Feb 7, 2016): weird, maybe some more of this weirdness related to connecting will be sorted in 1.5.2 whenever they add it to the arduino core...
Author
Owner

@tzapu commented on GitHub (Feb 7, 2016):

if you can get similar results with a simple sketch with delay and WiFi.begin(...) it may be worth opening a ticket on the arduino core

<!-- gh-comment-id:180995124 --> @tzapu commented on GitHub (Feb 7, 2016): if you can get similar results with a simple sketch with delay and WiFi.begin(...) it may be worth opening a ticket on the arduino core
Author
Owner

@mtnbrit commented on GitHub (Feb 13, 2016):

The issue appears to be that WiFi.waitForConnectResult() can end up in an infinite loop if it can't connect to the AP. So recommend avoiding this call. I built my own while loop including a timeout.

//  int connRes = WiFi.waitForConnectResult();  // this ends up in infinite loop
   while(WiFi.status() == WL_DISCONNECTED && !timeout) {
        delay(200);
    timeout = i++ > 100;
    Serial.print(".");
    }
  if (timeout) {
      DEBUG_WM ("Connection timed out: ");
      return 0;
  }
<!-- gh-comment-id:183588240 --> @mtnbrit commented on GitHub (Feb 13, 2016): The issue appears to be that WiFi.waitForConnectResult() can end up in an infinite loop if it can't connect to the AP. So recommend avoiding this call. I built my own while loop including a timeout. ``` // int connRes = WiFi.waitForConnectResult(); // this ends up in infinite loop while(WiFi.status() == WL_DISCONNECTED && !timeout) { delay(200); timeout = i++ > 100; Serial.print("."); } if (timeout) { DEBUG_WM ("Connection timed out: "); return 0; } ```
Author
Owner

@tzapu commented on GitHub (Feb 13, 2016):

never seen it locking up before i think..
i ll look at the class itself later

does the loop work ok for you?
now i m thinking that maybe waitForConnectResult quits too fast as well causing some issues others are reporting...

<!-- gh-comment-id:183606806 --> @tzapu commented on GitHub (Feb 13, 2016): never seen it locking up before i think.. i ll look at the class itself later does the loop work ok for you? now i m thinking that maybe waitForConnectResult quits too fast as well causing some issues others are reporting...
Author
Owner

@tzapu commented on GitHub (Feb 16, 2016):

i looked at WiFi.waitForConnectResult() and it makes sense to revert to something like your version.
will change it as soon as i can

<!-- gh-comment-id:184570675 --> @tzapu commented on GitHub (Feb 16, 2016): i looked at WiFi.waitForConnectResult() and it makes sense to revert to something like your version. will change it as soon as i can
Author
Owner

@tzapu commented on GitHub (Feb 16, 2016):

@mtnbrit i have added a new option to WiFiManger to set a connect timeout. it uses a loop similar to yours.
in order to use this you d need to update to the latest github version of the lib and call
wifiManager.setConnectTimeout(30);
before autoConnect. time in settings.
if you could give it a try before i release it on lib manager, it would be much appreciated...

<!-- gh-comment-id:184592665 --> @tzapu commented on GitHub (Feb 16, 2016): @mtnbrit i have added a new option to WiFiManger to set a connect timeout. it uses a loop similar to yours. in order to use this you d need to update to the latest github version of the lib and call `wifiManager.setConnectTimeout(30);` before autoConnect. time in settings. if you could give it a try before i release it on lib manager, it would be much appreciated...
Author
Owner

@mtnbrit commented on GitHub (Feb 17, 2016):

Ive noticed that if wifiManager autoConnect is called when wifi is already connected, it wont reconnect and would normally hang up on waitforConnectResult. Now i have the timeout in there, it times out.

So its up the user to check if wifi.status is connected before calling wifiManager autoConnect, or I could suggest including a WiFi.isConnected() check early on the autoConnect function to return if we are already connected.

<!-- gh-comment-id:185390473 --> @mtnbrit commented on GitHub (Feb 17, 2016): Ive noticed that if wifiManager autoConnect is called when wifi is already connected, it wont reconnect and would normally hang up on waitforConnectResult. Now i have the timeout in there, it times out. So its up the user to check if wifi.status is connected before calling wifiManager autoConnect, or I could suggest including a WiFi.isConnected() check early on the autoConnect function to return if we are already connected.
Author
Owner

@tzapu commented on GitHub (Feb 18, 2016):

that s a bit of a weird behaviour as in the main WIFI class, if configuration doesn t change, it just returns..

if(sta_config_equal(current_conf, conf)) {
        DEBUGV("sta config unchanged");
        return status();
}

also the loop checks if connected

 if (status == WL_CONNECTED || status == WL_CONNECT_FAILED) {
        keepConnecting = false;
 }

so it should return immediately, as you are already connected...
i think somehow your configuration drives it to run around in circles
i will try to make some simplified test sketches that we could use to report issues to main esp8266 core
cheers

<!-- gh-comment-id:185560285 --> @tzapu commented on GitHub (Feb 18, 2016): that s a bit of a weird behaviour as in the main WIFI class, if configuration doesn t change, it just returns.. ``` if(sta_config_equal(current_conf, conf)) { DEBUGV("sta config unchanged"); return status(); } ``` also the loop checks if connected ``` if (status == WL_CONNECTED || status == WL_CONNECT_FAILED) { keepConnecting = false; } ``` so it should return immediately, as you are already connected... i think somehow your configuration drives it to run around in circles i will try to make some simplified test sketches that we could use to report issues to main esp8266 core cheers
Author
Owner

@tzapu commented on GitHub (Feb 18, 2016):

you might want to enable debug in the arduino menu and see all the core s debug messages, maybe there s some hints there about what s happening in your case

<!-- gh-comment-id:185560401 --> @tzapu commented on GitHub (Feb 18, 2016): you might want to enable debug in the arduino menu and see all the core s debug messages, maybe there s some hints there about what s happening in your case
Author
Owner

@tzapu commented on GitHub (Mar 8, 2016):

hi, i ve just made another commit to this, could you please try the github version of WiFiManager and see if anything changed for you?

<!-- gh-comment-id:193619008 --> @tzapu commented on GitHub (Mar 8, 2016): hi, i ve just made another commit to this, could you please try the github version of WiFiManager and see if anything changed for you?
Author
Owner

@gitgrimbo commented on GitHub (May 11, 2016):

My ESP8266 also locks up after these lines are printed, running AutoConnectWithFeedback example:

*WM: 
*WM: AutoConnect
*WM: Connecting as wifi client...
*WM: Using last saved values, should be faster
  • Arduino IDE 1.6.7
  • ESP8266 2.2.0 (via IDE's Boards Manager)
  • WifiManager 0.10.0 (via IDE's Library Manager)
<!-- gh-comment-id:218386962 --> @gitgrimbo commented on GitHub (May 11, 2016): My ESP8266 also locks up after these lines are printed, running `AutoConnectWithFeedback` example: ``` *WM: *WM: AutoConnect *WM: Connecting as wifi client... *WM: Using last saved values, should be faster ``` - Arduino IDE 1.6.7 - ESP8266 2.2.0 (via IDE's Boards Manager) - WifiManager 0.10.0 (via IDE's Library Manager)
Author
Owner

@kentaylor commented on GitHub (May 12, 2016):

Does it fail every time or just some times? Your messages show that it is failing in the autoconnect function. Try the version of WiFiManager at https://github.com/kentaylor/WiFiManager/ which specifically aims to fix the issue of "AutoConnect does not work all the time" and has some other changes as detailed.

<!-- gh-comment-id:218732475 --> @kentaylor commented on GitHub (May 12, 2016): Does it fail every time or just some times? Your messages show that it is failing in the autoconnect function. Try the version of WiFiManager at https://github.com/kentaylor/WiFiManager/ which specifically aims to fix the issue of "AutoConnect does not work all the time" and has some other changes as detailed.
Author
Owner

@odilonafonso commented on GitHub (Jun 1, 2016):

Hi guys... @tzapu, @adrianchi, @gitgrimbo, @mtnbrit

After a few months in other activities, I tested today WM library after updating the SDK to version 2.2.0.

It worked very well!

I can now close this issue?

<!-- gh-comment-id:222870474 --> @odilonafonso commented on GitHub (Jun 1, 2016): Hi guys... @tzapu, @adrianchi, @gitgrimbo, @mtnbrit After a few months in other activities, I tested today WM library after updating the SDK to version 2.2.0. It worked very well! I can now close this issue?
Author
Owner

@apicquot commented on GitHub (Jul 31, 2016):

Hello, I am having the same problem with the 2.3.0 version. Has anyone the definitive solution ?
I have played with the WiFi.begin() without attributes, I have replaced WiFi.waitForConnectResult() with my own waiting loop. I have tried to switch the mode to WIFI_OFF and then back to WIFI_STA.

  • The device connects fine after a hard reset
  • It connects fine in the event of a button reset
  • It fails to connect after a deep sleep
  • After a few failed connections, the device even crashes with the message "ets Jan 8 2013,rst cause:2, boot mode:(3,6)"

Any help very welcome.

<!-- gh-comment-id:236398728 --> @apicquot commented on GitHub (Jul 31, 2016): Hello, I am having the same problem with the 2.3.0 version. Has anyone the definitive solution ? I have played with the WiFi.begin() without attributes, I have replaced WiFi.waitForConnectResult() with my own waiting loop. I have tried to switch the mode to WIFI_OFF and then back to WIFI_STA. - The device connects fine after a hard reset - It connects fine in the event of a button reset - It fails to connect after a deep sleep - After a few failed connections, the device even crashes with the message "ets Jan 8 2013,rst cause:2, boot mode:(3,6)" Any help very welcome.
Author
Owner

@apicquot commented on GitHub (Jul 31, 2016):

Some more information: the error after WiFi.waitForConnectResult() is WL_NO_SSID_AVAIL. So I tried to scan for networks after a failure, WiFi does not find any networks...

I have tried in Setup():
ESP.eraseConfig(); WiFi.persistent(false); WiFi.disconnect();

It did not solve the problem and curiously WiFi still knew about the nework's ssid, does it mean that the persistence is still on ?

Any help very welcome.

<!-- gh-comment-id:236403342 --> @apicquot commented on GitHub (Jul 31, 2016): Some more information: the error after WiFi.waitForConnectResult() is WL_NO_SSID_AVAIL. So I tried to scan for networks after a failure, WiFi does not find any networks... I have tried in Setup(): `ESP.eraseConfig(); WiFi.persistent(false); WiFi.disconnect();` It did not solve the problem and curiously WiFi still knew about the nework's ssid, does it mean that the persistence is still on ? Any help very welcome.
Author
Owner

@tzapu commented on GitHub (Jul 31, 2016):

hi,

you mentioned deep sleep, are you using RF_DISABLE or any paramenters to the sleep function?

i have found that you can t properly awake the wifi unless you do another deep sleep cycle with RF enabled. but this was some time ago...

cheers

<!-- gh-comment-id:236422610 --> @tzapu commented on GitHub (Jul 31, 2016): hi, you mentioned deep sleep, are you using RF_DISABLE or any paramenters to the sleep function? i have found that you can t properly awake the wifi unless you do another deep sleep cycle with RF enabled. but this was some time ago... cheers
Author
Owner

@apicquot commented on GitHub (Jul 31, 2016):

Your are absolutely right, I am using ESP.deepSleep(5000000, WAKE_RF_DEFAULT) which is the cause of my trouble. Everything works great with ESP.deepSleep(5000000, WAKE_RF_DEFAULT)

I assumed wrongly that the rf will be turned on after a reset. Thank you for you help tzapu.

<!-- gh-comment-id:236423333 --> @apicquot commented on GitHub (Jul 31, 2016): Your are absolutely right, I am using `ESP.deepSleep(5000000, WAKE_RF_DEFAULT)` which is the cause of my trouble. Everything works great with `ESP.deepSleep(5000000, WAKE_RF_DEFAULT)` I assumed wrongly that the rf will be turned on after a reset. Thank you for you help tzapu.
Author
Owner

@kevcavein commented on GitHub (Sep 13, 2018):

Hi I recently just started testing in esp deepsleep and I found that sometimes my nodemcu wakeup after deep sleep it cannot connect to the WiFi and start the ap.
It sometimes happen during the second wakeup, sometimes happen after one hour and even sometimes happen after 12hrs. I'm very new to Arduino and I'm not sure what is wrong.
I'm using the latest wifimanager and from sketch from tzapu samples.
Does Wake_Rf_Default solve the issue?

Sorry if I post on the wrong treat.

<!-- gh-comment-id:420931203 --> @kevcavein commented on GitHub (Sep 13, 2018): Hi I recently just started testing in esp deepsleep and I found that sometimes my nodemcu wakeup after deep sleep it cannot connect to the WiFi and start the ap. It sometimes happen during the second wakeup, sometimes happen after one hour and even sometimes happen after 12hrs. I'm very new to Arduino and I'm not sure what is wrong. I'm using the latest wifimanager and from sketch from tzapu samples. Does Wake_Rf_Default solve the issue? Sorry if I post on the wrong treat.
Author
Owner

@tablatronix commented on GitHub (Sep 13, 2018):

This issue is 2 years old open a new ine

<!-- gh-comment-id:420977857 --> @tablatronix commented on GitHub (Sep 13, 2018): This issue is 2 years old open a new ine
Author
Owner

@EgHubs commented on GitHub (Nov 27, 2020):

I found if I have a delay() after serial.begin(), then wifimanager wont connect, this is with latest 2.1.0-rc2 and v0.8.0 of wifimanager. removing delay it works.

You saved my life!.
I've been trying with the default code of AutoConnectWithFSParamtersAndCustomIP for 2 years now and the code sometimes connects and a lot of others it doesn't, I was just keeping on pressing reset till it connects, after I deleted the delay line it connects every time just the moment I click on reset.
thank you, I just don't know why that delay line exists!, does it works with others!? I may have tried with more than 5 ESP8266-12 and with 2 NODE-MCU and it does that in all of them, I hope they update the library.

<!-- gh-comment-id:734871712 --> @EgHubs commented on GitHub (Nov 27, 2020): > I found if I have a delay() after serial.begin(), then wifimanager wont connect, this is with latest 2.1.0-rc2 and v0.8.0 of wifimanager. removing delay it works. You saved my life!. I've been trying with the default code of AutoConnectWithFSParamtersAndCustomIP for 2 years now and the code sometimes connects and a lot of others it doesn't, I was just keeping on pressing reset till it connects, after I deleted the delay line it connects every time just the moment I click on reset. thank you, I just don't know why that delay line exists!, does it works with others!? I may have tried with more than 5 ESP8266-12 and with 2 NODE-MCU and it does that in all of them, I hope they update the library.
Author
Owner

@VietVan9499 commented on GitHub (May 15, 2021):

the esp8266 core for arduino uses the expressif sdk to build upon. version 1.3 i think in stable and 1.5.1 in latest github

i will experiment with your change and see about adding it

btw, i am doing tests all the time with ssid blank (since i am resetting the settings a lot to test), and this didn t really happen to me at all

i won t be able to release a new version (0.7) until they release esp8266 core 2.1.0 or at least a new rc because i added some new function call, so it may be a while

i am on arduino ide 1.6.6, have not tested with 1.6.7 yet

hi,

you mentioned deep sleep, are you using RF_DISABLE or any paramenters to the sleep function?

i have found that you can t properly awake the wifi unless you do another deep sleep cycle with RF enabled. but this was some time ago...

cheers

hello tzapu!!! I thank you for contributing so much to the community!!! i have a problem with your wifimanager library, the problem i have is: initially if i don't have wifi at home then my ESP's hardware codes won't work, because i can't access the loop, because you stay at the wifi connection

<!-- gh-comment-id:841695939 --> @VietVan9499 commented on GitHub (May 15, 2021): > the esp8266 core for arduino uses the expressif sdk to build upon. version 1.3 i think in stable and 1.5.1 in latest github > > i will experiment with your change and see about adding it > > btw, i am doing tests all the time with ssid blank (since i am resetting the settings a lot to test), and this didn t really happen to me at all > > i won t be able to release a new version (0.7) until they release esp8266 core 2.1.0 or at least a new rc because i added some new function call, so it may be a while > > i am on arduino ide 1.6.6, have not tested with 1.6.7 yet > hi, > > you mentioned deep sleep, are you using RF_DISABLE or any paramenters to the sleep function? > > i have found that you can t properly awake the wifi unless you do another deep sleep cycle with RF enabled. but this was some time ago... > > cheers hello tzapu!!! I thank you for contributing so much to the community!!! i have a problem with your wifimanager library, the problem i have is: initially if i don't have wifi at home then my ESP's hardware codes won't work, because i can't access the loop, because you stay at the wifi connection
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#52
No description provided.