Raspberry Pi (or rather Raspberry Spi – setting up a live webcam from scratch)

While @elpollouk has been in San Francisco for GDC, I’ve been having *issues* with our letting agents thinking they can have 24/7 access to the flat without letting me know in advance – not only is it against the law, it’s bloody freaky coming home to find things moved around when you’re on your own. So, I decided to do something about it and gave myself a little project today – setup a Raspberry Pi from scratch and have it streaming a webcam image so I can keep an eye on my flat when I’m at work and also have it alert me if/when it detects motion.

Here’s my kit:

1 x Raspberry Pi (model B)
1 x Playstation 3 Eye Toy camera
1 x Pimoroni Rainbow PiBow Case
1 x 16GB Class 10 SDHC SD Card (preloaded with NOOBS)
1 x Edimax EW-7811UN 150Mbps Wireless Nano USB Adapter
1 x Pimoroni PiHub 4 Port Raspberry Pi Hub (you must use a powered USB hub if connecting a webcam as it will draw too much power from the Pi itself – this one was listed on the eLinux wiki as being specifically designed for the Raspberry Pi and as a novice I enjoyed having that reassurance especially with a product that I’m not too familiar with).

NOTE: The Rainbow PiBow case is beautiful, but please remember to peel off all the white plastic from each piece of acrylic before constructing it. Yes, I was that person. Yes, I had to take it all apart and start again.

This won’t be an exhaustive guide on how I set it all up, because there are some fabulous resources on the web and I think it’s within the spirit of the Pi to have a bit of a play and tinker. However I’ll note down the blogs I found really useful along with any additions to the instructions that I found when installing the kit.

  1. Set up the wifi (not specifically for Edimax but worked nonetheless): http://richteel.blogspot.co.uk/2012/11/configuring-wifi-connection.html
  2. Once on the network and connected to the Internet, run the following commands to get your Pi up-to-date:
    sudo apt-get update 
    sudo apt-get dist-upgrade
  3. Set up a remote connection, I’m connecting to it from a Mac and so found the instructions on this site really helpful – http://ic3n1.blogspot.co.uk/2013/01/raspberry-pi-rdp-remote-desktop-from-mac.html (from point 12 onwards).
  4. Once I had got the remote connection up and running, I moved the Raspberry Pi away from the TV, unplugged the keyboard and mouse and placed it on shelf – pride of place. When I was connected to it via remote desktop, I couldn’t find a way in the GUI to restart/shut down the device and so a quick Google helped me to discovered that it could be done via command line with one of these commands:
    sudo reboot 
    or
    sudo shutdown now
  5. To set up the webcam, I followed this guide (http://pingbin.com/2012/12/raspberry-pi-web-cam-server-motion/) aaaaaand it didn’t work. A quick Google suggested I try popping the URL to the camera in Safari instead of Chrome and stone the crows it only bloody worked! I have no idea why Safari works, but it did!

So I currently have a Raspberry Pi set up on the wireless network that I can connect to remotely and view a web cam connected to it via a powered USB hub. Not bad for the first day of playing, I really look forward to developing this further and seeing how I can turn it in to a surveillance device so I can catch those pesky letting agents in action!

2 comments

  1. Nice work! Have you caught them yet?

    1. Not yet – though they haven’t entered the flat since this incident, but getting the motion detection working is my little project over Easter :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: