Raspberry Pi as Surveillance Cam

Install Raspbian

Here you will find a quick guide for installing a Raspbian image. For windows it should be roughly the same as the guide below for other operating systems follow this link. http://www.raspberrypi.org/documentation/installation/installing-images

Step 1 - Install Win32DiskImager

Run Win32DiskImager-0.9.5-install.exe.
Click on Next.
Read the license agreement and choose if you want to accept the agreement or not and click Next.
Optional you can change your installation path and click Next.
Optional you can change the start menu folder name and click Next.
Option to create a desktop icon for this program and click Install.
Option to view README.txt and uncheck Launch Win32DiskImager and click Finish.

Step 2 - Copy Raspbian image to the SD card

Put the SD card in the card reader of your computer.
Be sure you have got everything backed up what is on the SD card. The card will be wiped completely.
Extract 2014-12-24-wheezy-raspbian.zip.
Run Win32DiskImager as administrator. Right click on the program and select Run as administrator.
Select SD card as Device. In my case [O:\].
Select the image file 2014-12-24-wheezy-raspbian.img you just unzipped.
Click on Write to write the image to the SD card.
If the write was not successful, check the write protect switch on your SD card and try again.
If the program tell you Write successful click OK.
Close Win32DiskImager and safely remove SD card from computer.

Step 3 - Boot the Raspberry Pi for the first time and go trough the setup

Put SD card in the Raspberry Pi.
Connect monitor and USB keyboard.
Connect network cable to your home network.
Plug in the power and let the Raspberry Pi boot for the first time.
After a while you will get an setup menu.
First go for option 1, so your Raspberry Pi can use the complete SD card for its file system.
Second go for option 2, and you can change the default password for security reasons.
In this tutorial I will leave it the default password which is raspberry.
Finish the setup and reboot the Raspberry Pi.

Step 4 - Give the Raspberry Pi a static IP address

The Raspberry Pi needs a static IP address in order to be found by a NAS or by you when you connect to the Pi via the network. Make sure the IP address you are going to use for the Pi is not in use by an other device on the network. In case of my home network I am going to use 192.168.0.200 as IP address for the Pi. The router in my network has the IP address 192.168.0.1. This is the gateway for the Pi to access the internet.

Log in as user pi with password raspberry (or password you configured at step 3)
Make yourself a root user by entering the following command.

sudo su

Only as root you are allowed to change the IP settings. Open /etc/network/interfaces with nano to edit the IP settings.
nano /etc/network/interfaces

Change the file which looks like this
auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
in
auto lo

iface lo inet loopback
iface eth0 inet static
        address 192.168.0.200
        netmask 255.255.255.0
        gateway 192.168.0.1

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Use Ctrl+O to save the file and press Enter to confirm.
Press Ctrl+X to exit nano.

To activate this change you have to bring down the Ethernet device and start it again. Only do this with screen and keyboard connected to your Pi. If you do it in Putty you will shut yourself out. Run this command to bring the Ethernet device down.

ifdown eth0

To start the Ethernet device run this command.

ifup eth0

Run the following command to check if your changes are succesful.

ifconfig

Step 5 - Connect via network to the Pi

For remote login you can use many different SSH clients. For this tutorial you can use Putty. Your computer has to be connected to the same network as the Raspberry Pi in order to gain access with Putty.
Run Putty.exe
Enter the IP you gave your Raspberry Pi at step 4. In case of my home network configuration it is 192.168.0.200.
Make sure that the connection type is SSH.
Click on Open to connect to your Raspberry Pi.
You can login with username pi and password raspberry (or password you configured at step 3)
If login is successful, you don't need the USB keyboard and monitor anymore.

Step 6 - Update and upgrade the Pi

Updating and upgrading your raspberry pi with the latest security updates is important, but it might take a while. This depends on the amount of updates released between the date of the image and now.
Make yourself a root user by entering the following command.

sudo su

Update the package manager apt-get with the most recent list of updates.

apt-get update

Upgrade the packages already installed to the recent versions. You may get questions about memory that is going to be used or freed by updated packages. You can answer them with Y or Enter.

apt-get upgrade

steinvoorte.nl © 2017