Use frequency list for scan. (#960)

Some hardware doesnt scan all the frequencies we want by default.
Not a fix for the current limited scan problem
This commit is contained in:
Tim Wilkinson 2023-10-12 14:46:35 -07:00 committed by GitHub
parent ed5e8b4770
commit a8c6ac90ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -52,10 +52,17 @@ if not nixio.fs.stat("/tmp/web") then
nixio.fs.mkdir("/tmp/web") nixio.fs.mkdir("/tmp/web")
end end
local channels = aredn.hardware.get_rfchannels(wifiiface)
local scan_list = ""
for _, channel in ipairs(channels)
do
scan_list = scan_list .. " " .. channel.frequency
end
-- scan start -- scan start
local scanned = {} local scanned = {}
local f = io.popen("iw dev " .. wifiiface .. " scan passive") local f = io.popen("iw dev " .. wifiiface .. " scan freq" .. scan_list .. " passive")
if f then if f then
local scan = {} local scan = {}
for line in f:lines() for line in f:lines()