Raspberry Pi Webcam Server
Parts needed:
- Raspberry Pi
- Webcam
- Low profile usb wifi
- Keyboard
- Micro SD Card
Software needed:
- Debian “Wheezy” Raspbian|| Download Here!
- Putty || Download here!
- Motion || Read the Wiki here!
Setting up Raspiberry Pi with Internet and SSH
- Download win32disk imager.
- Download the latest raspbian os image.
- Open 32disk imager and select the location of raspbian then write to the SD card.
- Insert the sd card into the raspberry pi and boot without the wifi adapter.
- Set keyboard standards to English(US)
- Change the password for root type: “sudo passwd:(insert your password here)”
- Logout type: “logout”
- Log into root use the password you just set.
- Set up the wifi interface by using this command and instructions: nano /etc/network/interfaces
auto lo iface lo inet loopback iface eth0 inet dhcp allow-hotplug wlan0 iface wlan0 inet dhcp wpa-ssid “Your SSID GOES Here” wpa-psk “Your Password Goes Here” This screen shot is what it should look like (the blue is covering my SSID and password for security reasons).
- Restart your Raspberry pi and log back into root (hint: shutdown -r now or reboot)
- Now test if the pi is connected to your router write: ping google.com -c5
- If you are connected update your apt-get program: apt-get update
- Install SSH : apt-get install ssh
- Tell SSH to start at bootup: update-rc.d ssh defaults
- Restart again
- Find your internal ip address: /sbin/ifconfig
- The address for your pi will be located under the red highlight in this picture.
- SSH from your PC into the Raspberry Pi using Putty.
- Unplug the keyboard (you don’t need it, the command line will be accessed remotely) and plug the Web Cam into the, now open, USB Slot.
This allows the Raspberry Pi to be accessed remotely through Secured Shell (SSH). There are many different ways to program this webserver, and some require a self powered USB Hub to power all the peripherals connected to the rasberry pi. Rememeber the rasperry pi is a low power device so devices using more than 100mA must be connected to a self powered hub. However the webcam I used (the Logitech QuickCam Deluxe for Notebooks) is a lower powered camera that works fine off the power the raspberry pi provides.
Installing Webcam Software and Server setup
- tell apt-get to download and install motion: apg-get intall motion
- Ensure that the raspberry pi recognizes the webcam: lsusb
- Now configure Motion. nano /etc/default/motion
- Change the value “start_motion_daemon=no” to “yes” then exit
- Start motion: sudo service motion start
- Navigate to you raspberry pi’s IP with port 8081(put the IP in the URL bar it should look like ###.###.###.###:8081) in a web browser and you should see your feed
- The raspberry pi is only boardcasting in your LAN so let configure it for the internet. Log into your routers port settings and forward port 80(port 80 is used by HTTP) to 8081 at your raspberry pi’s ip.
- As seen Here:
- You are done! Now you should be broadcasting outside your LAN!
Here is my working Webcam Server!
This is only a screenshot. I’m not going to publish my private IP address for security reasons. Please be careful who you share your private information with online.