khoih-prog / ESP_WiFiManager

This is an ESP32 / ESP8266 WiFi Connection Manager with fallback web configuration portal. Use this library for configuring ESP32 (including ESP32-S2 and ESP32-C3), ESP8266 modules' WiFi, etc. Credentials at runtime. You can also specify static DNS servers, personalized HostName, fixed or random AP WiFi channel. With examples supporting ArduinoJson
MIT License
371 stars 97 forks source link

Persistent Config Portal (CP) #63

Closed Zenock closed 3 years ago

Zenock commented 3 years ago

Hi I've been searching through and I might be missing something. Or maybe I just can't do what I want to do ...

I've read the following...

https://github.com/khoih-prog/ESP_WiFiManager/issues/12#issuecomment-598550911

Where someone asked about having a persistent Config Portal. You stated:

It's totally possible to do so by making the WiFi Modem working in AP+STA mode, But it's not advisable to do so :

Imagine you have 20 different devices, each running its own AP. There will be a lot of issues such as :

channel conflict => big issue for every board, even for your router if channel is duplicated. unintended (re-)connection from other devices the STA+AP mode is not as very reliable as STA only. the Portal Webserver must be still running and not efficient to do so. That's why we normally don't like to do that.

I want to do something similar I want to have a persistent non-blocking Config Portal except when the device is connected in STA mode I don't want AP mode. I just want to be able to connect to the Config Portal from a device on the same network and have it go to AP mode ONLY if the stored SSID isn't available.

This solves the problems of:

Imagine you have 20 different devices, each running its own AP. There will be a lot of issues such as :

channel conflict => big issue for every board, even for your router if channel is duplicated. unintended (re-)connection from other devices the STA+AP mode is not as very reliable as STA only.

And only leaves the problem of:

the Portal Webserver must be still running and not efficient to do so.

Which I recognize, but I don't think the overhead will cause me any problem. So I'm trying to figure it out. Maybe it's not possible.

khoih-prog commented 3 years ago

Thanks for your interest in the library and your time to do some research.

I'm sorry I won't spend any time on the issue as this is only for your specific interest and use-case only.

You certainly can modify the open-source code to meet your requirements and it's totally possible.