Found couple of bugs in luci.model.network.lua
OpenWrt - 23.05
Feed Luci - openwrt-23.05
File: luci.model.network
local nwm = require "luci.model.network"
local uci = require "uci"
local cursor = uci:cursor()
nwm = nwm:init(cursor)
for _,radio in ipairs(nwm:get_wifidevs()) do
print(radio:is_up())
for _,net in ipairs(radio:get_wifinets()) do
local channel = net:channel()
end
end
Bug1: code above throws error - channel()
throws an error. Same error even if I dont use uci
lua: /usr/lib/lua/luci/model/network.lua:792: attempt to call method 'foreach' (a nil value)
stack traceback:
/usr/lib/lua/luci/model/network.lua:792: in function 'get_wifidevs'
sketch.lua:8: in main chunk
[C]: ?
Bug2: also radio:is_up() is always false. I compared output with ubus call network.wireless status
. Lua code shows wrong output