29-06-2022, 07:44
Noticed my Wifi Bars were missing on my display while testing.
Webpage was reporting RSSI as -55.
Would that mean all the IF statements below failed as the signal was exactly -55, not > or < ?
Bars did appear when Signal changed to -51.
Assume:-
if (rssi > -55) WiFibars = 3;
Will fix it but what will be appropriate for the other two lines?
Thanks
Phil.
Edit:- Or would this work correctly?
Webpage was reporting RSSI as -55.
Would that mean all the IF statements below failed as the signal was exactly -55, not > or < ?
Bars did appear when Signal changed to -51.
Assume:-
if (rssi > -55) WiFibars = 3;
Will fix it but what will be appropriate for the other two lines?
Thanks
Phil.
Code:
// ---------------------------------------------------------------
// Draw WiFi signal strenght on the clock display
// ---------------------------------------------------------------
#if (ENABLE_WIFI == 1)
void get_Wifistrength()
{
rssi = WiFi.RSSI();
if (rssi > -55) WiFibars = 3;
else if (rssi < -55 && rssi > -70) WiFibars = 2;
else if (rssi < -70 && rssi > -82) WiFibars = 1;
else WiFibars = 0;
}
#endif
Edit:- Or would this work correctly?
Code:
#if (ENABLE_WIFI == 1)
void get_Wifistrength()
{
rssi = WiFi.RSSI();
if (rssi >= -55) WiFibars = 3;
else if (rssi >= -70) WiFibars = 2;
else if (rssi >= -82) WiFibars = 1;
else WiFibars = 0;
}
#endif