Timelapse Camera w/ Canon EOS 350D

Raspberry, Kamera, DS18B20, Heizungsschalter
1. DS18B20 an GPIO4 -> Initialisierung laut Anleitung
2. Heizungsschalter an GPIO17
3. Script “heizung.sh”
#!/bin/bash
temp=`cat /sys/bus/w1/devices/10-00080309dc2a/w1_slave | grep t= | cut -c30-34`
#echo $temp
temp=`echo "scale=3; $temp / 1000" | bc`
datum=`date +"%F , %T"`
#temp=`expr $temp / 1000`
#echo 'Temp=' $temp
if [ `echo "$temp < 5" | bc` -eq 1 ]; then
echo "Temp<5°C: " $temp
# 0 = einschalten der Heizung
echo "0" > /sys/class/gpio/gpio17/value
# echo $datum "," $temp ", EIN" >> temperature.log
exit 0
else
echo "Temp≥5°C: " $temp
# 1 = ausschalten der Heizung
echo "1" > /sys/class/gpio/gpio17/value
# echo $datum "," $temp ", AUS" >> temperature.log
rrdtool update temperature_db.rrd N:$temp
sudo rrdtool graph /var/www/html/test.png DEF:temp01=temperature_db.rrd:temperaturwert:AVERAGE LINE:temp01#FF00FF:"Temp °C"
exit 0
fi
exit 1

4. Script “init_gpio17.sh”
#!/bin/bash
echo "17" > /sys/class/gpio/export
sudo chmod 222 /sys/class/gpio/export /sys/class/gpio/unexport
echo "out" > /sys/class/gpio/gpio17/direction

5. crontab (pi)
# m h dom mon dow command
@reboot /home/pi/init_gpio17.sh
* * * * * /home/pi/heizung.sh