<div dir="ltr"><div><div>Hi OpenWRT dev's, <br><div class="">
<p>It looks like the scanlist method of the iwinfo lua binding hangs when the wifi stack is restarted. </p><p>This
happens when my init script is called, which attempts to perform a
scan, but the wifi stack is restarted because the country and channel is
changed (according to the wireless configuration in uci). With hanging I mean
that Lua doesn't get past this function call, there is no timeout. And
not being able to make this non blocking makes this pretty problematic. <br>The only solution thus far was adding a 5 seconds sleep in my init script. </p><p>The only traces of info I could find are here: <br><a href="http://wiki.openwrt.org/doc/howto/wireless.utilities#iwconfig">http://wiki.openwrt.org/doc/howto/wireless.utilities#iwconfig</a><br><a href="http://git.openwrt.org/?p=project/iwinfo.git;a=tree;hb=HEAD">http://git.openwrt.org/?p=project/iwinfo.git;a=tree;hb=HEAD</a></p><p>This happens in the 14.07 version of OpenWRT. </p><p>I can reproduce this after boot with the following lua script:<br></p><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div class=""><pre><code>local io = require('io')
local file = assert(io.open('/tmp/scan.log', "a+"))
local function logger(message)
print(message)
file:write(message .. "\n")
file:flush()
end
logger("init")
logger("starting wifi restart")
local handler = io.popen("wifi")
local iwinfo = require('iwinfo')
local deviceName = 'wlan0'
local deviceID = iwinfo.type(deviceName)
if not deviceID then
logger("wireless device '" .. deviceName .. "' not found")
else
logger("found wireless device '" .. deviceName .. "'")
end
local wifiDevice = iwinfo[deviceID]
if not wifiDevice then
logger("'iwinfo." .. deviceID .. "' interface not found")
else
logger("found 'iwinfo." .. deviceID .. "' interface")
end
logger("calling scanlist")
local scanList = wifiDevice.scanlist(deviceName)
logger("scanlist completed")
logger("scanlist:")
for _,sn in ipairs(scanList) do
logger(" - " .. (sn.ssid or "<nil>"))
end
logger("finished")</code></pre></div></blockquote>
</div><br>Isn't there a more specific project site, issue queue or mailinglist? <br><br></div>Thanks in advance,<br></div>Peter Uithoven <br></div>