[luci] Get ipaddr

forum-2008 at email.de forum-2008 at email.de
Fr Sep 5 14:11:07 CEST 2008


In the uvc_streamer page I'd like to get the network.lan.ipaddr value and the uvc_streamer. at uvc_streamer[0].port displayed in the desc text instead of the hardcoded URL. The URL should be clickable in the end.

So I added the following to /usr/lib/lua/luci/model/cbi/uvc_streamer.lua to display the ipaddr but I get 500 error:

require("luci.sys")
local netstate = luci.model.uci.cursor_state():get_all("network")
...
local created
local netstat = luci.sys.net.deviceinfo()

ipaddr = s:option(DummyValue, "ipaddr", translate("addresses"))
function ipaddr.cfgvalue(self, section)        
        local addr = luci.tools.webadmin.network_get_addresses(section)
        return table.concat(addr, ", ")
end
...


ERROR:
500 Internal Server Error

Sorry, the server encountered an unexpected error.

/usr/lib/lua/luci/model/cbi/uvc_streamer.lua:9: attempt to index global 's' (a nil value)


More information about the luci mailing list