Anyone know if there is a way to get the RSSI value for a given link between the ESP8266 and some access point to which it is connected without having to do a whole network scan process? For example to be able to regularly check the connection strength to the router in a non onerous way
Indeed, but this just mentions using full network scan (as I understand it) which takes quite a bit of time. Just wondered if there was some way to get the RSSI level only of the network currently connected to a bit more neatly and less power consuming
Indeed, but this just mentions using full network scan (as I understand it) which takes quite a bit of time. Just wondered if there was some way to get the RSSI level only of the network currently connected to a bit more neatly and less power consuming
Yes that's a good point. I tried it without being connected and got a value back of 31 (that's plus 31) so I guess also an indicator in itself that you are not connected - though it was just one test so can't assume, without knowing the underlying detail, that this is a reliable alternative to checking if connected first.
Convert this code snippet from above to B4R and check the return value against -1
B4X:
/*
Return the quality (Received Signal Strength Indicator)
of the WiFi network.
Returns a number between 0 and 100 if WiFi is connected.
Returns -1 if WiFi is disconnected.
*/
int getQuality() {
if (WiFi.status() != WL_CONNECTED)
return -1;
int dBm = WiFi.RSSI();
if (dBm <= -100)
return 0;
if (dBm >= -50)
return 100;
return 2 * (dBm + 100);
}