Install motion eye on Raspberry Pi for surveillance.

Decided to go on a month long vacation leaving the home all by itself. This was the perfect opportunity to put a home surveillance system in place. There was nothing I could do remotely if anything happened, but would not want to let go the jackasses who broke in!

Hardware in use

  • Raspberry Pi 2 (will work with 3 too!)
  • Logitech 720p old web cam
  • Sony PS3 Eye 480p web cam
  • 64GB SD card for OS and data capture. 

I tore the "Easy carry Ziplock" box on the sides for the cables to pass thru. It was placed near the window, and I did not want to leave the pi running naked, since I did not have a proper enclosure, put it in this box. Placed two cameras around the room, one on the lamp, which would monitor 4 entry/exit points in the house, and the other one near the porch to monitor if anyone was approaching the front door. 




Steps to install MotionEye 
# upgrade raspi-config
sudo raspi-config
# Install all the essentails required to get motioneye working.
# The command fails as ffmpeg does not exist on rpi repository, so you need to download and build it from scratch
apt-get install build-essential autoconf libjpeg-dev libavformat-dev libavcodec-dev libswscale-dev ffmpeg subversion git
sudo apt-get install build-essential autoconf libjpeg-dev libavformat-dev libavcodec-dev libswscale-dev ffmpeg subversion git
# Install ffmpeg source and compile
cd /usr/src/
sudo git clone git://source.ffmpeg.org/ffmpeg.git
sudo git clone git://git.videolan.org/x264
# First x264. All commands have sudo, as i don't prefer sudo -su
cd x264/
sudo ./configure --host=arm-unknown-linux-gnueabi --enable-static --disable-opencl
sudo make
sudo make install
# Now fmpeg
cd ../ffmpeg/
sudo ./configure --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree
# On Pi2, use all 4 cores of the Pi
sudo make -j4
sudo make --install
sudo make install
sudo apt-get install build-essential autoconf libjpeg-dev libavformat-dev libavcodec-dev libswscale-dev git
# now compiling motioneye
sudo git clone https://github.com/Mr-Dave/motion.git motion
cd motion/
sudo ./configure --prefix=/usr --with-ffmpeg=/usr/lib/arm-linux-gnueabihf --with-ffmpeg-headers=/usr --without-pgsql --without-sdl --without-sqlite3 --without-mysql
sudo autoreconf
sudo ./configure --prefix=/usr --with-ffmpeg=/usr/lib/arm-linux-gnueabihf --with-ffmpeg-headers=/usr --without-pgsql --without-sdl --without-sqlite3 --without-mysql
sudo make -j 4
sudo make install
# test motion, ffmpeg
motion
ffmpeg
# python upgrade (2.7)
sudo apt-get install python-pip python-dev libssl-dev libcurl4-openssl-dev libjpeg-dev
sudo pip install motioneye
sudo mkdir -p /etc/motioneye
sudo cp /usr/local/share/motioneye/extra/motioneye.conf.sample /etc/motioneye/motioneye.conf
sudo mkdir -p /var/lib/motioneye
sudo cp /usr/local/share/motioneye/extra/motioneye.systemd-unit-local /etc/systemd/system/motioneye.service
# to figoure out the changes to be made here, read the documentation.
sudo vim /etc/motioneye/motioneye.conf

Comments

Popular posts from this blog

Customizing JIRA workflow

2 DTO or not 2 DTO