[GH-ISSUE #1540] Error in setConnectTimeout() #1314

Closed
opened 2026-02-28 01:29:32 +03:00 by kerem · 24 comments
Owner

Originally created by @rritzi on GitHub (Jan 2, 2023).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1540

even if i set _connectTimeout ,my programme keeps handing in the loop and doesnot comeout of it.

Originally created by @rritzi on GitHub (Jan 2, 2023). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1540 even if i set _connectTimeout ,my programme keeps handing in the loop and doesnot comeout of it.
kerem 2026-02-28 01:29:32 +03:00
Author
Owner

@danielminson commented on GitHub (Mar 22, 2023):

I also have this problem

<!-- gh-comment-id:1480107304 --> @danielminson commented on GitHub (Mar 22, 2023): I also have this problem
Author
Owner

@tablatronix commented on GitHub (Mar 22, 2023):

captiveportaltimeout

<!-- gh-comment-id:1480130908 --> @tablatronix commented on GitHub (Mar 22, 2023): captiveportaltimeout
Author
Owner

@danielminson commented on GitHub (Mar 22, 2023):

Please give a more comprehensive answer. When I try setting wifimanager.setConnectTimeout(30), for example, it simple does not set the value. The debugging says that it is not set.
image

<!-- gh-comment-id:1480148457 --> @danielminson commented on GitHub (Mar 22, 2023): Please give a more comprehensive answer. When I try setting wifimanager.setConnectTimeout(30), for example, it simple does not set the value. The debugging says that it is not set. <img width="533" alt="image" src="https://user-images.githubusercontent.com/49560569/227017176-b8dfca9d-0aa9-46cc-a5fe-9cea0cd30558.png">
Author
Owner

@tablatronix commented on GitHub (Mar 23, 2023):

sorry you said comeout and I thought you wanted the other timeout to abort the loop.

hmm, that should be working for wifi timeout..

Is your esp getting stuck here for 60seconds? This is a new ESP bug we are looking into.
But connecttimeout should be working, what version you using ?

And is this on autoconnect or wifisave?

<!-- gh-comment-id:1480420186 --> @tablatronix commented on GitHub (Mar 23, 2023): sorry you said comeout and I thought you wanted the other timeout to abort the loop. hmm, that should be working for wifi timeout.. Is your esp getting stuck here for 60seconds? This is a new ESP bug we are looking into. But connecttimeout should be working, what version you using ? And is this on autoconnect or wifisave?
Author
Owner

@tablatronix commented on GitHub (Mar 23, 2023):

It looks like github.com/tzapu/WiFiManager@701d58fd07 introduced this, but this bug is old, but now the connection code is using NEW all the time as a workaround for esp32 wifiinit #1439

<!-- gh-comment-id:1480431179 --> @tablatronix commented on GitHub (Mar 23, 2023): It looks like https://github.com/tzapu/WiFiManager/commit/701d58fd0751f27008a3851ae5bd73d79ed50a17 introduced this, but this bug is old, but now the connection code is using NEW all the time as a workaround for esp32 wifiinit #1439
Author
Owner

@danielminson commented on GitHub (Mar 23, 2023):

This is on autoconnect and it is getting stuck for 60 seconds before saying that the new WiFi connection failed (because of wrong password). I am using latest release(2.0.15-rc.1).

<!-- gh-comment-id:1481005262 --> @danielminson commented on GitHub (Mar 23, 2023): This is on autoconnect and it is getting stuck for 60 seconds before saying that the new WiFi connection failed (because of wrong password). I am using latest release(2.0.15-rc.1).
Author
Owner

@tablatronix commented on GitHub (Mar 23, 2023):

thanks, I already fixed it. But the esp lib has a bug also. Can you post logs I am working on fixing the ESP bug also

<!-- gh-comment-id:1481179863 --> @tablatronix commented on GitHub (Mar 23, 2023): thanks, I already fixed it. But the esp lib has a bug also. Can you post logs I am working on fixing the ESP bug also
Author
Owner

@danielminson commented on GitHub (Mar 23, 2023):

You fixed it for esp32? What logs do you need?

<!-- gh-comment-id:1481183617 --> @danielminson commented on GitHub (Mar 23, 2023): You fixed it for esp32? What logs do you need?
Author
Owner

@tablatronix commented on GitHub (Mar 23, 2023):

Sorry, Are you using 8266 or esp32? It should be fixed on both I think.

Any serial logs will be useful.

I need to know the esp logs during the 60seconds of retry, specifically the arduino wifi event error

<!-- gh-comment-id:1481188538 --> @tablatronix commented on GitHub (Mar 23, 2023): Sorry, Are you using 8266 or esp32? It should be fixed on both I think. Any serial logs will be useful. I need to know the esp logs during the 60seconds of retry, specifically the arduino wifi event error
Author
Owner

@danielminson commented on GitHub (Mar 23, 2023):

I am using esp32. How should I get this log? Is there any line of code you can provide me?

<!-- gh-comment-id:1481190531 --> @danielminson commented on GitHub (Mar 23, 2023): I am using esp32. How should I get this log? Is there any line of code you can provide me?
Author
Owner

@tablatronix commented on GitHub (Mar 23, 2023):

umm if you are using arduino you can enable debugging in the menu I think

<!-- gh-comment-id:1481192423 --> @tablatronix commented on GitHub (Mar 23, 2023): umm if you are using arduino you can enable debugging in the menu I think
Author
Owner

@danielminson commented on GitHub (Mar 23, 2023):

I am using platformio.

<!-- gh-comment-id:1481193589 --> @danielminson commented on GitHub (Mar 23, 2023): I am using platformio.
Author
Owner

@tablatronix commented on GitHub (Mar 23, 2023):

ah you can add to your ini/env

build_flags = -DWM_DEBUG_LEVEL=4 -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DCORE_DEBUG_LEVEL=5

and add Serial.debugOutput(true); to code

<!-- gh-comment-id:1481311578 --> @tablatronix commented on GitHub (Mar 23, 2023): ah you can add to your ini/env `build_flags = -DWM_DEBUG_LEVEL=4 -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DCORE_DEBUG_LEVEL=5` and add `Serial.debugOutput(true);` to code
Author
Owner

@danielminson commented on GitHub (Mar 27, 2023):

I did it. Cleaned the ESP32 and then put the wrong password for a Wi-Fi network. Here is the debug.

[ 74821][E][WebServer.cpp:649] _handleRequest(): request handler not found
[MEM] free: 241724 | max: 45044 | frag: 82%
*wm:[4] -> captive.apple.com
[MEM] free: 241916 | max: 45044 | frag: 82%
*wm:[2] <- Request redirected to captive portal
[ 74849][W][WebServer.cpp:436] send(): content length is zero
[ 74893][V][WebServer.cpp:296] handleClient(): New client: client.localIP()=192.168.4.1
[ 74894][V][Parsing.cpp:122] _parseRequest(): method: GET url: / search:
[ 74896][V][Parsing.cpp:226] _parseRequest(): headerName: Host
[ 74902][V][Parsing.cpp:227] _parseRequest(): headerValue: 192.168.4.1
[ 74908][V][Parsing.cpp:226] _parseRequest(): headerName: Connection
[ 74914][V][Parsing.cpp:227] _parseRequest(): headerValue: close
[ 74920][V][Parsing.cpp:226] _parseRequest(): headerName: User-Agent
[ 74926][V][Parsing.cpp:227] _parseRequest(): headerValue: CaptiveNetworkSupport-443.40.1 wispr
[ 74934][V][Parsing.cpp:254] _parseArguments(): args:
[ 74939][V][Parsing.cpp:237] _parseRequest(): Request: /
[ 74944][V][Parsing.cpp:238] _parseRequest(): Arguments:
[MEM] free: 241940 | max: 45044 | frag: 82%
*wm:[2] <- HTTP Root
[MEM] free: 241872 | max: 45044 | frag: 82%
*wm:[4] -> 192.168.4.1
[MEM] free: 237860 | max: 45044 | frag: 82%
*wm:[3] [WIFI] reportStatus prev: WL_NO_SSID_AVAIL
[MEM] free: 237872 | max: 45044 | frag: 82%
wm:[3] [WIFI] reportStatus current: WL_DISCONNECTED
[MEM] free: 230200 | max: 45044 | frag: 81%
wm:[2] Scan is cached 682 ms ago
[ 76436][V][WebServer.cpp:296] handleClient(): New client: client.localIP()=192.168.4.1
[ 81440][V][WebServer.cpp:296] handleClient(): New client: client.localIP()=192.168.4.1
[ 81441][V][Parsing.cpp:122] _parseRequest(): method: POST url: /wifisave search:
[ 81445][V][Parsing.cpp:154] _parseRequest(): headerName: Host
[ 81450][V][Parsing.cpp:155] _parseRequest(): headerValue: 192.168.4.1
[ 81456][V][Parsing.cpp:154] _parseRequest(): headerName: Origin
[ 81462][V][Parsing.cpp:155] _parseRequest(): headerValue: http://192.168.4.1
[ 81469][V][Parsing.cpp:154] _parseRequest(): headerName: Content-Type
[ 81475][V][Parsing.cpp:155] _parseRequest(): headerValue: application/x-www-form-urlencoded
[ 81483][V][Parsing.cpp:154] _parseRequest(): headerName: Accept-Encoding
[ 81490][V][Parsing.cpp:155] _parseRequest(): headerValue: gzip, deflate
[ 81496][V][Parsing.cpp:154] _parseRequest(): headerName: Connection
[ 81502][V][Parsing.cpp:155] _parseRequest(): headerValue: keep-alive
[ 81509][V][Parsing.cpp:154] _parseRequest(): headerName: Upgrade-Insecure-Requests
[ 81516][V][Parsing.cpp:155] _parseRequest(): headerValue: 1
[ 81521][V][Parsing.cpp:154] _parseRequest(): headerName: Accept
[ 81527][V][Parsing.cpp:155] _parseRequest(): headerValue: text/html,application/xhtml+xml,application/xml;q=0.9,
/
;q=0.8
[ 81538][V][Parsing.cpp:154] _parseRequest(): headerName: User-Agent
[ 81544][V][Parsing.cpp:155] _parseRequest(): headerValue: Mozilla/5.0 (iPhone; CPU iPhone OS 16_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
[ 81559][V][Parsing.cpp:154] _parseRequest(): headerName: Referer
[ 81564][V][Parsing.cpp:155] _parseRequest(): headerValue: http://192.168.4.1/wifi?refresh=1
[ 81573][V][Parsing.cpp:154] _parseRequest(): headerName: Content-Length
[ 81579][V][Parsing.cpp:155] _parseRequest(): headerValue: 17
[ 81585][V][Parsing.cpp:154] _parseRequest(): headerName: Accept-Language
[ 81591][V][Parsing.cpp:155] _parseRequest(): headerValue: en-GB,en-US;q=0.9,en;q=0.8
[ 81599][V][Parsing.cpp:254] _parseArguments(): args: s=Rover&p=wubdbwb
[ 81605][V][Parsing.cpp:272] _parseArguments(): args count: 2
[ 81610][V][Parsing.cpp:280] _parseArguments(): pos 0 =@1 &@7
[ 81616][V][Parsing.cpp:291] _parseArguments(): arg 0 key: s value: Rover
[ 81622][V][Parsing.cpp:280] _parseArguments(): pos 8 =@9 &@-1
[ 81628][V][Parsing.cpp:291] _parseArguments(): arg 1 key: p value: wubdbwb
[ 81635][V][Parsing.cpp:298] _parseArguments(): args count: 2
[ 81640][V][Parsing.cpp:197] _parseRequest(): Plain: s=Rover&p=wubdbwb
[ 81646][V][Parsing.cpp:237] _parseRequest(): Request: /wifisave
[ 81652][V][Parsing.cpp:238] _parseRequest(): Arguments: s=Rover&p=wubdbwb
[MEM] free: 241508 | max: 45044 | frag: 82%
*wm:[2] <- HTTP WiFi save
[MEM] free: 241508 | max: 45044 | frag: 82%
*wm:[3] Method: POST
[MEM] free: 226700 | max: 45044 | frag: 81%
*wm:[3] Sent wifi save page
[MEM] free: 231924 | max: 45044 | frag: 81%
*wm:[2] processing save
[MEM] free: 243036 | max: 45044 | frag: 82%
*wm:[2] Connecting as wifi client...
[MEM] free: 243036 | max: 45044 | frag: 82%
*wm:[3] STA static IP:
[MEM] free: 243036 | max: 45044 | frag: 82%
*wm:[2] setSTAConfig static ip not set, skipping
[MEM] free: 243012 | max: 45044 | frag: 82%
*wm:[1] Connecting to NEW AP: Rover
[MEM] free: 243036 | max: 45044 | frag: 82%
*wm:[3] Using Password: wubdbwb
[MEM] free: 243036 | max: 45044 | frag: 82%
*wm:[3] WiFi_enableSTA enable
[ 83739][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
[MEM] free: 242804 | max: 45044 | frag: 82%
*wm:[1] connectTimeout not set, ESP waitForConnectResult...
[ 88638][V][WiFiGeneric.cpp:360] _arduino_event_cb(): STA Disconnected: SSID: Rover, BSSID: 24:5a:4c:2a:86:59, Reason: 15
[ 88639][D][WiFiGeneric.cpp:929] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
[ 88646][W][WiFiGeneric.cpp:950] _eventCallback(): Reason: 15 - 4WAY_HANDSHAKE_TIMEOUT
[MEM] free: 242408 | max: 45044 | frag: 82%
*wm:[2] [EVENT] WIFI_REASON: 15

The code:

#include <Arduino.h>
#include <WiFi.h>
#include <WiFiManager.h>

void setup() {
// Initialize serial communication
Serial.begin(115200);
Serial.setDebugOutput(true);
// Initialize WiFiManager with a timeout of 15 seconds
WiFiManager wifiManager;
wifiManager.setConnectTimeout(15);

// Uncomment the following line to reset saved settings and erase previous WiFi configuration
//wifiManager.resetSettings();

// Connect to WiFi or start the configuration portal
if (!wifiManager.autoConnect("ESP32")) {
Serial.println("Failed to connect to WiFi and hit timeout");
delay(3000);
// Reset and try again
ESP.restart();
}

// Print the current IP address
Serial.println("Connected to WiFi!");
Serial.print("IP Address: ");
Serial.println(WiFi.localIP());
}

void loop() {
// Your code here
}

<!-- gh-comment-id:1485771890 --> @danielminson commented on GitHub (Mar 27, 2023): I did it. Cleaned the ESP32 and then put the wrong password for a Wi-Fi network. Here is the debug. [ 74821][E][WebServer.cpp:649] _handleRequest(): request handler not found [MEM] free: 241724 | max: 45044 | frag: 82% *wm:[4] -> captive.apple.com [MEM] free: 241916 | max: 45044 | frag: 82% *wm:[2] <- Request redirected to captive portal [ 74849][W][WebServer.cpp:436] send(): content length is zero [ 74893][V][WebServer.cpp:296] handleClient(): New client: client.localIP()=192.168.4.1 [ 74894][V][Parsing.cpp:122] _parseRequest(): method: GET url: / search: [ 74896][V][Parsing.cpp:226] _parseRequest(): headerName: Host [ 74902][V][Parsing.cpp:227] _parseRequest(): headerValue: 192.168.4.1 [ 74908][V][Parsing.cpp:226] _parseRequest(): headerName: Connection [ 74914][V][Parsing.cpp:227] _parseRequest(): headerValue: close [ 74920][V][Parsing.cpp:226] _parseRequest(): headerName: User-Agent [ 74926][V][Parsing.cpp:227] _parseRequest(): headerValue: CaptiveNetworkSupport-443.40.1 wispr [ 74934][V][Parsing.cpp:254] _parseArguments(): args: [ 74939][V][Parsing.cpp:237] _parseRequest(): Request: / [ 74944][V][Parsing.cpp:238] _parseRequest(): Arguments: [MEM] free: 241940 | max: 45044 | frag: 82% *wm:[2] <- HTTP Root [MEM] free: 241872 | max: 45044 | frag: 82% *wm:[4] -> 192.168.4.1 [MEM] free: 237860 | max: 45044 | frag: 82% *wm:[3] [WIFI] reportStatus prev: WL_NO_SSID_AVAIL [MEM] free: 237872 | max: 45044 | frag: 82% *wm:[3] [WIFI] reportStatus current: WL_DISCONNECTED [MEM] free: 230200 | max: 45044 | frag: 81% *wm:[2] Scan is cached 682 ms ago [ 76436][V][WebServer.cpp:296] handleClient(): New client: client.localIP()=192.168.4.1 [ 81440][V][WebServer.cpp:296] handleClient(): New client: client.localIP()=192.168.4.1 [ 81441][V][Parsing.cpp:122] _parseRequest(): method: POST url: /wifisave search: [ 81445][V][Parsing.cpp:154] _parseRequest(): headerName: Host [ 81450][V][Parsing.cpp:155] _parseRequest(): headerValue: 192.168.4.1 [ 81456][V][Parsing.cpp:154] _parseRequest(): headerName: Origin [ 81462][V][Parsing.cpp:155] _parseRequest(): headerValue: http://192.168.4.1 [ 81469][V][Parsing.cpp:154] _parseRequest(): headerName: Content-Type [ 81475][V][Parsing.cpp:155] _parseRequest(): headerValue: application/x-www-form-urlencoded [ 81483][V][Parsing.cpp:154] _parseRequest(): headerName: Accept-Encoding [ 81490][V][Parsing.cpp:155] _parseRequest(): headerValue: gzip, deflate [ 81496][V][Parsing.cpp:154] _parseRequest(): headerName: Connection [ 81502][V][Parsing.cpp:155] _parseRequest(): headerValue: keep-alive [ 81509][V][Parsing.cpp:154] _parseRequest(): headerName: Upgrade-Insecure-Requests [ 81516][V][Parsing.cpp:155] _parseRequest(): headerValue: 1 [ 81521][V][Parsing.cpp:154] _parseRequest(): headerName: Accept [ 81527][V][Parsing.cpp:155] _parseRequest(): headerValue: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 [ 81538][V][Parsing.cpp:154] _parseRequest(): headerName: User-Agent [ 81544][V][Parsing.cpp:155] _parseRequest(): headerValue: Mozilla/5.0 (iPhone; CPU iPhone OS 16_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [ 81559][V][Parsing.cpp:154] _parseRequest(): headerName: Referer [ 81564][V][Parsing.cpp:155] _parseRequest(): headerValue: http://192.168.4.1/wifi?refresh=1 [ 81573][V][Parsing.cpp:154] _parseRequest(): headerName: Content-Length [ 81579][V][Parsing.cpp:155] _parseRequest(): headerValue: 17 [ 81585][V][Parsing.cpp:154] _parseRequest(): headerName: Accept-Language [ 81591][V][Parsing.cpp:155] _parseRequest(): headerValue: en-GB,en-US;q=0.9,en;q=0.8 [ 81599][V][Parsing.cpp:254] _parseArguments(): args: s=Rover&p=wubdbwb [ 81605][V][Parsing.cpp:272] _parseArguments(): args count: 2 [ 81610][V][Parsing.cpp:280] _parseArguments(): pos 0 =@1 &@7 [ 81616][V][Parsing.cpp:291] _parseArguments(): arg 0 key: s value: Rover [ 81622][V][Parsing.cpp:280] _parseArguments(): pos 8 =@9 &@-1 [ 81628][V][Parsing.cpp:291] _parseArguments(): arg 1 key: p value: wubdbwb [ 81635][V][Parsing.cpp:298] _parseArguments(): args count: 2 [ 81640][V][Parsing.cpp:197] _parseRequest(): Plain: s=Rover&p=wubdbwb [ 81646][V][Parsing.cpp:237] _parseRequest(): Request: /wifisave [ 81652][V][Parsing.cpp:238] _parseRequest(): Arguments: s=Rover&p=wubdbwb [MEM] free: 241508 | max: 45044 | frag: 82% *wm:[2] <- HTTP WiFi save [MEM] free: 241508 | max: 45044 | frag: 82% *wm:[3] Method: POST [MEM] free: 226700 | max: 45044 | frag: 81% *wm:[3] Sent wifi save page [MEM] free: 231924 | max: 45044 | frag: 81% *wm:[2] processing save [MEM] free: 243036 | max: 45044 | frag: 82% *wm:[2] Connecting as wifi client... [MEM] free: 243036 | max: 45044 | frag: 82% *wm:[3] STA static IP: [MEM] free: 243036 | max: 45044 | frag: 82% *wm:[2] setSTAConfig static ip not set, skipping [MEM] free: 243012 | max: 45044 | frag: 82% *wm:[1] Connecting to NEW AP: Rover [MEM] free: 243036 | max: 45044 | frag: 82% *wm:[3] Using Password: wubdbwb [MEM] free: 243036 | max: 45044 | frag: 82% *wm:[3] WiFi_enableSTA enable [ 83739][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0 [MEM] free: 242804 | max: 45044 | frag: 82% *wm:[1] connectTimeout not set, ESP waitForConnectResult... [ 88638][V][WiFiGeneric.cpp:360] _arduino_event_cb(): STA Disconnected: SSID: Rover, BSSID: 24:5a:4c:2a:86:59, Reason: 15 [ 88639][D][WiFiGeneric.cpp:929] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED [ 88646][W][WiFiGeneric.cpp:950] _eventCallback(): Reason: 15 - 4WAY_HANDSHAKE_TIMEOUT [MEM] free: 242408 | max: 45044 | frag: 82% *wm:[2] [EVENT] WIFI_REASON: 15 # The code: #include <Arduino.h> #include <WiFi.h> #include <WiFiManager.h> void setup() { // Initialize serial communication Serial.begin(115200); Serial.setDebugOutput(true); // Initialize WiFiManager with a timeout of 15 seconds WiFiManager wifiManager; wifiManager.setConnectTimeout(15); // Uncomment the following line to reset saved settings and erase previous WiFi configuration //wifiManager.resetSettings(); // Connect to WiFi or start the configuration portal if (!wifiManager.autoConnect("ESP32")) { Serial.println("Failed to connect to WiFi and hit timeout"); delay(3000); // Reset and try again ESP.restart(); } // Print the current IP address Serial.println("Connected to WiFi!"); Serial.print("IP Address: "); Serial.println(WiFi.localIP()); } void loop() { // Your code here }
Author
Owner

@tablatronix commented on GitHub (Mar 27, 2023):

oh so you dont have this issue with correct password ever? I guess this is the same issue, should be working for now

<!-- gh-comment-id:1485900902 --> @tablatronix commented on GitHub (Mar 27, 2023): oh so you dont have this issue with correct password ever? I guess this is the same issue, should be working for now
Author
Owner

@danielminson commented on GitHub (Mar 27, 2023):

Sometimes it doesn’t connect with correct password, but it think it’s due to lower signal. What do you mean it should be working now?

<!-- gh-comment-id:1485902432 --> @danielminson commented on GitHub (Mar 27, 2023): Sometimes it doesn’t connect with correct password, but it think it’s due to lower signal. What do you mean it should be working now?
Author
Owner

@tablatronix commented on GitHub (Mar 28, 2023):

I mean there is a workaround in wm for the bug, and the connecttimeout is also fixed

<!-- gh-comment-id:1486020185 --> @tablatronix commented on GitHub (Mar 28, 2023): I mean there is a workaround in wm for the bug, and the connecttimeout is also fixed
Author
Owner

@danielminson commented on GitHub (Mar 28, 2023):

How can I get a version without this issues I am facing then? I am using the latest release…

<!-- gh-comment-id:1486102945 --> @danielminson commented on GitHub (Mar 28, 2023): How can I get a version without this issues I am facing then? I am using the latest release…
Author
Owner

@tablatronix commented on GitHub (Mar 28, 2023):

you are using git?

<!-- gh-comment-id:1486824571 --> @tablatronix commented on GitHub (Mar 28, 2023): you are using git?
Author
Owner

@danielminson commented on GitHub (Mar 28, 2023):

Yes, but I am downloading the library from the release page. I think you should make a new release if there are fixes in the git that are not in the latest public release. It would also be nice for updating the library on arduino board manager...
image

<!-- gh-comment-id:1486847301 --> @danielminson commented on GitHub (Mar 28, 2023): Yes, but I am downloading the library from the release page. I think you should make a new release if there are fixes in the git that are not in the latest public release. It would also be nice for updating the library on arduino board manager... <img width="1164" alt="image" src="https://user-images.githubusercontent.com/49560569/228244355-081ddec5-f617-4475-b975-743b06e1ea94.png">
Author
Owner

@ramanraja commented on GitHub (Mar 1, 2024):

I still face this issue as of February 2024. I downloaded the latest release from Git. I am using ESP8266.
First I enter the correct password, and connect to the Wifi network successfully. Then I just switch off my WiFi router-modem and restart the ESP. When it is unable to connect to the AP, it goes into a blocking WiFi Manager portal, and never times out.

    WiFiManager wm;
    wm.setTimeout(120);   
    // I also tried:
    //wm.setConfigPortalTimeout(120);  
    bool result = wm.autoConnect("MYAP");
    if (!result) {
      Serial.println("Failed to connect to WiFi network");
    }
 

It never reaches the line if(!result)..
I see on the serial console

*wm:connectTimeout not set, ESP waitForConnectResult... 
*wm:AutoConnect: FAILED for  9229 ms
*wm:StartAP with SSID:  MYAP
*wm:AP IP address: 192.168.4.1
*wm:Starting Web Portal 

<!-- gh-comment-id:1973561574 --> @ramanraja commented on GitHub (Mar 1, 2024): I still face this issue as of February 2024. I downloaded the latest release from Git. I am using ESP8266. First I enter the correct password, and connect to the Wifi network successfully. Then I just switch off my WiFi router-modem and restart the ESP. When it is unable to connect to the AP, it goes into a blocking WiFi Manager portal, and never times out. ``` WiFiManager wm; wm.setTimeout(120); // I also tried: //wm.setConfigPortalTimeout(120); bool result = wm.autoConnect("MYAP"); if (!result) { Serial.println("Failed to connect to WiFi network"); } ``` It never reaches the line` if(!result)..` I see on the serial console ``` *wm:connectTimeout not set, ESP waitForConnectResult... *wm:AutoConnect: FAILED for 9229 ms *wm:StartAP with SSID: MYAP *wm:AP IP address: 192.168.4.1 *wm:Starting Web Portal ```
Author
Owner

@ramanraja commented on GitHub (Mar 2, 2024):

A follow up of the time out issue: I tried non-blocking mode, (appropriately making the wm object global and calling wm.process() in the main loop). There was a different issue this time:

    wm.setConfigPortalBlocking(false);
    wm.setConfigPortalTimeout(180);
    if(!wm.autoConnect("AutoConnectAP")){
       Serial.println("Could not connect to the network");
    } else {
      Serial.println("Connected.");
    }

The portal starts all right, but it does not wait for the 3 minute timeout.
Before I could connect to the AP, wm.autoConnect() returns immediately with a 'false' return value.

*wm:AutoConnect 
*wm:Connecting to SAVED AP: INTOF
*wm:connectTimeout not set, ESP waitForConnectResult... 
*wm:AutoConnect: FAILED for  9228 ms
*wm:StartAP with SSID:  AutoConnectAP
*wm:AP IP address: 192.168.4.1
*wm:Starting Web Portal 
Could not connect to the network.
<!-- gh-comment-id:1974838122 --> @ramanraja commented on GitHub (Mar 2, 2024): A follow up of the time out issue: I tried non-blocking mode, (appropriately making the wm object global and calling wm.process() in the main loop). There was a different issue this time: ``` wm.setConfigPortalBlocking(false); wm.setConfigPortalTimeout(180); if(!wm.autoConnect("AutoConnectAP")){ Serial.println("Could not connect to the network"); } else { Serial.println("Connected."); } ``` The portal starts all right, but it does not wait for the 3 minute timeout. Before I could connect to the AP, `wm.autoConnect()` returns immediately with a 'false' return value. ``` *wm:AutoConnect *wm:Connecting to SAVED AP: INTOF *wm:connectTimeout not set, ESP waitForConnectResult... *wm:AutoConnect: FAILED for 9228 ms *wm:StartAP with SSID: AutoConnectAP *wm:AP IP address: 192.168.4.1 *wm:Starting Web Portal Could not connect to the network. ```
Author
Owner

@tablatronix commented on GitHub (Mar 3, 2024):

This is a bug in esp library. Adding your own connecttimeout will override it. Can you get me debug logs? I have an open issue and they refuse its a real issue

<!-- gh-comment-id:1974946727 --> @tablatronix commented on GitHub (Mar 3, 2024): This is a bug in esp library. Adding your own connecttimeout will override it. Can you get me debug logs? I have an open issue and they refuse its a real issue
Author
Owner

@timf34 commented on GitHub (Mar 5, 2024):

I also have this same issue. AutoConnect gets stuck in a blocking mode if the wrong ap and password are entered.

@tablatronix how would you recommend adding my own setConnectTimeout? I'm not sure how to get past the fact that its blocking.

Thanks

<!-- gh-comment-id:1977826141 --> @timf34 commented on GitHub (Mar 5, 2024): I also have this same issue. AutoConnect gets stuck in a blocking mode if the wrong ap and password are entered. @tablatronix how would you recommend adding my own setConnectTimeout? I'm not sure how to get past the fact that its blocking. Thanks
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#1314
No description provided.