htop icon indicating copy to clipboard operation
htop copied to clipboard

Can't display cpu temperature on rock pi 4

Open CodeChenL opened this issue 3 years ago • 20 comments

image Main branch is used

CodeChenL avatar Feb 08 '22 13:02 CodeChenL

Can you please provide sensors -u output?

fasterit avatar Feb 08 '22 18:02 fasterit

Can you please provide sensors -u output?

rock@rockpi4b:~$ sensors -u
No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.
rock@rockpi4b:~$ sensors-detect
You need to be root to run this script.
rock@rockpi4b:~$ sudo sensors-detect
# sensors-detect version 3.6.0
# Kernel: 4.4.154-113-rockchip-gdb9dfc2cdd25 aarch64
# Cannot show processor info on aarch64 architecture.

This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.

Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no):
modprobe: FATAL: Module cpuid not found in directory /lib/modules/4.4.154-113-rockchip-gdb9dfc2cdd25
Failed to load module cpuid.
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   No
AMD Family 10h thermal sensors...                           No
AMD Family 11h thermal sensors...                           No
AMD Family 12h and 14h thermal sensors...                   No
AMD Family 15h thermal sensors...                           No
AMD Family 16h thermal sensors...                           No
AMD Family 17h thermal sensors...                           No
AMD Family 15h power sensors...                             No
AMD Family 16h power sensors...                             No
Hygon Family 18h thermal sensors...                         No
Intel digital thermal sensor...                             No
Intel AMB FB-DIMM thermal sensor...                         No
Intel 5500/5520/X58 thermal sensor...                       No
VIA C7 thermal sensor...                                    No
VIA Nano thermal sensor...                                  No

Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
Do you want to probe the I2C/SMBus adapters now? (YES/no):
Sorry, no supported PCI bus adapters found.

Next adapter: rk3x-i2c (i2c-0)
Do you want to scan it? (YES/no/selectively):
Client found at address 0x1b
Handled by driver `rk808' (built-in), chip type `rk808'
    (note: this is probably NOT a sensor chip!)
Client found at address 0x50
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 No
Probing for `EDID EEPROM'...                                No
Client found at address 0x51
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 No
Client found at address 0x52
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 No
Client found at address 0x53
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 No

Next adapter: rk3x-i2c (i2c-1)
Do you want to scan it? (YES/no/selectively):

Next adapter: DesignWare HDMI (i2c-9)
Do you want to scan it? (YES/no/selectively):

Sorry, no sensors were detected.
Either your system has no sensors, or they are not supported, or
they are connected to an I2C or SMBus adapter that is not
supported. If you find out what chips are on your board, check
https://hwmon.wiki.kernel.org/device_support_status for driver status.

CodeChenL avatar Feb 09 '22 08:02 CodeChenL

@CodeChenL: htop depends on libsensors to show the CPU temperature. Your libsensors does not seem to support reading sensors from your hardware. That's why htop can't show you temperatures.

fasterit avatar Feb 09 '22 09:02 fasterit

The specific rockpi kernel may have some temperature information in /sys/class/thermal/thermal_zone0/temp according to the Interwebs. You could check that and if there is some documentation on how to interpret the values, we would have something to work with.

fasterit avatar Feb 09 '22 09:02 fasterit

@CodeChenL:取决于显示 CPU 温度。您的似乎不支持从硬件读取传感器。这就是为什么不能显示温度的原因。htop``libsensors``libsensors``htop

But the htop installed in this ubuntu apt can display the temperature. But it shows error on exit. like: image Even the gpu temperature image Error when exiting

rock@rockpi4b:~$ htop


htop 2.2.2 aborting. Please report bug at http://hisham.hm/htop

Please include in your report the following backtrace:
htop(CRT_handleSIGSEGV+0x44)[0x556d06c2b4]
linux-vdso.so.1(__kernel_rt_sigreturn+0x0)[0x7f845096c0]
/lib/aarch64-linux-gnu/libc.so.6(cfree+0x24)[0x7f84298df4]
htop(String_freeArray+0x24)[0x556d0604b4]
htop(Header_writeBackToSettings+0x68)[0x556d058778]
htop(+0x1fc44)[0x556d066c44]
htop(+0x10774)[0x556d057774]
htop(ScreenManager_run+0x21c)[0x556d05e5c4]
htop(main+0x40c)[0x556d054e9c]
/lib/aarch64-linux-gnu/libc.so.6(__libc_start_main+0xe8)[0x7f84240090]
htop(+0xe150)[0x556d055150]

Additionally, in order to make the above backtrace useful,
please also run the following command to generate a disassembly of your binary:

   objdump -d `which htop` > ~/htop.objdump

and then attach the file ~/htop.objdump to your bug report.

Thank you for helping to improve htop!

Aborted (core dumped)

This is the file generated by objdump -d which htop > ~/htop.objdump https://blog.chenjaly.cn/htop.objdump

CodeChenL avatar Feb 09 '22 09:02 CodeChenL

rock@rockpi4b:~$ cat /sys/class/thermal/thermal_zone0/temp
42222

can actually read the value

CodeChenL avatar Feb 09 '22 09:02 CodeChenL

@CodeChenL:取决于显示 CPU 温度。您的似乎不支持从硬件读取传感器。这就是为什么不能显示温度的原因。 htoplibsensorslibsensorshtop ``

But the htop installed in this ubuntu apt can display the temperature. But it shows error on exit. like: image Even the gpu temperature image Error when exiting

rock@rockpi4b:~$ htop


htop 2.2.2 aborting. Please report bug at http://hisham.hm/htop

 Please include in your report the following backtrace:
htop(CRT_handleSIGSEGV+0x44)[0x556d06c2b4]
linux-vdso.so.1(__kernel_rt_sigreturn+0x0)[0x7f845096c0]
/lib/aarch64-linux-gnu/libc.so.6(cfree+0x24)[0x7f84298df4]
htop(String_freeArray+0x24)[0x556d0604b4]
htop(Header_writeBackToSettings+0x68)[0x556d058778]
htop(+0x1fc44)[0x556d066c44]
htop(+0x10774)[0x556d057774]
htop(ScreenManager_run+0x21c)[0x556d05e5c4]
htop(main+0x40c)[0x556d054e9c]
/lib/aarch64-linux-gnu/libc.so.6(__libc_start_main+0xe8)[0x7f84240090]
htop(+0xe150)[0x556d055150]

Additionally, in order to make the above backtrace useful,
please also run the following command to generate a disassembly of your binary:

   objdump -d `which htop` > ~/htop.objdump

and then attach the file ~/htop.objdump to your bug report.

Thank you for helping to improve htop!

Aborted (core dumped)

This is the file generated by which htop https://blog.chenjaly.cn/htop.objdumpobjdump -d `` > ~/htop.objdump This is the source code I downloaded via sudo apt-get source htop

rock@rockpi4b:~$ sudo apt-get source htop
Reading package lists... Done
NOTICE: 'htop' packaging is maintained in the 'Git' version control system at:
https://salsa.debian.org/debian/htop.git
Please use:
git clone https://salsa.debian.org/debian/htop.git
to retrieve the latest (possibly unreleased) updates to the package.
Need to get 306 kB of source archives.
Get:1 http://ports.ubuntu.com/ubuntu-ports focal/main htop 2.2.0-2build1 (dsc) [2262 B]
Get:2 http://ports.ubuntu.com/ubuntu-ports focal/main htop 2.2.0-2build1 (tar) [292 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports focal/main htop 2.2.0-2build1 (asc) [819 B]
Get:4 http://ports.ubuntu.com/ubuntu-ports focal/main htop 2.2.0-2build1 (diff) [11.0 kB]
Fetched 306 kB in 2s (123 kB/s)
dpkg-source: info: extracting htop in htop-2.2.0
dpkg-source: info: unpacking htop_2.2.0.orig.tar.gz
dpkg-source: info: unpacking htop_2.2.0-2build1.debian.tar.xz
dpkg-source: info: using patch list from debian/patches/series
dpkg-source: info: applying 780-fix-option-string.patch
dpkg-source: info: applying fix-linux-process.patch
dpkg-source: info: applying python3.patch
W: Download is performed unsandboxed as root as file 'htop_2.2.0-2build1.dsc' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

https://blog.chenjaly.cn/htop.zip

CodeChenL avatar Feb 09 '22 09:02 CodeChenL

@CodeChenL:取决于显示 CPU 温度。您的似乎不支持从硬件读取传感器。这就是为什么不能显示温度的原因。libsensorshtop '' htop``libsensors

但是这个ubuntu apt中安装的htop可以显示温度。但它在退出时显示错误。比如: image 退出时甚至GPU温度image错误

rock@rockpi4b:~$ htop


htop 2.2.2 aborting. Please report bug at http://hisham.hm/htop

 Please include in your report the following backtrace:
htop(CRT_handleSIGSEGV+0x44)[0x556d06c2b4]
linux-vdso.so.1(__kernel_rt_sigreturn+0x0)[0x7f845096c0]
/lib/aarch64-linux-gnu/libc.so.6(cfree+0x24)[0x7f84298df4]
htop(String_freeArray+0x24)[0x556d0604b4]
htop(Header_writeBackToSettings+0x68)[0x556d058778]
htop(+0x1fc44)[0x556d066c44]
htop(+0x10774)[0x556d057774]
htop(ScreenManager_run+0x21c)[0x556d05e5c4]
htop(main+0x40c)[0x556d054e9c]
/lib/aarch64-linux-gnu/libc.so.6(__libc_start_main+0xe8)[0x7f84240090]
htop(+0xe150)[0x556d055150]

Additionally, in order to make the above backtrace useful,
please also run the following command to generate a disassembly of your binary:

   objdump -d `which htop` > ~/htop.objdump

and then attach the file ~/htop.objdump to your bug report.

Thank you for helping to improve htop!

Aborted (core dumped)

这是 htop 生成的文件 https://blog.chenjaly.cn/htop.objdump'objdump -d '' > ~/htop.objdumpsudo apt-get source htop'This is the source code I downloaded via

rock@rockpi4b:~$ sudo apt-get source htop
Reading package lists... Done
NOTICE: 'htop' packaging is maintained in the 'Git' version control system at:
https://salsa.debian.org/debian/htop.git
Please use:
git clone https://salsa.debian.org/debian/htop.git
to retrieve the latest (possibly unreleased) updates to the package.
Need to get 306 kB of source archives.
Get:1 http://ports.ubuntu.com/ubuntu-ports focal/main htop 2.2.0-2build1 (dsc) [2262 B]
Get:2 http://ports.ubuntu.com/ubuntu-ports focal/main htop 2.2.0-2build1 (tar) [292 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports focal/main htop 2.2.0-2build1 (asc) [819 B]
Get:4 http://ports.ubuntu.com/ubuntu-ports focal/main htop 2.2.0-2build1 (diff) [11.0 kB]
Fetched 306 kB in 2s (123 kB/s)
dpkg-source: info: extracting htop in htop-2.2.0
dpkg-source: info: unpacking htop_2.2.0.orig.tar.gz
dpkg-source: info: unpacking htop_2.2.0-2build1.debian.tar.xz
dpkg-source: info: using patch list from debian/patches/series
dpkg-source: info: applying 780-fix-option-string.patch
dpkg-source: info: applying fix-linux-process.patch
dpkg-source: info: applying python3.patch
W: Download is performed unsandboxed as root as file 'htop_2.2.0-2build1.dsc' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

https://blog.chenjaly.cn/htop.zip

@fasterit friend,can add in main?

CodeChenL avatar Feb 11 '22 02:02 CodeChenL

@CodeChenL: can you do ls /sys/class/thermal/thermal_zone* and cat type for each directory where that exists, please?

fasterit avatar Feb 11 '22 08:02 fasterit

I will do this within 12 hours. Trouble teach how to cat type, I only knowcat

CodeChenL avatar Feb 11 '22 08:02 CodeChenL

@CodeChenL type is the name of a file you find in the various thermal_zone* directories. It identifies the sensor ... type.

fasterit avatar Feb 11 '22 08:02 fasterit

@CodeChenL是在各个目录中找到的文件的名称。它识别传感器...类型。type``thermal_zone*

how to identifies the sensor ... type. Also, my English is not very good, please forgive me

CodeChenL avatar Feb 11 '22 08:02 CodeChenL

不用担心。有翻譯工具可用於理解其含義。

在@fasterit 提到的文件夹中有几个描述各种传感器的文件。文件 type 包含传感器类型。

BenBE avatar Feb 11 '22 09:02 BenBE

不用担心。有翻譯工具可用於理解其含義。

在@fasterit 提到的文件夹中有几个描述各种传感器的文件。文件 包含传感器类型。type

我只知道如何列出文件夹内的文件,不知道如何分辨传感器类型

CodeChenL avatar Feb 11 '22 09:02 CodeChenL

不用担心。有翻譯工具可用於理解其含義。 在@fasterit 提到的文件夹中有几个描述各种传感器的文件。文件 包含传感器类型。type

我只知道如何列出文件夹内的文件,不知道如何分辨传感器类型

您可以使用 cd /path/to/folder 命令切換當前工作目錄。該文件夾中的文件使用 ls -la 列出。要查看文件的內容,您可以使用 cat name_of_the_file。查看名為“type”的文件的內容時,可以看到傳感器類型。

BenBE avatar Feb 11 '22 09:02 BenBE

@BenBE 了解了,非常感谢,我将在半小时后下班,预计一小时内完成

CodeChenL avatar Feb 11 '22 09:02 CodeChenL

@BenBE @faster respect,i do it!!!

➜  ~ cd /sys/class/thermal/thermal_zone0
➜  thermal_zone0 ls
available_policies  cdev2_weight     power              trip_point_1_temp
cdev0               integral_cutoff  slope              trip_point_1_type
cdev0_trip_point    k_d              subsystem          trip_point_2_hyst
cdev0_weight        k_i              sustainable_power  trip_point_2_temp
cdev1               k_po             temp               trip_point_2_type
cdev1_trip_point    k_pu             trip_point_0_hyst  type
cdev1_weight        mode             trip_point_0_temp  uevent
cdev2               offset           trip_point_0_type
cdev2_trip_point    policy           trip_point_1_hyst
➜  thermal_zone0 cat type
soc-thermal
➜  thermal_zone0 cd /sys/class/thermal/thermal_zone1
➜  thermal_zone1 cat type
gpu-thermal

CodeChenL avatar Feb 11 '22 10:02 CodeChenL

file you find in th Added, almost forgotls thermal_zone1

➜  ~ cd /sys/class/thermal/thermal_zone1
➜  thermal_zone1 ls
available_policies  k_d  k_po  mode    passive  power  subsystem          temp  uevent
integral_cutoff     k_i  k_pu  offset  policy   slope  sustainable_power  type

CodeChenL avatar Feb 11 '22 12:02 CodeChenL

I ran into this issue with Rockchip 3588. Probably my hack addresses this issue as well https://github.com/htop-dev/htop/pull/1411

segabor avatar Mar 11 '24 08:03 segabor

Good work

CodeChenL avatar Mar 11 '24 08:03 CodeChenL