Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8097

Advanced users • Re: Power Monitoring / System Health Monitoring on RPi 5?

$
0
0
You can see the CPU temperature, voltage and frequency using the 'vcgencmd' command.
Also:

Code:

cat /sys/devices/virtual/thermal/thermal_zone0/temp
or to get a little more fancy:

Code:

#!/bin/bash# without the sleep 100 ms, the freq is always maxsleep 0.1sfreq=$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq)temp=$(cat /sys/devices/virtual/thermal/thermal_zone0/temp)gov=$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor)[[ -f /sys/devices/platform/cooling_fan/hwmon/hwmon2/pwm1 ]] && pwm=$(cat /sys/devices/platform/cooling_fan/hwmon/hwmon2/pwm1)[[ -f /sys/devices/platform/cooling_fan/hwmon/hwmon2/fan1_input ]] && fan=$(cat /sys/devices/platform/cooling_fan/hwmon/hwmon2/fan1_input)echo "CPU temp        :  $(( temp / 1000 ))°C"echo "CPU freq        :  $(bc <<< "scale=0; $freq/1000") MHz with $gov"[[ -n $fan ]] && echo "Fan             :  $fan [$pwm]"

Statistics: Posted by graysky — Sat Mar 16, 2024 5:46 am



Viewing all articles
Browse latest Browse all 8097

Trending Articles