Raspberry Pi IP camera with Motion

Using a Raspberry Pi and Camera module you can build yourself a simple IP camera, using Motion.

What you’ll need

– Raspberry Pi Zero Wireless – $10
– Camera module – $9
– Power supply – $5
– SD card – $6

Download and install the latest version of Raspbian onto your SD card, I used the lite version for this project, as I didn’t need a graphical user interface. Setup the wifi and you are ready to get started.

Setup

We need to setup the Pi first, run this command and make the following changes

sudo raspi-config

– Enable ssh
– Enable camera
– Enable boot to command prompt (automatic login)
– Update the default user password

From here you can now do everything over SSH, if that’s easier for you.

We’ll get started by updating Raspbian:

sudo apt-get update
sudo apt-get dist-upgrade

Then install the motion software

wget https://github.com/Motion-Project/motion/releases/download/release-4.0.1/pi_jessie_motion_4.0.1-1_armhf.deb
sudo apt-get install gdebi-core
sudo gdebi pi_jessie_motion_4.0.1-1_armhf.deb

Configure

We’ll make a folder to hold our new config file

mkdir ~/.motion

You can then either copy in the default configuration and edit it yourself, or use mine

cp /etc/motion/motion.conf ~/.motion/motion.conf
sudo nano ~/.motion/motion.conf

Note: You’ll probably want to update the password on line 519

Start

To start motion you can run this command:

motion -c ~/.motion/motion.conf

To start motion on boot you can edit the rc.local file

sudo nano /etc/rc.local

Add in the following line, then reboot

motion -c /home/pi/.motion/motion.conf &

Next steps

Using MotionEye, you can create a hub to view all the cameras in your house/office/hackspace, instructions can be found here