Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPU usage and Sensor Temperatures #132

Closed
RexyAU opened this issue Jan 19, 2023 · 9 comments
Closed

CPU usage and Sensor Temperatures #132

RexyAU opened this issue Jan 19, 2023 · 9 comments

Comments

@RexyAU
Copy link

RexyAU commented Jan 19, 2023

Just a few minor bugs.

Updated to tch-gui-unhide Release 2022.12.31 for Firmware 17.2.0284-820-RA (Mint) on the TG799VAC and noticed that the CPU usage indicator is now always at 0% regardless of the real usage. Was previously on tch-gui-unhide Release 2022.10.06 and it was working there. Background card refresh disabled as is needed on this modem for performance.

Sensor Temperature has always been broken as far as i know, just displays the degree symbol.

Screenshot 2023-01-19 174449

Screenshot 2023-01-19 174637

^^ Top command in a ssh session shows the real cpu usage ^^

@seud0nym
Copy link
Owner

Thanks for the report.

I did make some changes to the memory stats collection to improve performance, but I only made a very tiny change (famous last words) to the CPU collection. Could you please copy and paste the following commands (there are 2 almost identical multi-line commands) into an SSH session, and post the results:

lua -e 'stat = io.open("/proc/stat")
  if stat then
    local user,sys,nice,idle,wait,irq,srq,zero
    while (not user) do
      user,sys,nice,idle,wait,irq,srq,zero = string.match(stat:read("*l"),"cpu%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+).*")
    end
    stat:close()
    print(user,sys,nice,idle,wait,irq,srq,zero)
  end'
lua -e 'stat = io.open("/proc/stat")
  if stat then
    local user,sys,nice,idle,wait,irq,srq,zero
    while (not user) do
      user,sys,nice,idle,wait,irq,srq,zero = string.match(stat:read("*line"),"cpu%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+).*")
    end
    stat:close()
    print(user,sys,nice,idle,wait,irq,srq,zero)
  end'

Temperature is a bit tricky. I don't have a TG799vac. (That's the MIPS processor one, I think?) Can you please post the results of these commands:

find /sys/ -name '*temp*'
cat /usr/lib/lua/thermal-protection/radio_thermal_map.lua

Thanks.

@RexyAU
Copy link
Author

RexyAU commented Jan 19, 2023

lua -e 'stat = io.open("/proc/stat")

if stat then
local user,sys,nice,idle,wait,irq,srq,zero
while (not user) do
user,sys,nice,idle,wait,irq,srq,zero = string.match(stat:read("l"),"cpu
%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+).
")
end
stat:close()
print(user,sys,nice,idle,wait,irq,srq,zero)
end'
278570 56 690818 12087802 199 0 121966 0


lua -e 'stat = io.open("/proc/stat")

if stat then
local user,sys,nice,idle,wait,irq,srq,zero
while (not user) do
user,sys,nice,idle,wait,irq,srq,zero = string.match(stat:read("line"),"
cpu%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+).
")
end
stat:close()
print(user,sys,nice,idle,wait,irq,srq,zero)
end'
278918 56 691064 12094881 199 0 122053 0


root@OpenWrt:# find /sys/ -name 'temp'
root@OpenWrt:
# cat /usr/lib/lua/thermal-protection/radio_thermal_map.lua
cat: can't open '/usr/lib/lua/thermal-protection/radio_thermal_map.lua': No such file or directory

@RexyAU
Copy link
Author

RexyAU commented Jan 19, 2023

Also tried searching for temp through all files and couldn't find anything relevant to temperature. Perhaps it doesn't exist on the TG799VAC?

root@OpenWrt:/sys# find / -name 'temp'
/bin/mktemp
/etc/samba/smb.conf.template
/proc/efu/temporal_tag
/proc/sys/net/ipv6/conf/all/temp_prefered_lft
/proc/sys/net/ipv6/conf/all/temp_valid_lft
/proc/sys/net/ipv6/conf/all/use_tempaddr
/proc/sys/net/ipv6/conf/atm_8_35/temp_prefered_lft
/proc/sys/net/ipv6/conf/atm_8_35/temp_valid_lft
/proc/sys/net/ipv6/conf/atm_8_35/use_tempaddr
/proc/sys/net/ipv6/conf/bcmsw/temp_prefered_lft
/proc/sys/net/ipv6/conf/bcmsw/temp_valid_lft
/proc/sys/net/ipv6/conf/bcmsw/use_tempaddr
/proc/sys/net/ipv6/conf/br-lan/temp_prefered_lft
/proc/sys/net/ipv6/conf/br-lan/temp_valid_lft
/proc/sys/net/ipv6/conf/br-lan/use_tempaddr
/proc/sys/net/ipv6/conf/br-lan-ifb/temp_prefered_lft
/proc/sys/net/ipv6/conf/br-lan-ifb/temp_valid_lft
/proc/sys/net/ipv6/conf/br-lan-ifb/use_tempaddr
/proc/sys/net/ipv6/conf/default/temp_prefered_lft
/proc/sys/net/ipv6/conf/default/temp_valid_lft
/proc/sys/net/ipv6/conf/default/use_tempaddr
/proc/sys/net/ipv6/conf/eth0/temp_prefered_lft
/proc/sys/net/ipv6/conf/eth0/temp_valid_lft
/proc/sys/net/ipv6/conf/eth0/use_tempaddr
/proc/sys/net/ipv6/conf/eth1/temp_prefered_lft
/proc/sys/net/ipv6/conf/eth1/temp_valid_lft
/proc/sys/net/ipv6/conf/eth1/use_tempaddr
/proc/sys/net/ipv6/conf/eth2/temp_prefered_lft
/proc/sys/net/ipv6/conf/eth2/temp_valid_lft
/proc/sys/net/ipv6/conf/eth2/use_tempaddr
/proc/sys/net/ipv6/conf/eth3/temp_prefered_lft
/proc/sys/net/ipv6/conf/eth3/temp_valid_lft
/proc/sys/net/ipv6/conf/eth3/use_tempaddr
/proc/sys/net/ipv6/conf/eth4/temp_prefered_lft
/proc/sys/net/ipv6/conf/eth4/temp_valid_lft
/proc/sys/net/ipv6/conf/eth4/use_tempaddr
/proc/sys/net/ipv6/conf/gre0/temp_prefered_lft
/proc/sys/net/ipv6/conf/gre0/temp_valid_lft
/proc/sys/net/ipv6/conf/gre0/use_tempaddr
/proc/sys/net/ipv6/conf/ifb0/temp_prefered_lft
/proc/sys/net/ipv6/conf/ifb0/temp_valid_lft
/proc/sys/net/ipv6/conf/ifb0/use_tempaddr
/proc/sys/net/ipv6/conf/ifb1/temp_prefered_lft
/proc/sys/net/ipv6/conf/ifb1/temp_valid_lft
/proc/sys/net/ipv6/conf/ifb1/use_tempaddr
/proc/sys/net/ipv6/conf/ip6gre0/temp_prefered_lft
/proc/sys/net/ipv6/conf/ip6gre0/temp_valid_lft
/proc/sys/net/ipv6/conf/ip6gre0/use_tempaddr
/proc/sys/net/ipv6/conf/ip6tnl0/temp_prefered_lft
/proc/sys/net/ipv6/conf/ip6tnl0/temp_valid_lft
/proc/sys/net/ipv6/conf/ip6tnl0/use_tempaddr
/proc/sys/net/ipv6/conf/lo/temp_prefered_lft
/proc/sys/net/ipv6/conf/lo/temp_valid_lft
/proc/sys/net/ipv6/conf/lo/use_tempaddr
/proc/sys/net/ipv6/conf/ptm0/temp_prefered_lft
/proc/sys/net/ipv6/conf/ptm0/temp_valid_lft
/proc/sys/net/ipv6/conf/ptm0/use_tempaddr
/proc/sys/net/ipv6/conf/sit0/temp_prefered_lft
/proc/sys/net/ipv6/conf/sit0/temp_valid_lft
/proc/sys/net/ipv6/conf/sit0/use_tempaddr
/proc/sys/net/ipv6/conf/teql0/temp_prefered_lft
/proc/sys/net/ipv6/conf/teql0/temp_valid_lft
/proc/sys/net/ipv6/conf/teql0/use_tempaddr
/proc/sys/net/ipv6/conf/wl0/temp_prefered_lft
/proc/sys/net/ipv6/conf/wl0/temp_valid_lft
/proc/sys/net/ipv6/conf/wl0/use_tempaddr
/proc/sys/net/ipv6/conf/wl0_1/temp_prefered_lft
/proc/sys/net/ipv6/conf/wl0_1/temp_valid_lft
/proc/sys/net/ipv6/conf/wl0_1/use_tempaddr
/proc/sys/net/ipv6/conf/wl1/temp_prefered_lft
/proc/sys/net/ipv6/conf/wl1/temp_valid_lft
/proc/sys/net/ipv6/conf/wl1/use_tempaddr
/proc/sys/net/ipv6/conf/wl1_1/temp_prefered_lft
/proc/sys/net/ipv6/conf/wl1_1/temp_valid_lft
/proc/sys/net/ipv6/conf/wl1_1/use_tempaddr
/rom/bin/mktemp
/rom/etc/samba/smb.conf.template
/rom/usr/lib/lua/web/template.lua
/rom/usr/share/cups/templates
/usr/lib/lua/web/template.lua
/usr/share/cups/templates

@seud0nym
Copy link
Owner

Hmm. I don't understand why the CPU usage isn't showing. The change didn't make any difference - you are getting valid readings. I have to have a think on this and relook at how the code works when background updating is turned off.

So it looks like the TG799vac doesn't have any accessible thermal sensors. I will remove the processing and display for them.

@RexyAU
Copy link
Author

RexyAU commented Jan 20, 2023

https://archive.openwrt.org/chaos_calmer/15.05.1/brcm63xx/generic/packages/base/

Inside here there is some packages called kmod-hwmon-core and kmod-hwmon-temp for bcrm63xx chips. Maybe I should try installing them? It's the same place I found the working tc package from.

@seud0nym
Copy link
Owner

I don't think it will hurt to try, but I imagine kernel mods would require an exact kernel match. You can always remove them if they don't work.

A better source of packages for your device is: https://github.com/BoLaMN/brcm63xx-tch .That is where the tc package included with tch-gui-unhide is sourced from. The tch-gui-unhide installer will automatically deploy it if the tc command isn't found.

I have just done a pre-release that should fix both of your issues. The CPU Usage should be fixed, and Sensor Temperatures will be removed if no hardware monitors are found. You can apply the pre-release with this command:

./tch-gui-unhide -u && ./tch-gui-unhide

@RexyAU
Copy link
Author

RexyAU commented Jan 20, 2023

Tried updating and got stuck at:

Screenshot 2023-01-20 185300

It doesn't progress further and broke the GUI so i had to roll back to version 2022.12.31.


Also with the https://github.com/BoLaMN/brcm63xx-tch source, there is no tc package included in there. I would suggest using the one i found on the openwrt archive because it works. There is that other source by fex (https://github.com/fexofenadine/brcm63xx-tch/tree/master/base) but i remember when i tried installing the tc package from there it said malformed package and didn't install.

@seud0nym
Copy link
Owner

My apologies - this is a thing that always gets me (I forget to separate multi-line commands with ).

I have fixed it now, so please try again.

Also with the https://github.com/BoLaMN/brcm63xx-tch source, there is no tc package included in there.

I apologise - you are correct.

@RexyAU
Copy link
Author

RexyAU commented Jan 20, 2023

Screenshot 2023-01-20 194008

Screenshot 2023-01-20 194047

Success, all fixed.


For tc:
In /etc/opkg/distfeeds.conf i removed the broken sources and just have:

src/gz chaos_calmer https://archive.openwrt.org/chaos_calmer/15.05.1/brcm63xx/generic/packages/base

then did:
opkg update
opkg install tc

Screenshot 2023-01-20 200646

@RexyAU RexyAU closed this as completed Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants