Is it possible to read the temperature sensors from the command line?
I have the Pi at a remote location that I can access using ssh and I would like to read the current temperature.
Actually: we have. In fact we have several of them in different places on the silicon to check the silicon temperature. It is not generally known and there is no use in knowing as they requires some very special SW to access and read. To use them you have to go trough the Reset-Power-Clock manager module and we keep that closed also because if you do wrong things there you can accidentally over voltage the chip. Even we 'in-the-know' do not access registers in that module directly and prefer to use dedicated, tested and verified routines to do the work for us.AndrewS wrote:The Pi hardware doesn't include any temperature sensors. ....
Temperature is probably the most often sensed physical property. Whatever measurements I make on any system, I always include ambient temperature, because it has some measurable effect on almost everything and it's useful to correlate just how much effect that is. So if there was some way to have visibility of the chip temperature from the user space, that would be very useful. Obviously chip temp != ambient temp, but at constant system power draw and ambient airflow they will move together.Gert van Loo wrote:In fact we have several of them in different places on the silicon to check the silicon temperature.... Even we 'in-the-know' do not access registers in that module directly and prefer to use dedicated, tested and verified routines to do the work for us.
Just out of interest ...Gert van Loo wrote:Actually: we have. In fact we have several of them in different places on the silicon to check the silicon temperature. It is not generally known and there is no use in knowing as they requires some very special SW to access and read. To use them you have to go trough the Reset-Power-Clock manager module and we keep that closed also because if you do wrong things there you can accidentally over voltage the chip. Even we 'in-the-know' do not access registers in that module directly and prefer to use dedicated, tested and verified routines to do the work for us.AndrewS wrote:The Pi hardware doesn't include any temperature sensors. ....

The sensor is mainly there for adjusting sdram refresh with temperature (you need to refresh more at high temperature).Burngate wrote:Those sensors are there for a reason - does the blob read them at any time, and does it do anything with the readings? Such as dropping volts or frequency to reduce power?
Or is it just for you to check on how we broke it when it gets returned?
wow, that is great to have a protection like thatdom wrote:The sensor is mainly there for adjusting sdram refresh with temperature (you need to refresh more at high temperature).Burngate wrote:Those sensors are there for a reason - does the blob read them at any time, and does it do anything with the readings? Such as dropping volts or frequency to reduce power?
Or is it just for you to check on how we broke it when it gets returned?
The latest firmware does disable overclock/overvolt when it reaches 85'C which should bring it back down.
However at 24'C ambient, I couldn't get the temperature above 77'C with absolute maximum overclock/overvolt settings and stress testing ARM+GPU. I doubt if this limit will be hit by many.
Code: Select all
#!/bin/bash
clear
sleep 2
echo
date
echo
echo 'Firmware Version'
/opt/vc/bin/vcgencmd version
echo
tm=`/opt/vc/bin/vcgencmd measure_temp`
tc=`echo $tm| cut -d '=' -f2 | sed 's/..$//'`
tf=$(echo "scale=1; (1.8*$tc)+32" | bc)
echo -e "temp:\t $tf'F ($tc'C)"
#echo -e "temp:\t $(/opt/vc/bin/vcgencmd measure_temp)" ;
echo
for src in arm core h264 isp v3d uart pwm emmc pixel vec hdmi dpi ; do echo -e "$src:\t $(/opt/vc/bin/vcgencmd measure_clock $src)" ; done
for id in core ; do echo -e "$id:\t $(/opt/vc/bin/vcgencmd measure_volts $id)" ; done
for id in sdram_c sdram_i sdram_p ; do echo -e "$id: $(/opt/vc/bin/vcgencmd measure_volts $id)" ; done
for codec in H264 MPG2 WVC1 ; do echo -e "$codec:\t $(/opt/vc/bin/vcgencmd codec_enabled $codec)" ; done
echo
who
echo
uptime
echo
Code: Select all
Sun Apr 28 08:30:40 PDT 2013
Firmware Version
Apr 25 2013 01:07:36
Copyright (c) 2012 Broadcom
version 386589 (release)
temp: 88.7'F (31.5'C)
arm: frequency(45)=700000000
core: frequency(1)=250000000
h264: frequency(28)=0
isp: frequency(42)=250000000
v3d: frequency(43)=250000000
uart: frequency(22)=3000000
pwm: frequency(25)=0
emmc: frequency(47)=100000000
pixel: frequency(29)=108000000
vec: frequency(10)=0
hdmi: frequency(9)=163682000
dpi: frequency(4)=0
core: volt=1.20V
sdram_c: volt=1.20V
sdram_i: volt=1.20V
sdram_p: volt=1.23V
H264: H264=enabled
MPG2: MPG2=disabled
WVC1: WVC1=disabled
pi tty2 2013-04-25 20:13
pi ttyAMA0 2013-04-27 13:36
08:30:40 up 2 days, 12:54, 2 users, load average: 0.18, 0.27, 0.42