Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By john564
#74840 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
User avatar
By sej7278
#74846 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?
User avatar
By john564
#74853 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.