GithubHelp home page GithubHelp logo

Comments (3)

khoih-prog avatar khoih-prog commented on June 21, 2024

Any chance the non-blocking option will be available soon?

Can you clarify what is this and give some example.
The WiFiManager is just a tool to permit you to input certain Credentials in start-up. We don't like to have it running all the times to create conflicts and to interfere with other jobs and use precious resource, unless absolutely necessary.

Check these closed issues

  1. Wifi Manager acts like Home Wifi Router?
  2. Accessing manager after connection

I dropped the persistent Config Portal quite a while and use dynamic Config Portal with these features:

open only when necessary to enter Credentials
closed whenever Credentials are valid and Config Portal not needed
More efficient as Config Portal WebServer is not running in normal operation.
because of these following concerns and potential issues

AP stays open
Wifi Manager acts like Home Wifi Router?
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.


I think this would be very useful for everyone running devices that should be able to fully operate in STA and AP mode but give the user the ability to switch between those 2 modes on demand

Can you give some use case why we need this option? When the board has no WiFi Credential, the Config Portal AP mode is a must and is necessary, only for a very short time, for you to input Credentials. The STA Config Portal is only possible after the board has correct Credentials and has connected to the WiFi. Leaving the CP running is not advisable.


My programming skills are limited, but if I can help/support to implement this feature I'd be happy to help.

Your contribution is always welcome anytime. The more important assets here are "your novel thinkings and problem solutions", not "programming skills", and don't hesitate to propose new solutions, etc.

If you're willing to contribute, I'll invite you to a private repo where we can participate and contribute ideas, solutions, etc to all libraries.

Regards,

from espasync_wifimanager.

NoobOnTour024 avatar NoobOnTour024 commented on June 21, 2024

Hi Khoih,

What I would like to do is integrate the Async WiFiManager into my existing project, but without blocking my main code.
The program I've written is meant to be used in cars. Some people will have a Hotspot in their car, others might not. In the latter case I want the ESP to be in AP mode and run all other code, just like it would in STA mode.
Should the user want to switch between AP or STA mode, it would be perfect if the user can navigates to a specific page (i.e. /settings) were the /wifi page will be displayed, allowing the user to pick a WiFi network.

I tried commenting all server handles except '/wifi' in the WiFimanager library, but my 'own' server.on events wouldn't work.
Maybe I could create the WiFiManager instance only when the user accesses the settings page.. But it would still be nice if the main code doesn't block.

Any ideas on how best to approach this?

from espasync_wifimanager.

khoih-prog avatar khoih-prog commented on June 21, 2024

In the latter case I want the ESP to be in AP mode and run all other code, just like it would in STA mode.
Should the user want to switch between AP or STA mode, it would be perfect if the user can navigates to a specific page (i.e. /settings) were the /wifi page will be displayed, allowing the user to pick a WiFi network.

In programming world, anything is possible provided that you know how to solve the issue. To achieve this, I suggest you have to spend more time to look at the library, the example code and test then retest until you master the usage and configuration. You also have to know the purpose of the library, its limitation and where/how to use it effectively.

As I said,

The WiFiManager is just a tool to permit you to input certain Credentials in start-up.

The library has nothing to do and should not interfere with your application code, until you push it into operation, by certain conditions (double reset, SW pressed, can't connect to programmed AP, etc).

If you don't like to have the blocking ESPAsync_WiFiManager running in start-up, just don't call it in setup(). By design, without Credentials / WiFi AP, ESPAsync_WiFiManager has to block and wait for you to enter correct Credentials to connect to a WiFi AP.

In your use case, without AP, you can just ignore ESPAsync_WiFiManager by not calling it at all in setup(). Then you run your normal code as usual, certainly using (Async)WebServer if necessary, but in AP mode. Users have to connect to that AP, get an IP address from its DHCP server, to access the (Async)WebServer.

Nothing to do with ESPAsync_WiFiManager so far because it's not activated yet or has been killed.

Whenever you need to change the mode, e.g. to STA from AP if the car has local HotSpot, just start the ESPAsync_WiFiManager by a hardware SW or just a virtual BUTTON control by your WebServer.

Have a look at Async_ConfigOnSwitch loop() to know how to start the ESPAsync_WiFiManager in that case.

I'm afraid I can't spend more time to help solve your problem anymore. If I have time in the near future, I possibly write an example to do something for similar use-case.

Good luck with your project.

from espasync_wifimanager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.