-1

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.setConfigPortalBlocking(false);
 if(wm.autoConnect("TEST-AP")){
 Serial.println("connected...yeey :)");
 }
 else {
 Serial.println("Configportal running");
 }
}
void loop() {
 wm.process();
 Serial.print(".");
 delay(60000);
}
asked Aug 26, 2024 at 4:22
1
  • examine the blinkWithoutDelay example sketch in the Arduino IDE Commented Aug 26, 2024 at 6:15

1 Answer 1

0

Use a shorter delay.

WiFiManager only gets to run when you call wm.process(). When you use a large delay you prevent it from doing any processing during that time, as you saw. This is the way it works. If you want it to work best, don't use a delay at all.

answered Aug 26, 2024 at 4:34
4
  • there is no way to get working portal with another lib or code with big delay? am i right? Commented Aug 26, 2024 at 5:26
  • Why do you think you need a big delay? You almost certainly don't. Commented Aug 26, 2024 at 16:50
  • because in the loop i sending data from sensors to google script and i need them only once per 60 sec Commented Aug 28, 2024 at 12:04
  • So you write your loop to send data only one per 60 seconds. You can do other stuff during that time, you don't have to not do anything for 60 seconds. Commented Aug 28, 2024 at 15:00

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.