Improve rss_monitor startup (#346) 04/27/2022

And shut down if we hae no wifi to monitor
This commit is contained in:
Tim Wilkinson 2022-04-27 08:38:54 -07:00 committed by GitHub
parent 3f2adcc002
commit 7aff95711e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -35,13 +35,16 @@
--]]
function rssi_monitor()
if string.match(get_ifname("wifi"), "^eth.") then
exit_app()
else
wait_for_ticks(math.max(1, 120 - nixio.sysinfo().uptime))
while true
do
if not string.match(get_ifname("wifi"), "^eth.") and nixio.sysinfo().uptime > 119 then
run_monitor()
end
wait_for_ticks(60) -- 1 minute
end
end
end
local datfile = "/tmp/rssi.dat"