WLAN-Pi / wlanpi-fpms

Front Panel Menu System for WLAN Pi RPi and CM4 hardware
BSD 3-Clause "New" or "Revised" License
5 stars 5 forks source link

[scanner] handle when scan results do not have RSSI measurements #79

Open joshschmelzle opened 2 years ago

joshschmelzle commented 2 years ago

There is a scenario with the USB based CF-951AX and CF-953AX on v3.1.0 image where launching the scanner app on FPMS does not get past the Scanning... message.

image

This is due to a template parsing error when there are no RSSI measurements found in the scan results. The template is explicitly looking for a negative number.

https://github.com/WLAN-Pi/wlanpi-fpms/blob/777301446af1484b0d0467c52e8cf7a73ba6cc7e/fpms/modules/templates/iw_scan.textfsm#L3

In addition, if we end up fixing the template to allow for passing back a 0.00 value. We will need to handle the conversion code in scanner.py for the float.

https://github.com/WLAN-Pi/wlanpi-fpms/blob/main/fpms/modules/apps/scanner.py#L83

Otherwise, the template would need to return 0 instead of 0.00.

For a fix, we should consider that if all scans in a given response are 0, temporarily print a warning with something like "Adapter does not support RSSI measurement" on the FPMS screen.

Returning a list of BSSIDs and SSIDs without RSSI may be useful to some.


Example of the scan results with the CF-951AX.

wlanpi@wlanpi-c30:~ $ sudo iw dev wlan0 scan | grep signal:
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm
        signal: 0.00 dBm