bugfix: sometimes iw doesn't show noise floor

Pull from kernel debug instead for now untill we can work around it in iw.

fixes AREDN->ticket:129
This commit is contained in:
Conrad Lara - KG6JEI 2015-07-01 10:05:58 -07:00
parent 794c00c7c6
commit a46bbf27d8
1 changed files with 11 additions and 0 deletions

View File

@ -608,12 +608,23 @@ sub get_wifi_signal
$SignalLevel=$1;
}
}
foreach(`iw dev $wifiintf survey dump|grep -A 1 \"\\[in use\\]\"`)
{
next unless /([\d\-]+) dBm/;
$NoiseFloor=$1;
}
if ( $SignalLevel == "N/A" )
{
open( my $SignalFH , "<" , "/sys/kernel/debug/ieee80211/phy0/ath9k/dump_nfcal") or return ("N/A","N/A");
while (<$SignalFH>) {
next unless /Channel Noise Floor : ([-]?[0-9]+)/;
$SignalLevel=$1;
}
close($SignalFH);
}
if ( $SignalLevel == "N/A" || $NoiseFloor == "N/A" )
{
return ("N/A","N/A");