[GH-ISSUE #1553] Cant get the runtime web portal to work - startWebPortal() #1325

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

Originally created by @jonasbjurel on GitHub (Jan 22, 2023).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1553

Basic Infos

I can't get the run-time webportal to work.

Hardware

WiFimanager Branch/Release: 2.0.15-rc-1

Esp8266/Esp32:

Hardware: ESP wrover

Core Version: 2.0.0

Description

Problem description
I want the webportal to run all the time such that I can perform an OTA at any time, the config portal works okay. After the config portal has concluded after a config save and connect , I try to start a runtime web-portal with no success, cannot connect to it with the IP-address the AP has assigned to my ESP32.
Simplified code snippet:
WiFiManager wifiManager;
wifiManager.setAPStaticIPConfig(IPAddress(WIFI_MGR_AP_IP),
IPAddress(WIFI_MGR_AP_GW_IP),
IPAddress(255,255,255,0));
wifiManager.setAPCallback(configModeCb);
wifiManager.setPreSaveConfigCallback(preSaveConfigCb);
wifiManager.setSaveConfigCallback(saveConfigCb);
wifiManager.setTitle(WIFI_MGR_HTML_TITLE);
wifiManager.setConnectTimeout(WIFI_MGR_STA_CONNECT_TIMEOUT_S);
wifiManager.setConfigPortalTimeout(WIFI_MGR_AP_CONFIG_TIMEOUT_S);
wifiManager.setShowStaticFields(true);
wifiManager.setShowDnsFields(true);
wifiManager.setShowInfoErase(true);
wifiManager.setShowInfoUpdate(true);
wifiManager.setBreakAfterConfig(true);
wifiManager.setShowPassword(false);
wifiManager.setCaptivePortalEnable(true);
wifiManager.setConfigResetCallback(resetCb);
wifiManager.setConfigPortalTimeoutCallback(configurePortalConnectTimeoutCb);
hostNameConfigParam = new WiFiManagerParameter("HostName", "HostName", networkConfig.hostName, 31);
wifiManager.addParameter(hostNameConfigParam);
mqttServerUriConfigParam = new WiFiManagerParameter("MQTTserverURI", "MQTTserverURI", networkConfig.mqttUri, 100);
wifiManager.addParameter(mqttServerUriConfigParam);
char tmpMqttPort[6];
mqttServerPortConfigParam = new WiFiManagerParameter("MQTTserverPort", "MQTTserverPort",
itoa(networkConfig.mqttPort,
tmpMqttPort, 10), 5);
wifiManager.addParameter(mqttServerPortConfigParam);
char apSsid[50];
sprintf(apSsid, "%s_%s", WIFI_MGR_AP_NAME_PREFIX, getMac());
wifiManager.startConfigPortal(apSsid);
wifiManager.stopConfigPortal();
wifiManager.startWebPortal(); // Does not work

For full code see: https://github.com/jonasbjurel/GenericJMRIdecoder/blob/main/client/Arduino/genJMRIDecoderClient/networking.cpp

Settings in IDE

Module: -

Additional libraries:
See: https://github.com/jonasbjurel/GenericJMRIdecoder/blob/main/client/Arduino/genJMRIDecoderClient/networking.cpp

Sketch

See: https://github.com/jonasbjurel/GenericJMRIdecoder/blob/main/client/Arduino/genJMRIDecoderClient/networking.cpp

Debug Messages

....
*wm:config portal exiting
*wm:Starting Web Portal
....

Originally created by @jonasbjurel on GitHub (Jan 22, 2023). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1553 ### Basic Infos I can't get the run-time webportal to work. #### Hardware WiFimanager Branch/Release: 2.0.15-rc-1 Esp8266/Esp32: Hardware: ESP wrover Core Version: 2.0.0 ### Description Problem description I want the webportal to run all the time such that I can perform an OTA at any time, the config portal works okay. After the config portal has concluded after a config save and connect , I try to start a runtime web-portal with no success, cannot connect to it with the IP-address the AP has assigned to my ESP32. Simplified code snippet: WiFiManager wifiManager; wifiManager.setAPStaticIPConfig(IPAddress(WIFI_MGR_AP_IP), IPAddress(WIFI_MGR_AP_GW_IP), IPAddress(255,255,255,0)); wifiManager.setAPCallback(configModeCb); wifiManager.setPreSaveConfigCallback(preSaveConfigCb); wifiManager.setSaveConfigCallback(saveConfigCb); wifiManager.setTitle(WIFI_MGR_HTML_TITLE); wifiManager.setConnectTimeout(WIFI_MGR_STA_CONNECT_TIMEOUT_S); wifiManager.setConfigPortalTimeout(WIFI_MGR_AP_CONFIG_TIMEOUT_S); wifiManager.setShowStaticFields(true); wifiManager.setShowDnsFields(true); wifiManager.setShowInfoErase(true); wifiManager.setShowInfoUpdate(true); wifiManager.setBreakAfterConfig(true); wifiManager.setShowPassword(false); wifiManager.setCaptivePortalEnable(true); wifiManager.setConfigResetCallback(resetCb); wifiManager.setConfigPortalTimeoutCallback(configurePortalConnectTimeoutCb); hostNameConfigParam = new WiFiManagerParameter("HostName", "HostName", networkConfig.hostName, 31); wifiManager.addParameter(hostNameConfigParam); mqttServerUriConfigParam = new WiFiManagerParameter("MQTTserverURI", "MQTTserverURI", networkConfig.mqttUri, 100); wifiManager.addParameter(mqttServerUriConfigParam); char tmpMqttPort[6]; mqttServerPortConfigParam = new WiFiManagerParameter("MQTTserverPort", "MQTTserverPort", itoa(networkConfig.mqttPort, tmpMqttPort, 10), 5); wifiManager.addParameter(mqttServerPortConfigParam); char apSsid[50]; sprintf(apSsid, "%s_%s", WIFI_MGR_AP_NAME_PREFIX, getMac()); wifiManager.startConfigPortal(apSsid); wifiManager.stopConfigPortal(); wifiManager.startWebPortal(); // Does not work For full code see: https://github.com/jonasbjurel/GenericJMRIdecoder/blob/main/client/Arduino/genJMRIDecoderClient/networking.cpp ### Settings in IDE Module: - Additional libraries: See: https://github.com/jonasbjurel/GenericJMRIdecoder/blob/main/client/Arduino/genJMRIDecoderClient/networking.cpp ### Sketch See: https://github.com/jonasbjurel/GenericJMRIdecoder/blob/main/client/Arduino/genJMRIDecoderClient/networking.cpp ### Debug Messages .... *wm:config portal exiting *wm:Starting Web Portal ....
kerem closed this issue 2026-02-28 01:29:36 +03:00
Author
Owner

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

Bump your wn debugging up. Could be conflict with mqtt client? So it just isnt listening?

<!-- gh-comment-id:1399675834 --> @tablatronix commented on GitHub (Jan 23, 2023): Bump your wn debugging up. Could be conflict with mqtt client? So it just isnt listening?
Author
Owner

@jonasbjurel commented on GitHub (Jan 24, 2023):

Thank you, will try when I'm back from my business trip on Sat.

<!-- gh-comment-id:1401836259 --> @jonasbjurel commented on GitHub (Jan 24, 2023): Thank you, will try when I'm back from my business trip on Sat.
Author
Owner

@tablatronix commented on GitHub (Jan 25, 2023):

Yeah not sure I will be able to reproduce, hoping extra logging shows something obvious

<!-- gh-comment-id:1402896566 --> @tablatronix commented on GitHub (Jan 25, 2023): Yeah not sure I will be able to reproduce, hoping extra logging shows something obvious
Author
Owner

@jonasbjurel commented on GitHub (Jan 27, 2023):

Hi, I tried to do this to get more debug output, but I didn't get any more debug info:
#define WM_DEBUG_LEVEL 4
#include <WiFiManager.h>

Any suggestions.
BR/Jonas

<!-- gh-comment-id:1407004325 --> @jonasbjurel commented on GitHub (Jan 27, 2023): Hi, I tried to do this to get more debug output, but I didn't get any more debug info: #define WM_DEBUG_LEVEL 4 #include <WiFiManager.h> Any suggestions. BR/Jonas
Author
Owner

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

you know I don't think i added a method to change logging level real time.. You have to do it via a build flag or global env..
or change it in the .h file.

<!-- gh-comment-id:1407278023 --> @tablatronix commented on GitHub (Jan 28, 2023): you know I don't think i added a method to change logging level real time.. You have to do it via a build flag or global env.. or change it in the .h file.
Author
Owner

@jonasbjurel commented on GitHub (Jan 28, 2023):

Isnt that what I just did with:
#define WM_DEBUG_LEVEL 4
#include <WiFiManager.h>
?
BR/Jonas

<!-- gh-comment-id:1407350631 --> @jonasbjurel commented on GitHub (Jan 28, 2023): Isnt that what I just did with: #define WM_DEBUG_LEVEL 4 #include <WiFiManager.h> ? BR/Jonas
Author
Owner

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

you cannot define in a sketch it doesn't work

<!-- gh-comment-id:1407422767 --> @tablatronix commented on GitHub (Jan 28, 2023): you cannot define in a sketch it doesn't work
Author
Owner

@tablatronix commented on GitHub (Feb 9, 2023):

Any luck ?

<!-- gh-comment-id:1424828298 --> @tablatronix commented on GitHub (Feb 9, 2023): Any luck ?
Author
Owner
<!-- gh-comment-id:1428428115 --> @jonasbjurel commented on GitHub (Feb 13, 2023): Got full logging, troubleshooting as we speak. Hope to provide feed-back soon. BR/Jonas Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows From: Shawn ***@***.***> Sent: Thursday, 9 February 2023 21:56 To: ***@***.***> Cc: ***@***.***>; ***@***.***> Subject: Re: [tzapu/WiFiManager] Cant get the runtime web portal to work - startWebPortal() (Issue #1553) Any luck ? — Reply to this email directly, view it on GitHub<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftzapu%2FWiFiManager%2Fissues%2F1553%23issuecomment-1424828298&data=05%7C01%7C%7Ce000658a72b14bafd5ea08db0ae01855%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638115729819983888%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=xd5i0jTikIuYRDJqS6e6rT8W%2Ftb%2FUoPvIh6zQ4%2BzvLI%3D&reserved=0>, or unsubscribe<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAC7HWSQEJGE6VGY57OWPZGDWWVKXHANCNFSM6AAAAAAUDFUJYQ&data=05%7C01%7C%7Ce000658a72b14bafd5ea08db0ae01855%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638115729819983888%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=GiPbj6jV7ynO1z6FWrtegWGRzbPoHAi6DdoIvqygJ%2FM%3D&reserved=0>. You are receiving this because you authored the thread.Message ID: ***@***.***>
Author
Owner

@jonasbjurel commented on GitHub (Feb 14, 2023):

My bad, missunderstanding of the function.
I thought that the wifimanager would start an own task for the async operation, so I didn't periodically process() the HTTP requests.
Thanks for the support.

<!-- gh-comment-id:1429804230 --> @jonasbjurel commented on GitHub (Feb 14, 2023): My bad, missunderstanding of the function. I thought that the wifimanager would start an own task for the async operation, so I didn't periodically process() the HTTP requests. Thanks for the support.
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#1325
No description provided.