Is there a way to close/stop the AP server of autoconnect? #479
Replies: 1 comment
-
I'm not sure what "main setup function" you are referring to, however, AutoConnect has the ability to attempt to connect to a known AP if one is found and shut down the AP once a WiFi connection is established. However, the AP shuts down only when the call is made in AutoConnect::begin; for connections made in the loop function (i.e., in the background of a AutoConnect::handleClient call) via the AutoConnectConfig::autoReconnect operation, even if the WiFi connection is successful, the AP will not shut down. In order to do that, it needs to be addressed individually in the sketch. Refs: https://hieromon.github.io/AutoConnect/adcpcontrol.html#shutdown-the-captive-portal As for the rest of your requirements, some of them already have the features you need. See documentation. |
Beta Was this translation helpful? Give feedback.
-
Hello ,
I was wondering if anyone can tell me if there is a way to stop the ap once the wifi cred/mqtt details is configured on the files. What im looking is once the main setup function is called the autoconnect kicks in, checks for the previous configs and connects to that wifi, and if found online then it will connect to the wifi and kill the AP process for any new device to connect to it(untill restarted).
But if not found online then it would trigger the AP host for us to connect manually ,with can be done through captive portal. If the values are provided then the same will be updated untill a timeout kicks in and previous set configurations will be retained. In this case too the AP mode will be killed/stopped/closed and the AP will not be visible for selection.
The reconnect logics can work in the backgrounds or i can write something custom for reconnect. I have an example working with wifimanager(on demand) already but unfortunately i am seeing some issue with memory leakage in it and thus, thought to check for alternatives.
Regards.
Shariq
Beta Was this translation helpful? Give feedback.
All reactions