Build your own baby monitor revisited

8 11 2012

(Quite) a while ago I wrote about my attempts to make my own video baby monitor. I had also written about a few other approaches as well, but they were pretty involved and complex and tended to break after a few days.

Wanting to simplify the approach and make it easier to set up, I came up with a slightly more refined solution that works much better. I’ve been using it successfully for about a year and it works with multiple cameras and screens. Now I have a second bundle of terror it has proved very useful.

Rather than trying to reinvent the wheel I decided to use products already out there, but ones that aren’t actually designed to monitor babies with and thus don’t have the crazy high price tags. I use an IP webcam, that connects to a WiFi network, this can then be viewed on any laptop or android device you have. It should also work with the iPhone as well, but not being a fan of Apple’s walled garden, I haven’t yet investigated this in any great detail.

The most important part of all this is the camera and I’ve stuck with the same camera I used last time, the IP Night Vision webcam. These can be found all over eBay, or there are also variants available on places like ebuyer.com and dabs.com. It has a WiFi and an ethernet network connection, night vision up to a couple of meters, two-way audio (so you can both listen to and talk to your baby – though I don’t suggest the latter, that is one big brother step too far) and it can be panned and tilted around so you can ensure the baby stays in view even if it moves. Most of these cameras are made by Chinese manufacturers, but some are of better quality than others. Foscam is a really good brand it seems, I have two and they have been running non-stop for the last year with no problems what so ever. The model I have used and would recommend is the Foscam FI8918W.

Foscam FI8918w

Foscam FI8918w

It is relatively simple to set up, you just need to connect it to your wireless network following the instructions included in the box. Once this is done you can then view the camera in many different ways. There is an internal web address that you can use to view it from any laptop connected to your wireless network using a web browser. You can also use the free media software VLC to view the video feed, the advantage being this approach also gives you sound and will work on pretty much all platforms supported by VLC (so Windows, Linux and Mac OS). I have written a number of scripts that can be run on Linux (Ubuntu) and Windows that launches the necessary video feeds and restarts the video every hour, since the audio can sometimes get out of sync with the video.

However, the best way to view the video feed I have found is via an Android app, called IP Cam Viewer. There is a free version which works perfectly for my needs, but if you want to say thanks to the developer, you can get the Pro version which is only a few pounds and gives you a few more features. I run this app on my Android tablet, an Android set top box and my Android phone. It allows me to view the the video feed of the two sleeping terrors on a TV in the kitchen using the Android set top box, anywhere in the house on my Android tablet or whilst out and about pretty much anywhere in the world (with a mobile data connection) on my Android phone. The app allows you to move the camera around if you need to and you can put widgets on your home screen that update as fast as once every second, so you don’t even need to run the app to see what is happening.

IP Cam Viewer in action

IP Cam Viewer in action

There is some technical cleverness that needs to be carried out to allow you to view the web cam outside of your wireless network on your phone, but this is very simple to set up and can be done for free.

All in all, this set-up works really well. So much so that the BBC just interviewed me about it! It is certainly a much cheaper and more flexible approach than the dedicated solutions on the market currently and rather than only being able to view the video feed on one tiny screen, you can view it on pretty much any screen you wish pretty much anywhere you want.

If you want to do this yourself, do get in contact via the Contact page. I might put together some more detailed information into a PDF, maybe with a “Pro” version that contains simple step-by-step instructions for a small fee or something. It seems all the rage these days ;)

UPDATE: Gosh, so the story has got a bit of traction on BBC News and I’ve got quite a few comments and emails to read through. I’ll read and respond to all your comments over the weekend and I am sure I can produce a PDF with instructions.

Glad other people are keen on this idea!





How To Configure Wireless / WiFi Networking in Ubuntu via the Command Line (CLI)

25 06 2010

There are a number of tutorials available on-line for sorting out WiFi in Ubuntu via the CLI, but most of them seem quite outdated, so I decided to do my own.

I did this on a minimal install of Ubuntu Lucid, so it is as up-to-date as possible. The PC I was using has no Windows Manager of Graphical Display Manager, just the good old terminal so all this is done via the CLI only. I did this using a USB WiFI dongle, but it should be the same whether you use an internal card or a USB card.

First, you need to install the relevant software. You need to have a wired connection at this point, otherwise this wont work.

sudo apt-get install wireless-tools wpasupplicant

If you are connecting to an open network, you wont need wpasupplicant. Next, you need to “bring up” (essentially this means activate) your WiFi interface. So, issue:

sudo ifconfig wlan0 up

Next, to make sure your wireless device is working as it should issue:

iwconfig
and then
sudo iwlist scan

This should show you some wireless networks as proof that the WiFi device is working, if something goes wrong here, then there is a problem with your device or driver and you need to get googling.

If you are accessing a secured network and you really should be, you need to access the correct version of your WiFi key. To get your key, issue this command:

wpa_passphrase YOURSSID YOURWIFIPASSWORD

This will result in something that looks like this:

network={
ssid="YOURSSID"
#psk="YOURWIFIPASSWORD"
psk=fe727aa8b64ac9b3f54c72432da14faed933ea511ecab1 5bbc6c52e7522f709a
}

You need to make a note of the long phrase after psk= (NOT #psk=) as this your WiFi password in hex format.

Next, you need to edit your interfaces file, so issue:

sudo nano /etc/network/interfaces

At the end of this file, you need to add your WiFi configuration. Here are the options you can add.

auto wlan0     #change this to the name of your WiFi interface
iface wlan0 inet dhcp     #this is normally fine, if you want a static IP address replace “dhcp” with “static”
netmask 255.255.255.0     #change this as appropriate for your network, this value is usually right
gateway 192.168.1.1     #change this as appropriate for your network
address 192.168.1.100     #only needed for a static IP address
dns-nameservers 192.168.1.1     #only needed for a static IP address
wpa-driver wext     #you shouldn’t need to change this
wpa-ssid YOURSSID     #just type the name of your SSID here
wpa-ap-scan 1     #if the name of your SSID is hidden usually, type 2 instead of 1
wpa-proto WPA    #if you use WPA1 type WPA, if you use WPA2 type RSN
wpa-pairwise CCMP     #if you use AES type CCMP, if you use TKIP type TKIP
wpa-group CCMP     #if you use AES type CCMP, if you use TKIP type TKIP
wpa-key-mgmt WPA-PSK     #usually WPA-PSK (if you share a key) but sometimes WPA-EAP (for enterprises)
wpa-psk YOURHEXKEYFROMABOVE     #the hex key that you generated earlier

Thus, since I am using a WiFi card that is identified as wlan0 and am connecting to a WPA1 AES encrypted network called MYPLACE that isn’t hidden without a static IP address, this is what I added:


auto wlan0
iface wlan0 inet dhcp
netmask 255.255.255.0
gateway 192.168.1.1
wpa-driver wext
wpa-ssid MYPLACE
wpa-ap-scan 1
wpa-proto WPA
wpa-pairwise CCMP
wpa-group CCMP
wpa-key-mgmt WPA-PSK
wpa-psk 71c81a844973ae7bb1243141e5caa7b6bb0e2d7eetcetcetc

Finally, comment out the top section so it looks like this:

#auto eth0
#iface eth0 inet dhcp

This stops your wired network from working. This helps to ensure there are no conflicts. Remember, if you want your wired network to work again, remove these two comments (the #).

Finally, save the file by pressing CTRL and X and then pressing Y to save to the file. Now, reboot and your network should come up. Yay!

Some people have found that this doesn’t always work, so the next thing to do is to edit the configuration file for the wpasupplicant program. Do this by issuing:

sudo nano /etc/wpa_supplicant.conf

Basically, you add pretty much the same information here as you did to the interfaces file, except without the wpa- part. So, my file looks like this:


ap_scan=1
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="MYPLACE"
scan_ssid=0
psk=71c81a844973ae7bb1243141e5caa7b6bb0e2d7eetcetcetc
key_mgmt=WPA-PSK
proto=WPA
pairwise=CCMP
group=CCMP
}

As far as I am aware, the options are the same. So, edit this file as necessary, make sure you add the ctrl_interface and network={ at the beginning and the } part at the end. Save it and try restarting again. If it still doesn’t work, then kick your PC, wish you had installed Windows 7 instead and go off and do some Googling. You’ll find the answer on the Ubuntu forums and you’ll be happy again.

Best of luck!








Follow

Get every new post delivered to your Inbox.