balena-io-modules / device-diagnostics

on-device diagnostics tool
9 stars 8 forks source link

Diagnostics script can't handle multiple active wi-fi entries #314

Open otaviojacobi opened 2 years ago

otaviojacobi commented 2 years ago

Expected Behavior

The check script should be able to handle multiple active wifis.

Actual Behavior

Diagnostics checks fail (when running the UI the direct error is Error!An error occurred while querying checks data: main ) and when directly running the check script the variable wifi_strength ends up as two values (like 64 62). Which makes the check fail on line 126.

Steps to Reproduce the Problem

  1. Have two wifis with same BSSID and SSID and active so that nmcli device wifi list output looks like
    IN-USE  BSSID              SSID                       MODE   CHAN  RATE        SIGNAL  BARS  SECURITY    
    [...]
    *       72:5a:87:9a:aa:38  my-ssid  Infra  6     50 Mbit/s  64      ***   WPA2        
    [...]
    *       72:5a:87:9a:aa:38  my-ssid  Infra  6     50 Mbit/s  62      ***   WPA2        
    [...]
  2. Run the scripts check