[GH-ISSUE #921] Pass config url to persistent http server? #779

Open
opened 2026-02-28 01:27:00 +03:00 by kerem · 12 comments
Owner

Originally created by @eyyit on GitHub (Aug 3, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/921

Using development branch at 34d9a975b5

Once wifi is connected, I'd like to still be able to access the configuration menu to change stored credentials and sa "/update" or something. Would it be possible to have an ESP8266WebServer.h .on() configuration to pass any clients accessing "/update" to WiFiManager to change configs?

Thanks

Originally created by @eyyit on GitHub (Aug 3, 2019). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/921 Using development branch at 34d9a975b5339bb5510f5718fbd1530dff9de733 Once wifi is connected, I'd like to still be able to access the configuration menu to change stored credentials and sa "/update" or something. Would it be possible to have an ESP8266WebServer.h .on() configuration to pass any clients accessing "/update" to WiFiManager to change configs? Thanks
Author
Owner

@tablatronix commented on GitHub (Aug 3, 2019):

There is an ondemand webportal example.

<!-- gh-comment-id:517949918 --> @tablatronix commented on GitHub (Aug 3, 2019): There is an ondemand webportal example.
Author
Owner

@eyyit commented on GitHub (Aug 7, 2019):

It seems in that example that an event triggers the AP to enable as if autoConnect failed. I'd like to be able to use a custom URI to access the WiFimanager config page to be able to modify my WiFiManagerParameters on the fly without running the whole AP to do so, using a URI on an existing instance of ESP8266WebServer. I know this is probably nontrivial. Maybe just running WiFiManager config server on a different port instead?

<!-- gh-comment-id:518918363 --> @eyyit commented on GitHub (Aug 7, 2019): It seems in that example that an event triggers the AP to enable as if autoConnect failed. I'd like to be able to use a custom URI to access the WiFimanager config page to be able to modify my WiFiManagerParameters on the fly without running the whole AP to do so, using a URI on an existing instance of ESP8266WebServer. I know this is probably nontrivial. Maybe just running WiFiManager config server on a different port instead?
Author
Owner

@tablatronix commented on GitHub (Aug 7, 2019):

https://github.com/tzapu/WiFiManager/blob/development/examples/OnDemand/OnDemandWebPortal/onDemandWebPortal.ino

Literally what it does.

If you want advanced stuff like adding routes check the dev example

<!-- gh-comment-id:519238303 --> @tablatronix commented on GitHub (Aug 7, 2019): https://github.com/tzapu/WiFiManager/blob/development/examples/OnDemand/OnDemandWebPortal/onDemandWebPortal.ino Literally what it does. If you want advanced stuff like adding routes check the dev example
Author
Owner

@eyyit commented on GitHub (Aug 18, 2019):

Yes, but I can't merge my own URI handlers with that. Can you add some HTTP server options so I can pass in my own URIs and function pointers for handling them? Or make server public so I can access it? Would that work?

<!-- gh-comment-id:522299334 --> @eyyit commented on GitHub (Aug 18, 2019): Yes, but I can't merge my own URI handlers with that. Can you add some HTTP server options so I can pass in my own URIs and function pointers for handling them? Or make server public so I can access it? Would that work?
Author
Owner

@tablatronix commented on GitHub (Aug 18, 2019):

DEV/ example, look in the code!

wm.setWebServerCallback(bindServerCallback);

void bindServerCallback(){
  wm.server->on("/custom",handleRoute);
  // wm.server->on("/info",handleRoute); // can override wm!
}

void handleRoute(){
  Serial.println("[HTTP] handle route");
  wm.server->send(200, "text/plain", "hello from user code");
}
<!-- gh-comment-id:522320930 --> @tablatronix commented on GitHub (Aug 18, 2019): DEV/ example, look in the code! ```C++ wm.setWebServerCallback(bindServerCallback); void bindServerCallback(){ wm.server->on("/custom",handleRoute); // wm.server->on("/info",handleRoute); // can override wm! } void handleRoute(){ Serial.println("[HTTP] handle route"); wm.server->send(200, "text/plain", "hello from user code"); } ```
Author
Owner

@eyyit commented on GitHub (Aug 21, 2019):

Thanks! I was looking at the wrong example, sorry about that.

How can I get my parameters to show up after wm.startWebPortal()? I don't see anything that seems to remove them. If I forcibly re-add them prior to startWebPortal, they still don't show up on the /wifi page.

Here's what I'm using:

wm.stopConfigPortal();
wm.startWebPortal();

I do see *WM: [0] [ERROR] WiFiManagerParameter is out of scope when I load the page though. Thanks for your help.

<!-- gh-comment-id:523292108 --> @eyyit commented on GitHub (Aug 21, 2019): Thanks! I was looking at the wrong example, sorry about that. How can I get my parameters to show up after `wm.startWebPortal()`? I don't see anything that seems to remove them. If I forcibly re-add them prior to `startWebPortal`, they still don't show up on the `/wifi` page. Here's what I'm using: ``` wm.stopConfigPortal(); wm.startWebPortal(); ``` I do see `*WM: [0] [ERROR] WiFiManagerParameter is out of scope ` when I load the page though. Thanks for your help.
Author
Owner

@tablatronix commented on GitHub (Aug 21, 2019):

You will probably have to change the scope of wm obj.

WiFiManager wm; to global outside of a function/setup for example

<!-- gh-comment-id:523524777 --> @tablatronix commented on GitHub (Aug 21, 2019): You will probably have to change the scope of wm obj. `WiFiManager wm;` to global outside of a function/setup for example
Author
Owner

@eyyit commented on GitHub (Aug 24, 2019):

That solved it. Thanks.

One last issue with this...

When using startWebPortal(), it starts the DNS server as well. Can you add a function or modify the code so that the web portal can be started without DNS as well since it's not needed (in this case)?

<!-- gh-comment-id:524515836 --> @eyyit commented on GitHub (Aug 24, 2019): That solved it. Thanks. One last issue with this... When using `startWebPortal()`, it starts the DNS server as well. Can you add a function or modify the code so that the web portal can be started without DNS as well since it's not needed (in this case)?
Author
Owner

@Phil1pp commented on GitHub (Jul 31, 2021):

When using startWebPortal(), it starts the DNS server as well. Can you add a function or modify the code so that the web portal can be started without DNS as well since it's not needed (in this case)?

Any progress on this?

<!-- gh-comment-id:890371877 --> @Phil1pp commented on GitHub (Jul 31, 2021): > When using `startWebPortal()`, it starts the DNS server as well. Can you add a function or modify the code so that the web portal can be started without DNS as well since it's not needed (in this case)? Any progress on this?
Author
Owner

@tablatronix commented on GitHub (Aug 1, 2021):

#1210

<!-- gh-comment-id:890599332 --> @tablatronix commented on GitHub (Aug 1, 2021): #1210
Author
Owner

@Phil1pp commented on GitHub (Aug 2, 2021):

Thanks.
I was using the library available in Arduino. Didn't know that it was outdated.
After pulling the latest source directly from github it was working as expected.

<!-- gh-comment-id:891348753 --> @Phil1pp commented on GitHub (Aug 2, 2021): Thanks. I was using the library available in Arduino. Didn't know that it was outdated. After pulling the latest source directly from github it was working as expected.
Author
Owner

@tablatronix commented on GitHub (Aug 4, 2021):

Hmm yeah i need to cut a beta sorry about that

<!-- gh-comment-id:892247214 --> @tablatronix commented on GitHub (Aug 4, 2021): Hmm yeah i need to cut a beta sorry about that
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#779
No description provided.