Skip to content
Snippets Groups Projects
Commit 343e1c7b authored by dronus's avatar dronus
Browse files

zoneminder to teensy serial feed working

parent 83602e0f
Branches
No related tags found
No related merge requests found
#!/bin/bash #!/bin/bash
cd `dirname $0`
sleep 5
sudo stty -F /dev/ttyACM0 10:0:18b2:0:3:1c:7f:15:4:0:0:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
sleep 5
# make fifo, if it doesnt exist # make fifo, if it doesnt exist
mkfifo image_fifo mkfifo image_fifo
...@@ -7,5 +15,9 @@ mkfifo image_fifo ...@@ -7,5 +15,9 @@ mkfifo image_fifo
sleep 10000000 >image_fifo & sleep 10000000 >image_fifo &
# start the sender # start the sender
cat image_fifo | ./sender >/dev/ttyACM0 cat image_fifo | ./sender >/dev/ttyACM0 &
sudo stty -F /dev/ttyACM0 10:0:18b2:0:3:1c:7f:15:4:0:0:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
# start the zone minder controller
./zoneminder_controller.sh &
zone_schablone.png

2.93 KiB

#!/bin/bash #!/bin/bash
$OLDZONES="" OLDZONES=""
while true while true
do do
ZONES=`wget -O- 'http://localhost/zm/index.php?view=events&page=&reload=0&execute=0&action=&subaction=&line=&fid=&filterName=motion&filter%5Bterms%5D%5B0%5D%5Battr%5D=Cause&filter%5Bterms%5D%5B0%5D%5Bop%5D=%3D&filter%5Bterms%5D%5B0%5D%5Bval%5D=Motion&filter%5Bterms%5D%5B1%5D%5Bcnj%5D=and&filter%5Bterms%5D%5B1%5D%5Battr%5D=DateTime&filter%5Bterms%5D%5B1%5D%5Bop%5D=%3E&filter%5Bterms%5D%5B1%5D%5Bval%5D=15+seconds+ago&sort_field=DateTime&sort_asc=1&limit=1&AutoExecuteCmd=' | grep -o 'zone.'` ZONES=`wget -O- 'http://localhost/zm/index.php?view=events&page=&reload=0&execute=0&action=&subaction=&line=&fid=&filterName=motion&filter%5Bterms%5D%5B0%5D%5Battr%5D=Cause&filter%5Bterms%5D%5B0%5D%5Bop%5D=%3D&filter%5Bterms%5D%5B0%5D%5Bval%5D=Motion&filter%5Bterms%5D%5B1%5D%5Bcnj%5D=and&filter%5Bterms%5D%5B1%5D%5Battr%5D=DateTime&filter%5Bterms%5D%5B1%5D%5Bop%5D=%3E&filter%5Bterms%5D%5B1%5D%5Bval%5D=15+seconds+ago&sort_field=DateTime&sort_asc=1&limit=1&AutoExecuteCmd=' 2>/dev/null | grep -o 'zone.'`
if [ "$OLDZONES" != "$ZONES" ] if [ "$OLDZONES" != "$ZONES" ]
then then
OLDZONES="$ZONES" OLDZONES="$ZONES"
COMMAND="composite "; for ZONE in $ZONES; do COMMAND+="-compose plus $ZONE.png "; done COMMAND="convert black.png "; for ZONE in $ZONES; do COMMAND+=" $ZONE.png -compose plus -composite "; done
COMMAND+=" -compose plus black.png black.png rgba:image_fifo" COMMAND+="rgba:image_fifo"
echo $COMMAND echo $COMMAND
$COMMAND $COMMAND
sleep 3 # sleep 1
fi fi
sleep 1 sleep 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment