Sergey B.

Home surveillance DIY and linux

Some time ago I stumbled across Oco2 Indiegogo project - advertised as next generation FullHD camera with local and cloud storage. I immediately thought about our Chinese friends, surely they have already come up with something similar and much cheaper (let’s forget about quality for a second).

And indeed, there exists Xiaomi Yi Home Camera. It can be purchased for as low as $35 at http://www.aliexpress.com/.

As always there is a catch: by default, this camera requires Xiaomi account and constant connection to Chineese servers. Luckily our Russian friends are on a high horse again - camera runs linux and can be updated to allow telnet/ftp/rtsp if necessary.

Now I have this camera running simple CCTV at my home, but what if you want to upload video to a cloud service for safe keeping? This can also be done, here’s how I pulled it off with some help from my ASUS RT-N56U router:

Enable FTP server on Xiami camera. Used an awesome lfpt to sync camera records directory with a folder on a router, this command did the trick:

lftp -u root,1234qwer -e "mirror --delete /home/hd1/record/ /media/camera/;quit” 192.168.1.55

First path points to the directory on a camera, second one is the destination folder on a router and lastly, ip address at the end also belong to CCTV. Mirror –delete helps keep destination directory tidy by deleting files removed from the source folder.

Then, using another awesome tool - Dropbox-Uploader push all these files to the cloud:

dropbox_uploader -f /opt/etc/.dropbox_uploader upload /media/camera /

Last step is to add both commands to cron, and bob’s your uncle!