We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4d9ae1 commit ae8a768Copy full SHA for ae8a768
take_photo.sh
@@ -5,13 +5,18 @@
5
echo "18" > /sys/class/gpio/export
6
echo "out" > /sys/class/gpio/gpio18/direction
7
8
+# Turn on the led connected to the pin 18 of the RPI
9
echo "1" > /sys/class/gpio/gpio18/value
10
sleep 2
11
#Take a photo
12
fswebcam -d v4l2:/dev/video0 -r 640x480 -D 10 -F 100 -S 50 --no-banner /home/alarm/img/$(date +\%Y\%m\%d\%H\%M).jpeg &> /home/alarm/log
13
14
15
+
16
+# Turn of the led after the picture
17
echo "0" > /sys/class/gpio/gpio18/value
18
19
+# Workaround: The webcam stopes working after some time, if that happes we reboot the RPI
20
string=`cat /home/alarm/log | grep "VIDIOC_STREAMON: Broken pipe"`
21
22
if [ ! -z "$string" ]; then
0 commit comments