I found this menu on other opennwrt build
is there any way to grab this temperature and cpu usage menu to apply on my openwrt router?
I found this menu on other opennwrt build
is there any way to grab this temperature and cpu usage menu to apply on my openwrt router?
I think you'll want to install luci-app-temp-status and luci-app-cpu-status
That’s not openwrt. Perhaps ask the ophub people how they did it in their fork
do you know where is the location of this file?
i have those openwrt build, but i dont know where to edit....
Same answer, you will need to ask the author of the fork what they edited.
I'm doing another research on the folders and found this file
is there something i can do to process this into my router?
-- Copyright 2019 Cezary Jackiewicz<cezary@eko.one.pl>-- Licensed to the public under the Apache License 2.0.-- Mod by IceG for Linksys WRT --
module("luci.controller.temp",package.seeall)
function index()
if not nixio.fs.access("/sys/class/thermal/thermal_zone0/temp")then
return
end
entry({"admin","status","realtime","temperature1"},call("temperature1")).leaf=true
end
function temperature2(rv)
local c=nixio.fs.access("/sys/class/thermal/thermal_zone0/temp")and
io.popen("cat /sys/class/thermal/thermal_zone0/temp")
if c then
for l in c:lines()do local i=l:match("^%d+")
if i then
rv[#rv+1]={cpu=i}
end
end
c:close()
end
end
function temperature1()
local data={}
temperature2(data)
luci.http.prepare_content("application/json")
luci.http.write_json(data)
end
Just a quick disclaimer: I don't know any more about this than you do, so please don't think I'm any sort of expert. We're learning together.
Where (what folder) did you find that file? (And, for that matter, what's the filename?)
This is mine file, written in lua. Don't use it, use a solution written in js.
Moreover, not every router has a sensor in hwmon to be able to use my code.
its on \usr\lib\lua\luci\controller\temp.lua
i don't know how to copy lua or apply it...
hello there, finally met the creator of this code..
pardon me if i discuss this topic without your permission...
what is js solution means? and how to apply it?
i'm a noob in this kind of topic...
do you want to explain it further? *if you don't mind
Installing these openwrt packages instead may better meet your needs.
opkg update
opkg install luci-app-statistics collectd-mod-thermal htop
I find an historical trend of CPU usage and temperature to be more useful than a single snapshot in time on an overview menu. It is also possible to configure the rate at which data is saved for trend plotting with luci-app-statistics. As I recall, the default is every 30 seconds. I prefer every 10 seconds myself.
Running htop in a terminal window is also quite useful for monitoring real time CPU usage during load testing.
I am not the OP, but WOW, these are very usefull!
Thanks for this information!