FalconChristmas / fpp

Falcon Player
http://FalconChristmas.com
Other
560 stars 193 forks source link

WiFi "Strength/Quality" in newer FPP versions #1200

Closed datcomputerguy closed 2 years ago

datcomputerguy commented 2 years ago

FPP Version and Hardware: v5.4.1 v5.4 branch, OS v5.3. Hardware experienced on is a RPi 2 and a Pocket BBB with a Kulp PB-K8 attached. But the data provided below are from the Kulp PB-K8 board.

Describe the bug and Steps to reproduce:

  1. Been having some issues with 2 of my controllers connecting to WiFi. My problem turned out to be WiFi signal strength at the devices, but I was curious that the UI didn't reflect the problem.
  2. They would show having "full bars" in the browser window using the new UI, but the older UI in v4.6.1 would show it as red, orange, or blue.
  3. I only noticed the difference because one of the guys in the zoom room suggested using the older version of FPP 4.6.1 and when I did that I noticed that the WiFi symbol went red for a bad quality signal.

Expected behavior: I was expecting the WiFi symbol in the new UI to be similar to the old UI. I believe that is the intent.

Additional context: After playing with the iwconfig and other diagnostic commands I noticed that the format output of iwconfig and cat /proc/net/wireless were not showing some of the same formatting/syntax between v4.6.1 and v5.4.1.

FPP 4.6.1 (on Kulp PB-K8): Web Browser showed Blue with description of "Good" and a mouseover value of: -58dBm

$ iwconfig wlan0
wlan0     IEEE 802.11bgn  ESSID:"falcon_2.4"  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency:2.437 GHz  Access Point: 26:5A:4C:A8:E5:DA
          Bit Rate:72.2 Mb/s   Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off  Link Quality=61/100  Signal level=-58 dBm  Noise level=0 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
$ cat /proc/net/wireless
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
 wlan0: 0000   60.  -59.  -256.       0      0      0      0      0        0 

Upgraded to FPP 5.4.1 (on the same Kulp PB-K8), didn't move or touch the controller, so WiFi conditions should be very similar: Web Browser shows full bars in green color and a mouseover value of: 43dBm

$ iwconfig wlan0
wlan0     IEEE 802.11bgn  ESSID:"falcon_2.4"  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency:2.437 GHz  Access Point: 26:5A:4C:A8:E5:DA
          Bit Rate:72.2 Mb/s   Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=65/100  Signal level=42/100  Noise level=0/100
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0 
$ cat /proc/net/wireless
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
 wlan0: 0000   62.   43.    0.       0      0      0      0      0        0

Thoughts... You can see that there was a change to the Signal & Noise levels to be a percentage not a dBm value, not sure if this is accounted for in the APIs and in the UI, because in the new UI it says 43dBm but I think it is more like 43%.

Additional Attachments I do not think log files are applicable to this. But please let me know if you would like any more data. And if I am being an idiot and forgetting something about my college system signal and noise class I apologize for wasting your time lol. Thank you for all you do!

ghormann commented 2 years ago

Likely a duplicate of #1176

ghormann commented 2 years ago

Mostly a note for myself...

Did some review of this. for PI, it still reports dbm BBB on 5.3 OS reports level% There is a conversion table and some PHP code at https://www.intuitibits.com/2016/03/23/dbm-to-percent-conversion/ but as discussed in stack overflow it isn't that simple. https://stackoverflow.com/questions/13928699/how-to-convert-wifi-level-i-e-45-88-in-to-percentage

I'm thinking that rather than do a conversion, we have the API supply whatever is avaiable (strength or dbm) as a string and still calculate the level (weak, good, etc) in the API. Don't have enough time to finish that tonight though. :-)

ghormann commented 2 years ago

Fixed by 28c9be787aeb471eaf26d68f0faade668fe2eb98