-->
Page 1 of 1

WifiManager - getting from AP mode into STA mode

PostPosted: Tue Dec 08, 2020 12:51 pm
by Harry01
Hi fellows!

Hoping this is the right place to post a question concerning WifiManager.

I searched the whole web and some pages more, but didn't find a clue on how to leave AP mode after the ESP has switched to AP mode when not finding the WLAN the credentials it already knows of (from a privious session in AP mode, when I entered the correct credentials).

The ESP goes into AP mode because the WLAN is switched off.
If WLAN is ON, it connects into STA mode correctly.

To be clear:
ESP knows credentials of the WLAN.
If WLAN is ON, it connects.
If WLAN is OFF, it enters AP mode and rests there forever.
How can I programmatically leave AP mode to enter STA mode, when WLAN is ON again?

Thanks!

Harry

Re: WifiManager - getting from AP mode into STA mode

PostPosted: Wed Dec 16, 2020 5:31 pm
by D D Weber
Harry, are you still having the issue? I'm new to the forum but didn't see any replies to you question. Sorry if this a repeat.
Code: Select allwifiManager.setTimeout(120);   // time the AP will be active, waiting for a AP connection and wifi config
   wifiManager.setConfigPortalTimeout(120);
   
   if(!wifiManager.autoConnect("Open Sesame WIFI Switch C02.01", "sesame911")) {
    Serial.println("Failed to connect 1st time after BOOT and hit timeout");
    Serial.println("Try again to connect to WiFi with saved credentials");
    ESP.restart();
  }

Re: WifiManager - getting from AP mode into STA mode

PostPosted: Sun Dec 20, 2020 10:05 am
by Harry01
Hi D D Weber!

Yes, there are plenty of uncommented posts here in this forum, most of them are read by many people, but no answers. Sad.

But to your proposal:
Thanks for the idea. I will implement this procedure, and have a look on the result.

You defined 2 timeouts.
What timeout results in what reaction?
Your comment leads me to the assumption, that
Code: Select allwifiManager.setTimeout(120);
will do the job.
But then, what does
Code: Select allwifiManager.setConfigPortalTimeout(120);
?

Harry