diff --git a/files/usr/local/bin/mgr/rssi_monitor.lua b/files/usr/local/bin/mgr/rssi_monitor.lua index 831f1c98..d4f90bd4 100644 --- a/files/usr/local/bin/mgr/rssi_monitor.lua +++ b/files/usr/local/bin/mgr/rssi_monitor.lua @@ -54,12 +54,7 @@ if not file_exists(logfile) then io.open(logfile, "w+"):close() end -local wifiiface = get_ifname("wifi") - local multiple_ant = false -if read_all("/sys/kernel/debug/ieee80211/" .. iwinfo.nl80211.phyname(wifiiface) .. "/ath9k/tx_chainmask"):chomp() ~= "1" then - multiple_ant = true -end local log = aredn.log.open(logfile, 16000) @@ -67,6 +62,12 @@ function run_monitor() local now = nixio.sysinfo().uptime + local wifiiface = get_ifname("wifi") + + if read_all("/sys/kernel/debug/ieee80211/" .. iwinfo.nl80211.phyname(wifiiface) .. "/ath9k/tx_chainmask"):chomp() ~= "1" then + multiple_ant = true + end + -- load history local rssi_hist = {} for line in io.lines(datfile) do