我想在Luci上打印我的解析值。这是我的代码。
local val = {}
mm = Map("test", translate("For TEST"))
test=mm:section(TypedSection, "test", translate("TEST"))
test.anonymous = true
test.addremove = false
rssis = test:option(DummyValue, "rssi", translate("RSSI"))
t = test:option(DummyValue, "tx", translate("TX"))
r = test:option(DummyValue, "rx", translate("RX"))
local f = io.popen("iwpriv wlan0 stat")
for line in f:lines() do
for s in line:gmatch("(%S+)%s") do
table.insert(val, s)
end
for i, v in ipairs(val) do
end
end
f:close()
rssis:value(val[35])
if val[41] == "6M" then
t:value(val[41], translate("Disconnect"))
else
t:value(33, translate("Good"))
end
if val[49] == "6M" then
r:value(val[49], translate("DIsconnect"))
else
r:value(33, translate("GOOD"))
end
return mm我看到了在表单中创建只读字段的DummyValue。所以我用它代替了print函数。然而,它有错误“尝试索引全局'rssis‘(一个nil值)”
仅在lua文件中(不用于Luci)如果我使用打印功能,它没有错误。Luci有打印功能吗?
https://stackoverflow.com/questions/47808898
复制相似问题