raspi - customs - /etc
[anomen-kernel-config.git] / raspi / customs / usr / local / bin / sensors.sh
blob4a1ee027e284ff331cc9ab92eea2ddef104120c9
1 #!/bin/sh
3 HEIGHT=303
5 echo Internal:
6 INTT=`/opt/vc/bin/vcgencmd measure_temp`
7 INTV=`/opt/vc/bin/vcgencmd measure_volts`
8 INTF=`sed -n -e 's/\(.*\)000/\1MHz/p' /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq`
9 INTG=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor`
10 echo "$INTT $INTV freq=$INTF $INTG"
13 for BMP in /sys/bus/i2c/drivers/bmp085/*-*
15 BT=`cat /sys/bus/i2c/drivers/bmp085/*/temp0_input`
16 BP=`cat /sys/bus/i2c/drivers/bmp085/*/pressure0_input`
17 # rel=(abs*9.80665*h)/(287*(273+t+(h/400)))+abs
18 python -c "print('temp=' + '{0:.1f}'.format($BT / 10.0) + '\'C press='+ '{0:.1f}'.format($BP / 100.0) + 'hPa relPress=' + '{0:.1f}'.format($BP / 100.0 + $HEIGHT / 8.3) + 'hPa' )"
19 done
21 echo External:
23 for A in /sys/bus/w1/devices/*/w1_slave
24 do
25 T=`sed -ne "s/.*t=\(\w\w\w\w\w\).*/\1/p" $A `
26 python -c "print('temp=' + '{0:.1f}'.format($T / 1000.0) + '\'C' )"
27 done
29 #sed -ne "s/.*t=\(\w\w\)\(\w\).*/temp=\1.\2'C/p" /sys/bus/w1/devices/*/w1_slave