[GH-ISSUE #1761] wm.setConfigPortalBlocking(false) + big delay = not working #1491

Open
opened 2026-02-28 01:30:17 +03:00 by kerem · 2 comments
Owner

Originally created by @Jehn84 on GitHub (Aug 21, 2024).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1761

I'm trying to use the library in my project. An implementation with wm.setConfigPortalBlocking(false) is needed, but when a large delay is used in the loop, the portal either does not work at all, or it freezes very much and the web interface does not load. What can be done?

For example:

#include <WiFiManager.h>
WiFiManager wm;

void setup() {
    WiFi.mode(WIFI_STA); 
    Serial.begin(9600);
    wm.resetSettings();
    wm.setConfigPortalBlocking(false);
    wm.setConfigPortalTimeout(600);
    if(wm.autoConnect("TEST-AP")){
        Serial.println("connected...yeey :)");
    }
    else {
        Serial.println("Configportal running");
    }
}

void loop() {
    wm.process();
    Serial.print(".");
    delay(60000);
}
Originally created by @Jehn84 on GitHub (Aug 21, 2024). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1761 I'm trying to use the library in my project. An implementation with wm.setConfigPortalBlocking(false) is needed, but when a large delay is used in the loop, the portal either does not work at all, or it freezes very much and the web interface does not load. What can be done? For example: ``` #include <WiFiManager.h> WiFiManager wm; void setup() { WiFi.mode(WIFI_STA); Serial.begin(9600); wm.resetSettings(); wm.setConfigPortalBlocking(false); wm.setConfigPortalTimeout(600); if(wm.autoConnect("TEST-AP")){ Serial.println("connected...yeey :)"); } else { Serial.println("Configportal running"); } } void loop() { wm.process(); Serial.print("."); delay(60000); } ```
Author
Owner

@Chalta commented on GitHub (Sep 6, 2024):

The wm.process needs to run continuously. It can't just run once and then "not run" for 60000 ms. A hint is how often you get the heartbeat "." printed to your serial monitor.

You need to set up a non-blocking timer in loop() using a while or an if statement, and/or process a callback from wifi manager when the captive portal returns a result. See the example sketches in this repository.

<!-- gh-comment-id:2334371641 --> @Chalta commented on GitHub (Sep 6, 2024): The wm.process needs to run continuously. It can't just run once and then "not run" for 60000 ms. A hint is how often you get the heartbeat "." printed to your serial monitor. You need to set up a non-blocking timer in loop() using a while or an if statement, and/or process a callback from wifi manager when the captive portal returns a result. See the example sketches in this repository.
Author
Owner

@tablatronix commented on GitHub (Sep 9, 2024):

What they said

<!-- gh-comment-id:2339245201 --> @tablatronix commented on GitHub (Sep 9, 2024): What they said
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#1491
No description provided.