Fast WiFi RSSI scan
Posted: Fri Mar 01, 2019 3:38 am
I need to get the signal strength of a network with a specific SSID, for calculating the distance between one ESP and another. There may be multiple APs with that SSID, in that case I need the closest one. I need a latency of ~0.5s or less. I need it to work even with low signal strengths. I've tried:
Method 1: Connecting to the AP
Then using the WiFi.SSID() method. It's pretty fast, but connecting is very slow and fails at longer distances (even when there is still a signal). It also doesn't switch between the different APs.
Method 2: Scanning all networks
In a for loop I can all WiFi networks, and for all the networks with the SSID I am looking for I get the RSSI. I use the highest (closest to zero) one. It works well, but is very slow: ~2.2 seconds
Is there a better method?
Method 1: Connecting to the AP
Then using the WiFi.SSID() method. It's pretty fast, but connecting is very slow and fails at longer distances (even when there is still a signal). It also doesn't switch between the different APs.
Method 2: Scanning all networks
In a for loop I can all WiFi networks, and for all the networks with the SSID I am looking for I get the RSSI. I use the highest (closest to zero) one. It works well, but is very slow: ~2.2 seconds
Is there a better method?