You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
388 B
15 lines
388 B
#!/usr/bin/env sh
|
|
|
|
#Modify this to point to your temperature probe
|
|
dir=/sys/bus/w1/devices/[some-hexadecimals]
|
|
|
|
# DO NOT MODIFY
|
|
|
|
# Sanity check
|
|
which bc 2>&1 >/dev/null || { echo "PROBE ERROR: 'bc' not found. Please install bc." >&2; exit 1; }
|
|
|
|
# Retrieve temperature in Celsius
|
|
raw=$(grep 't=' $dir/w1_slave | awk -F'=' '{print $2}')
|
|
echo "scale=3; ${raw}/1000" | bc -l && exit 0
|
|
exit 1
|