-->
Page 1 of 2

ESP8266 connection time to access point is too long

PostPosted: Fri Mar 23, 2018 5:01 am
by john564
Hi,

I would like to make an ESP8266 connect to one of two possible smartphone access points as fast as possible, once an external input gives the signal to do so. The problem is that it takes too long.


method 1

WiFi.scanNetworks() takes 2,1 s
Wifi.begin() takes around 2,5s

Total: 4,6s


method 2

using the wifi multi sketch takes even longer at around 6 seconds

Is there a faster way to achieve my goals? I would like to get a connection time of 2 s or less

Re: ESP8266 connection time to access point is too long

PostPosted: Fri Mar 23, 2018 9:05 am
by sej7278
i never got an esp8266 to connect to one of two known access points. i thought it was supposed to save wifi networks it had connected to in eeprom or something.

but i've never got an if...then...else setup based on being able to connect or not, so would be interested in what you've tried - which seems to be searching for one of the AP's?

Re: ESP8266 connection time to access point is too long

PostPosted: Fri Mar 23, 2018 10:27 am
by schufti
with dhcpd and wpa2 on an smartphone as AP I can't see that happen but am hoping to be proven wrong ;)

Re: ESP8266 connection time to access point is too long

PostPosted: Fri Mar 23, 2018 12:32 pm
by john564
You just need to scan for all available networks and check whether one of them is equal to "APname1" or "APname2"

For each AP I just use WiFi.begin("APname1" , "password1") or WiFi.begin("APname2" , "password2"). This part is pretty straight forward. As I said, I need to cut the time in half somehow.