From 39729157c60dd3e13bd174437595094ef8beb59d Mon Sep 17 00:00:00 2001 From: Conrad Lara - KG6JEI Date: Tue, 30 Jun 2015 00:05:45 -0700 Subject: [PATCH] bugfix: Signal levels do not show up on "new extended" RF Channels Switch to iw over iwinfo because it handles the new channels better. Partially reverts changeset:808a8d5019fce4a7ca2c027ea7838d43c6d8cad0/aredn_ar71xx fixes AREDN->ticket:129 --- files/www/cgi-bin/perlfunc.pm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/files/www/cgi-bin/perlfunc.pm b/files/www/cgi-bin/perlfunc.pm index 275e2b7f..1b911038 100644 --- a/files/www/cgi-bin/perlfunc.pm +++ b/files/www/cgi-bin/perlfunc.pm @@ -600,11 +600,18 @@ sub get_wifi_signal chomp $wifiintf; my ($SignalLevel) = "N/A"; my ($NoiseFloor) = "N/A"; - foreach(`iwinfo $wifiintf info`) - { - next unless /.*Signal: ([\d\-]+) dBm.*Noise: ([\d\-]+) dBm/; - $SignalLevel=$1; - $NoiseFloor=$2; + foreach(`iw dev $wifiintf station dump`) + { + next unless /.+signal:\s+([-]?[\d]+)/; + if ( $SignalLevel <= "$1" || $SignalLevel == "N/A" ) + { + $SignalLevel=$1; + } + } + foreach(`iw dev $wifiintf survey dump|grep -A 1 \"\\[in use\\]\"`) + { + next unless /([\d\-]+) dBm/; + $NoiseFloor=$1; } if ( $SignalLevel == "N/A" || $NoiseFloor == "N/A" )