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.
- Set up the wifi (not specifically for Edimax but worked nonetheless): http://richteel.blogspot.co.uk/2012/11/configuring-wifi-connection.html
- 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
- 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).
- 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
- 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!