ESP8266 connection to smartphone AP takes too long


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

How long do you think it should take to scan through all possible WIFI channels and test each one to see if anyone is there?

Perhaps there is the ability to hard code the WIFI channel to use.


I don't know whether it is possible to hard code the channel, at least not that I knew of.