Added probe scripts

pull/2/head
Aaron Johnson 6 years ago
parent 7365a15886
commit 8ab721d801

@ -0,0 +1,14 @@
#!/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

@ -0,0 +1,8 @@
#/usr/bin/env sh
# Symlink this script to heatbot_gettemp if you need to test a probe's connection
# without retrieving real temperature numbers. This is useful in setup such as before
# the sensor hardware is available to use.
echo $((-20 + $RANDOM % 60)).$((10 + $RANDOM % 89)) || exit 1
exit 0
Loading…
Cancel
Save