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,12 +35,15 @@
--]] --]]
function rssi_monitor() function rssi_monitor()
while true if string.match(get_ifname("wifi"), "^eth.") then
do exit_app()
if not string.match(get_ifname("wifi"), "^eth.") and nixio.sysinfo().uptime > 119 then else
wait_for_ticks(math.max(1, 120 - nixio.sysinfo().uptime))
while true
do
run_monitor() run_monitor()
wait_for_ticks(60) -- 1 minute
end end
wait_for_ticks(60) -- 1 minute
end end
end end