Posted: Wed Apr 16, 2014 21:54 Post subject: IP Cam Surveillance script.. A little help
So, it's like this :
1) WRT160NL ( Firmware: DD-WRT v24-sp2 (03/29/14) std)
2) Foscam fi8904w IP Cam
I'm trying to write a script that will monitor the cam and upon alarm triggered will record ~ 5min video to the usb drive
The road so far :
Code:
#!/bin/bash
cd /tmp/mnt/sda1/stuff
alarm="0"
check_alarm()
{
ls |grep status | xargs rm
wget "http://192.168.167.250:8000/get_status.cgi?user=stream&pwd=stream" -O status.txt
grep -q "alarm_status=1" status.txt && alarm="1"
}
while :
do
if alarm="1"; then
wget -Q20m "http://192.168.167.250:8000/videostream.asf?user=stream&pwd=stream" -O fi8904w_`date +%F_%H-%M-%S`.asf
else
sleep 10;
check_alarm()
fi
done
The idea is : monitor the get_status.cgi on the cam and if alarm status is active record 20MB =~ 5min of video.
Typing it in on the shell all works well, when I save it as foscam.sh I get all sorts of errors. Is there something terribly, noobishly wrong about my script. Total beginner here,mind you. Is there something wrong with my idea? Has it been done already ? Why won't it run?
Posted: Thu Feb 12, 2015 9:04 Post subject: FOSCAM recording and Script
Hello Ihstes..
this is very interesting, I was looking for a way to record from the FOSCAM cameras I have and I do not want to run a PC or a dedicated NVR system for this matter. I was thinking about the DDWRT I got on my LinkSys router WRT610N and found your post..
I am not that technical but I have the basics right.. do you mind if you can provide a more detailed steps on how to upload your script to the router and save it there and also is it possible that I can run this same script for more than one camera, I got 4 cameras that I would like to record when an alarm is triggered