Made a very quick and very dirty solution. To take image in less than 1 second interval
Like said, it is dirty. I don't have the knowledge to make a nice .sh without writting every line separate. But it works
I removed 3 line in the DZvents script, the next lines are removed.
Code: Select all
filler = string.rep('0',frameDigit - string.len(varTrig.value))
os.execute('wget -O "'..filePath..camName..filler..varTrig.value..'.jpg" "'..domoReq..'"')
varTrig.set(varTrig.value - 1).afterSec(varInterval)
This is replaced by one line
Code: Select all
os.execute('/home/pi/domoticz/scripts/CameravoordeurGIFmake.sh')
And an extra line is remove when variable is 0, this one is removed
Code: Select all
os.execute('rm '..filePath..camName..'*.*')
replaced by
Code: Select all
os.execute('/home/pi/domoticz/scripts/CameravoordeurGIFremove.sh')
Then i made 2 .sh files.
One which makes 10 pictures with 0.5sec interval
Code: Select all
#!/bin/sh
SnapFile001="/home/pi/dzGif/frame0001.jpg"
SnapFile002="/home/pi/dzGif/frame0002.jpg"
SnapFile003="/home/pi/dzGif/frame0003.jpg"
SnapFile004="/home/pi/dzGif/frame0004.jpg"
SnapFile005="/home/pi/dzGif/frame0005.jpg"
SnapFile006="/home/pi/dzGif/frame0006.jpg"
SnapFile007="/home/pi/dzGif/frame0007.jpg"
SnapFile008="/home/pi/dzGif/frame0008.jpg"
SnapFile009="/home/pi/dzGif/frame0009.jpg"
SnapFile010="/home/pi/dzGif/frame0010.jpg"
# Get snapshot via Domoticz server
wget -O $SnapFile001 "http://xxx.xxx.xxx.xxx/jpg/1/image.jpg"
sleep 0.500
wget -O $SnapFile002 "http://xxx.xxx.xxx.xxx/jpg/1/image.jpg"
sleep 0.500
wget -O $SnapFile003 "http://xxx.xxx.xxx.xxx/jpg/1/image.jpg"
sleep 0.500
wget -O $SnapFile004 "http://xxx.xxx.xxx.xxx/jpg/1/image.jpg"
sleep 0.500
wget -O $SnapFile005 "http://xxx.xxx.xxx.xxx/jpg/1/image.jpg"
sleep 0.500
wget -O $SnapFile006 "http://xxx.xxx.xxx.xxx/jpg/1/image.jpg"
sleep 0.500
wget -O $SnapFile007 "http://xxx.xxx.xxx.xxx/jpg/1/image.jpg"
sleep 0.500
wget -O $SnapFile008 "http://xxx.xxx.xxx.xxx/jpg/1/image.jpg"
sleep 0.500
wget -O $SnapFile009 "http://xxx.xxx.xxx.xxx/jpg/1/image.jpg"
sleep 0.500
wget -O $SnapFile010 "http://xxx.xxx.xxx.xxx/jpg/1/image.jpg"
sleep 0.500
# Set variable to 0
curl -g 'http://xxx.xxx.xxx.xxx:xxxx/json.htm?type=command¶m=updateuservariable&vname=TELEGRAM_Frames&vtype=0&vvalue=0'
And a second one, which removes the images when the .gif is made and send
Code: Select all
#!/bin/sh
SnapFile001="/home/pi/dzGif/frame0001.jpg"
SnapFile002="/home/pi/dzGif/frame0002.jpg"
SnapFile003="/home/pi/dzGif/frame0003.jpg"
SnapFile004="/home/pi/dzGif/frame0004.jpg"
SnapFile005="/home/pi/dzGif/frame0005.jpg"
SnapFile006="/home/pi/dzGif/frame0006.jpg"
SnapFile007="/home/pi/dzGif/frame0007.jpg"
SnapFile008="/home/pi/dzGif/frame0008.jpg"
SnapFile009="/home/pi/dzGif/frame0009.jpg"
SnapFile010="/home/pi/dzGif/frame0010.jpg"
SnapFile011="/home/pi/dzGif/frame.gif"
# Remove Image
/bin/rm $SnapFile001
/bin/rm $SnapFile002
/bin/rm $SnapFile003
/bin/rm $SnapFile004
/bin/rm $SnapFile005
/bin/rm $SnapFile006
/bin/rm $SnapFile007
/bin/rm $SnapFile008
/bin/rm $SnapFile009
/bin/rm $SnapFile010
/bin/rm $SnapFile011