Add bool autoConnect() function#387
Add bool autoConnect() function#387jaku-jaku wants to merge 2 commits intotzapu:masterfrom jaku-jaku:patch-2
Conversation
Although autoConnect() can directly connect wifi, but it turns into AP mode right away if it can not connect to the wifi. And this will be super limited to users. In some cases, for example, user want to know if they can connect to wifi, and go for sleep after several attempts and avoid directly entering AP mode. Only enter AP mode by some hard reset, which can increase the network security when power outage happened with device/network.
|
👍 |
|
I thought about adding this, but the esp will auto connect on its own in the background. So if you do not want the config portal just don't use auto connect at all. However, I can see the need , someone might be using WiFi.setAutoReconnect ( false ) and manually starting up wifi when they want to, in this case autoconnect might help, of course you could also just call begin in code. Still on the fench |
|
i m thinking we should change autoConnect to not call begin at all if auto reconnect is true. this is more along the lines of working with the SDK rather than against it, that i mentioned... |
|
Revisit adding a autoconnect loop before calling begin, of course adding a delay before in user code autoconnect does the same thing. |
|
Although autoConnect() can directly connect wifi, but it turns into AP mode right away if it can not connect to the wifi.
And this will be super limited to users. In some cases, for example, user want to know if they can connect to wifi, and go for sleep ##after several attempts and avoid directly entering AP mode. Only enter AP mode by some hard reset, which can increase the network security when power outage happened with device/network.