Open ambarusa opened 1 year ago
I have never figured this out, No matter how I try to stop and free the webserver, i can never start it back on the same port..
Hi and good day Sorry by my newie in WifiManager, and sorry if item comment before, but not found any. ambarusa say "terminating WiFiManager's web portal, and starting my own" How?... i try this, redirect to my own portal after Wifimanager conect to some Wifi, and redirecto my own Webserver create in my ESP32 D1 mini. I agree some info!! THANKS
To terminate the WiFiManager web portal, you can use the stopConfigPortal() function. However, as you mentioned, calling this function will also stop the web server created by the WiFiManager library, which is not what you want.
To solve this issue, you can call stopWebPortal() instead of stopConfigPortal(). This function will stop the WiFiManager web portal, but it will not stop the web server created by the WiFiManager library. You can then start your own web server using the Webserver_start() function.
Found this today, hints at the same issue
Basic Infos
Hardware
WiFimanager Branch/Release: Master
Esp8266:
Hardware: ESP-12e,
Core Version: 2.4.0, staging
Description
Hi all. I'm having troubles with terminating WiFiManager's web portal, and starting my own. I know... there were issues opened before regarding this, but this case is different, because it's used in non-blocking mode, and a reset() would change the behavior in the system.
Briefly, after the software connects to the Wi-Fi, I want to change the webservers in the
WiFiEventStationModeGotIP
callback function. First I got exceptions, and it turned out becausestopConfigPortal()
was called by me, and later on bywm.process()
. I solved this by settingwm.setDisableConfigPortal(false);
which stops theprocess()
function to care about closing the webserver.But still, it seems like after calling the
wm.stopWebPortal();
the webserver doesn't close, however thewm.getWebPortalActive()
tells the opposite. I could put in a loop my AsyncWebServer'sbegin()
function, but I'm not sure if it's handled by the library, and there's no API go get it's status.So, what do you suggest I should terminate the WiFiManager's web portal? Thanks in advance
Settings in IDE
Module: Wemos D1 Mini
Additional libraries: SPAsyncWebServer
Sketch