Skip to content

Add bool autoConnect() function#387

Closed
jaku-jaku wants to merge 2 commits intotzapu:masterfrom
jaku-jaku:patch-2
Closed

Add bool autoConnect() function#387
jaku-jaku wants to merge 2 commits intotzapu:masterfrom
jaku-jaku:patch-2

Conversation

@jaku-jaku
Copy link
Copy Markdown

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.

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.
@dronov
Copy link
Copy Markdown

dronov commented Aug 8, 2017

👍

@tablatronix
Copy link
Copy Markdown
Collaborator

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

@tablatronix tablatronix added the Discussion Further Discussion ongoing label Aug 30, 2017
@tzapu
Copy link
Copy Markdown
Owner

tzapu commented Aug 30, 2017

i m thinking we should change autoConnect to not call begin at all if auto reconnect is true.
this should sort a load of other problems with forcing the connection.
it should probably wait until a timeout.
if auto reconnect is false, it should maybe throw a warning and force connection with begin

this is more along the lines of working with the SDK rather than against it, that i mentioned...

@tablatronix
Copy link
Copy Markdown
Collaborator

tablatronix commented Nov 19, 2020

Revisit adding a autoconnect loop before calling begin, of course adding a delay before in user code autoconnect does the same thing.

@tablatronix
Copy link
Copy Markdown
Collaborator

// if true (default) then start the config portal from autoConnect if connection failed
void          setEnableConfigPortal(boolean enable);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Discussion Further Discussion ongoing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants