From b64aa0c988a1d801367d0b07e7db3252c951ce23 Mon Sep 17 00:00:00 2001 From: Tim Wilkinson Date: Wed, 7 Jun 2023 22:42:42 -0700 Subject: [PATCH] Monitor bug fixes (#867) --- files/usr/local/bin/mgr/rssi_monitor_ath10k.lua | 3 ++- files/usr/local/bin/mgr/station_monitor.lua | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/files/usr/local/bin/mgr/rssi_monitor_ath10k.lua b/files/usr/local/bin/mgr/rssi_monitor_ath10k.lua index 19c70838..d07f60aa 100644 --- a/files/usr/local/bin/mgr/rssi_monitor_ath10k.lua +++ b/files/usr/local/bin/mgr/rssi_monitor_ath10k.lua @@ -36,6 +36,7 @@ local periodic_scan_tick = 5 local wifiiface +local phy function rssi_monitor_10k() if not string.match(get_ifname("wifi"), "^wlan") then @@ -46,7 +47,7 @@ function rssi_monitor_10k() wifiiface = get_ifname("wifi") -- ath10k only - local phy = iwinfo.nl80211.phyname(wifiiface) + phy = iwinfo.nl80211.phyname(wifiiface) if not phy or not nixio.fs.stat("/sys/kernel/debug/ieee80211/" .. phy .. "/ath10k") then exit_app() return diff --git a/files/usr/local/bin/mgr/station_monitor.lua b/files/usr/local/bin/mgr/station_monitor.lua index 4be9151d..6dc95cc9 100755 --- a/files/usr/local/bin/mgr/station_monitor.lua +++ b/files/usr/local/bin/mgr/station_monitor.lua @@ -66,6 +66,12 @@ function station_monitor() frequency = iwinfo.nl80211.frequency(wifiiface) ssid = iwinfo.nl80211.ssid(wifiiface) + -- If frequency or ssid is missing (some kind of bad configuration) just exit this + if not (frequency and ssid) then + exit_app() + return + end + -- Mikrotik AC hardware has some startup issues which we try to resolve -- by leaving and rejoining the network local boardid = aredn.hardware.get_board_id():lower()