OpenWRT CCTV project
To improve surveillance I bought another Y-cam Knight S as the Bullet HD was too rich for me at ~400GBP, and I figured if my upload is only 0.3 Mb/s, was there any point since HD images will probably be much bigger! I did look at other IP cameras, and since the camera module for the Raspberry PI seemed nowhere near ready and huge lead times, I opted for the devil I knew.
Since the Y-cam's Knights are unable to sanely upload via HTTP leaving me with FTP, I "hacked" my OpenWRT 10.03.1 flashed TP-Link TL-WR1043ND to become an intermediary upload hub. I added a USB key and a FTPd, rsync etc and this took 2 days of life for this.
First day went down to a botched upgrade. OpenWRT 10.03 to 10.03.1 did not go
well with LuCI going bust
/etc/config/luci seems to be corrupt. I
got it going again by relying on the failsafe mode and reset button.
After re-installing 10.03.1, I wasted a lot of time on getting the ext4 overlay working because I failed to specify ext4.
/dev/sda1 USB stick overlay was on, I had 8G of breathing space! Wow.
I installed syslog-ng3 to
get it logging nicely to papertrail.
The logs are helpful, but not the same as
Installing pure-ftpd was a little bit of a pain because
wasn't enabled and I almost went down a out of date OpenWRT
docs rathole with
option authentication 'unix' is fine!
I bothered creating a ycam user in
/etc/passwd but I could have easier
configured my Y-cams to simply upload as root.
Then I replaced dropbear with openssh and friends like
ssh-keygen. I created a
key for a new ycam user on one of my servers. Now to configure rsync like so:
if ! flock -n /var/lock/sync-cctv.lck -c "rsync -a --remove-source-files /home/ycam/ ycam@remote-server:" then logger already syncing fi
I'm a bit wary of using
--remove-source-files since the files might be still
being written by pure-ftpd. I tried it a few times and it seems to work.
I also don't quite understand
flock. It works, but why leave the lock file
around once finished? I don't quite understand how flock takes a lock and I
should have fleshed this lock out in
Getting the cron in openwrt 10.03.1 working was a bit of PITA since
is the only way to see output and it always gives it under a misleading
cron.err title. I found
*/5 * * * * sh /root/sync-cctv.sh works
On the server where the motion detected images are uploaded, I deployed software I call Praze with a slightly different way to sort the images and of course a user/pass. See the demo.
- Y-cam Knight cannot look out from an indoor window at night
- Need to play around with trigger times and determine if my upload channel is getting saturated