Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Wifi Signal Bars
#1

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.
 
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
Reply


Messages In This Thread
Wifi Signal Bars - by Phil23 - 29-06-2022, 07:44
RE: Wifi Signal Bars - by werk_ag - 30-06-2022, 04:11



Users browsing this thread: 1 Guest(s)