Move multi ant detection into main run method (#229)

to avoid startup failures.
This commit is contained in:
Tim Wilkinson 2022-02-24 09:06:29 -08:00 committed by GitHub
parent 4f720b4afc
commit 861db07ad6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -54,12 +54,7 @@ if not file_exists(logfile) then
io.open(logfile, "w+"):close() io.open(logfile, "w+"):close()
end end
local wifiiface = get_ifname("wifi")
local multiple_ant = false 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) local log = aredn.log.open(logfile, 16000)
@ -67,6 +62,12 @@ function run_monitor()
local now = nixio.sysinfo().uptime 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 -- load history
local rssi_hist = {} local rssi_hist = {}
for line in io.lines(datfile) do for line in io.lines(datfile) do