Hi,
How can you display CPU temperature with Raspberry Pi?
Just enter the command line: "vcgencmd measure_temp". We get the answer: "temp = 39.5'C"
I understand that you should modify the file "system-status-lib.pl", very much ask for help as it should look.
It seems that you need to modify this code:
sub get_current_cpu_temps
{
my @rv;
if (!$config{'collect_notemp'} &&
$gconfig{'os_type'} =~ /-linux$/ && &has_command("sensors")) {
my $fh = "SENSORS";
&open_execute_command($fh, "sensors </dev/null 2>/dev/null", 1);
while(<$fh>) {
if (/Core\s+(\d+):\s+([\+\-][0-9\.]+)/) {
push(@rv, { 'core' => $1,
'temp' => $2 });
}
elsif (/CPU:\s+([\+\-][0-9\.]+)/) {
push(@rv, { 'core' => 0,
'temp' => $1 });
}
}
close($fh);
}
return @rv;
}
Best Regards,
Robert
What does it say when you run the commands
$ sensors
$ sensors-detect
$ sensors
Sensors do not detect CPU temperature sensors in Raspberry PI. The only possible reading of ARM CPU tempatures in Rapsberry PI is via the command: vcgencmd measure_temp
https://www.cyberciti.biz/faq/linux-find-out-raspberry-pi-gpu-and-arm-cpu-temperature-command
https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=34994
#!/bin/bash
# Script: my-pi-temp.sh
# Purpose: Display the ARM CPU and GPU temperature of Raspberry Pi 2/3
# Author: Vivek Gite <www.cyberciti.biz> under GPL v2.x+
# -------------------------------------------------------
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$(date) @ $(hostname)"
echo "-------------------------------------------"
echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp)"
echo "CPU => $((cpu/1000))'C"
The vcgencmd only shows the GPU temp (graphics chip).
The script above shows both the CPU (main ARM processor) and GPU temps.
I'm surprised these RPi temp sensors aren't detected by sensors-detect.
I made an issue on the lm-sensors package.
https://github.com/groeck/lm-sensors/issues/30
Thanks a lot Chris
Most helpful comment
The
vcgencmdonly shows the GPU temp (graphics chip).The script above shows both the CPU (main ARM processor) and GPU temps.
I'm surprised these RPi temp sensors aren't detected by
sensors-detect.I made an issue on the
lm-sensorspackage.https://github.com/groeck/lm-sensors/issues/30