Really need help - spending days trying this autoconnect functionality #491
-
I want to do something which I think should be a really standard procedure, but I cannot get it to work and I've tried many variations. I have two buttons on the ESP32 which I would use to Remove the Wifi credentials ( set them to 0,0 ) on a power up cycle for a fresh start without wifi capability. And another to start the SoftAP. From a power up, the app should try to connect for a minute or so ( if it has any credentials other than 0,0 ) and then give up, decide there is no wifi and continue to run the program ( no softap ). Any Wifi functionality will of course be prohibited. If the user decides they simply don't want the wifi functionality they would never use the button to enter their credentials, and the program would begin rapidly without any wifi capability. Which I also cannot resolve. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @rowifi, If you are still looking for help, it would be a good idea to post the relevant portions of your code. It's hard to tell from your original post whether you are having problems with specific parts of the code or the entire program. However, I use a similar approach in one of my programs - so this may help you. I use a button to put the MCU into "configuration mode" at startup time. If the button is not pressed, the program runs in "normal mode" and attempts to connect to the WiFi network periodically.
I don't bother to check if any credentials have been configured before attempting the WiFi connection (because my app does not function well without them) but I believe you could do that with the AutoConnectCredentials.entries() method. Check out Hieromon's documentation. Hope that helps. |
Beta Was this translation helpful? Give feedback.
Hi @rowifi,
If you are still looking for help, it would be a good idea to post the relevant portions of your code. It's hard to tell from your original post whether you are having problems with specific parts of the code or the entire program.
However, I use a similar approach in one of my programs - so this may help you. I use a button to put the MCU into "configuration mode" at startup time. If the button is not pressed, the program runs in "normal mode" and attempts to connect to the WiFi network periodically.