Re: Read temp sensors from command line
Posted: Tue May 14, 2013 2:06 am
This is a great little script for us headless guys.
I run into an error however (and this is exactly how it prints in the terminal via ssh).
I'm not sure if I'm supposed to have something to run bc but it kicks that error out every time.
I'd love to read my temps in F*.
Thanks for any goodness...
P.S. The code I've got verbatim:
I run into an error however (and this is exactly how it prints in the terminal via ssh).
Code: Select all
pi@SteigerMotion ~ $ sh ./system-script.sh
Mon May 13 20:02:34 MDT 2013
Firmware Version
May 5 2013 13:06:56
Copyright (c) 2012 Broadcom
version 388665 (release)
./system-script.sh: 12: ./system-script.sh: bc: not found
-e temp: 'F (59.5'C)
-e arm: frequency(45)=700000000
-e core: frequency(1)=250000000
-e h264: frequency(28)=250000000
-e isp: frequency(42)=250000000
-e v3d: frequency(43)=250000000
-e uart: frequency(22)=3000000
-e pwm: frequency(25)=0
-e emmc: frequency(47)=100000000
-e pixel: frequency(29)=0
-e vec: frequency(10)=108000000
-e hdmi: frequency(9)=0
-e dpi: frequency(4)=0
-e core: volt=1.20V
-e sdram_c: volt=1.20V
-e sdram_i: volt=1.20V
-e sdram_p: volt=1.23V
-e H264: H264=enabled
-e MPG2: MPG2=disabled
-e WVC1: WVC1=disabled
pi pts/0 2013-05-13 19:53 (orion.openlug.com)
20:02:35 up 9 min, 1 user, load average: 0.84, 0.78, 0.49I'd love to read my temps in F*.
Thanks for any goodness...
P.S. The code I've got verbatim:
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/vcg$
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