CasaOS icon indicating copy to clipboard operation
CasaOS copied to clipboard

[Feature request] Support AMD CPUs for WebUI CPU Watt usage and Temperature

Open IaonnisPrysma opened this issue 2 years ago • 11 comments
trafficstars

Is your feature request related to a problem? Please describe.

Is frustrating to not be able to see the power usage and temperature of the CPU, I know I can see it with powertop and lm-sensors as I have been doing since using CasaOS. Still not ideal for seeing it faster My CPU is an Ryzen 3 3200U, the device used as server is a laptop, I'm using Debian 11 minimal with nothing but basic system utils and OpenSSH.

image

Describe the solution you'd like To have on the UI the Temperature and Watt usage on AMD CPUs

Additional context Consider it would be a luxury to also have CPU frecuencies (by core) on some place on the WebUI. Anyways I'm grateful for this software, has been really good for my DDNS, Game servers and File hosting.

IaonnisPrysma avatar May 25 '23 06:05 IaonnisPrysma

Can you try this command to see if you can read the cpu temperature? cat /sys/class/thermal/thermal_zone0/temp

raller1028 avatar May 25 '23 07:05 raller1028

cat /sys/class/thermal/thermal_zone0/temp](cat: /sys/class/thermal/thermal_zone0/temp: No such file or directory

Is that file part of a package I can download? I read temps with lm-sensors

IaonnisPrysma avatar May 25 '23 14:05 IaonnisPrysma

@IaonnisPrysma Is it convenient to look at this path '/sys/devices/virtual/thermal/thermal_zone0/temp' if not, look at '/sys/devices/virtual/thermal' to see what's under this path

LinkLeong avatar May 29 '23 02:05 LinkLeong

I tried all path and all of them give "No data available" I also tried "cat /sys/class/thermal/thermal_zone*/temp" I found nothing I'm on ubuntu server last version also with amd cpu

Nsbx avatar Jun 12 '23 16:06 Nsbx

@Nsbx Can you check the temperature of the cpu with other third party tools, or command line commands?

raller1028 avatar Jun 13 '23 06:06 raller1028

I personally can with powertop (already included in my system) and lm-sensors (needs to be downloaded)

I'm on lastest debian with only basic components and ssh server, no desktop.

IaonnisPrysma avatar Jun 13 '23 07:06 IaonnisPrysma

@IaonnisPrysma

Issue with CPU temperature showing as 0

Currently, CasaOS only supports temperature readings directly provided by the CPU and does not support readings from external sensors. image To confirm the type of temperature monitoring device your system is using, you can use the following command: cat /sys/devices/virtual/thermal/thermal_zone*/type To obtain the temperature reading from the corresponding device, use the following command: cat /sys/devices/virtual/thermal/thermal_zone*/temp Here are some examples: image {"cpu-thermal": "39704"} image {"acpitz": "31000", "x86_pkg_temp": "31000"} For more types of temperature readings, refer to this link

raller1028 avatar Jul 04 '23 10:07 raller1028

If still have problems, please reopen

raller1028 avatar Jul 13 '23 09:07 raller1028

If still have problems, please reopen

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, the 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, here's the output $ cat /sys/class/hwmon/hwmon0/temp1_input 30500

Could you please update the code?

shatrix avatar Sep 06 '23 11:09 shatrix

Still no read outs

akapower avatar Jan 27 '24 17:01 akapower

@shatrix Do you have any ideas?

LinkLeong avatar Feb 20 '24 10:02 LinkLeong