Could someone please fill a gap in documentation. Have some projects that heavily rely on it. I get bugs occasionally there so it'd be really nice to have docs. Thx in advance.
That is the old lua based API which is deprecated as LuCI has moved to using more JavaScript client side and ucode server side.
See: luci.model.network not documented · Issue #837 · openwrt/luci · GitHub
The LuCI client side JavaScript APIs are documented from comments extracted from the source here: LuCI client side API documentation (openwrt.github.io)
I have lots of Lua code that uses this module, what should i do now? Is there a better module for Lua to work with wireless: get txpower, ssid, up/down and all?
Yes. The LuCI client side JavaScript APIs as mentioned in the last paragraph of my post. For example Class: WifiNetwork getTXPower() (openwrt.github.io),
Can't get how to use it from Lua code. Could you please send me a snippet?
For LuCI ucode has supplanted Lua server side. During the change to ucode the APIs were reworked so more is being done client side using JavaScript instead of in server side scripts.
Not sure how many ways I can state the same thing.
Sorry i forgot to mention: I use luci.model.network in scripts not part of cilent-server apps.
local nwm = require "luci.model.network".init()
for _, radio in ipairs(nwm:get_wifidevs()) do
if radio:is_up() then
print("radio", radio:ssid(), " is up")
end
end
Is there any difference then?
The APIs for LuCI that are a layer over ubus and uci were moved client side.
So, for example the network API used by LuCI is now contained in client side JavaScript that makes calls back to ubus server side.
Thanks for explanations, dude. Tho I'm upset to hear that that module is deprecated : (