IceWhaleTech / CasaOS

CasaOS - A simple, easy-to-use, elegant open-source Personal Cloud system.
https://casaos.io
Apache License 2.0
25.82k stars 1.41k forks source link

[Alpha][Bug] No CPU temperature for AMD Ryzen #1384

Closed shatrix closed 1 year ago

shatrix commented 1 year ago

What happened?

Hi, the problem remains with AMD CPUs, I think you should use chekc for the thermal temp file, similar to what's happening with PiHole code, they chec for both files: /sys/devices/virtual/thermal/thermal_zone*/temp /sys/class/hwmon/hwmon0/temp1_input

Here: https://github.com/pi-hole/AdminLTE/blob/master/scripts/pi-hole/php/header_authenticated.php#L67-L73 Code: if (file_exists('/sys/class/thermal/thermal_zone0/temp')) { $output = rtrim(file_get_contents('/sys/class/thermal/thermal_zone0/temp')); } elseif (file_exists('/sys/class/hwmon/hwmon0/temp1_input')) { $output = rtrim(file_get_contents('/sys/class/hwmon/hwmon0/temp1_input')); } else { $output = ''; }

For me on my AMD PC (AMD Ryzen 3 1200), here's the output $ cat /sys/class/hwmon/hwmon0/temp1_input 30500

Could you please update the code?

Screenshots

Screenshot 2023-09-06 135031

shatrix commented 1 year ago

code location: https://github.com/IceWhaleTech/CasaOS/blob/4d8ca182cb49ea07cc3312b90f4ee99cbf5e7fd9/service/system.go#L455C53-L455C53

ghost commented 1 year ago

For 5800h $ cat /sys/class/hwmon/hwmon0/temp1_input efficient

LinkLeong commented 1 year ago

It has been put into version 0.4.4-3 and you can update it to give feedback on the status of the issue.

shatrix commented 1 year ago

Perfect, it's now working on my PC and my laptop as well. PC: AMD Ryzen 3 1200 Laptop: AMD Ryzen 7 4700U Here's a screenshot from my laptop

Thank you! Screenshot from 2023-10-06 19-39-31