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!





Make Your Own Baby Night Vision Video Monitor…Again

2 08 2010

So, a while back, I posted about how to hack your own baby monitor. However, it was all fairly easy and didn’t require that much geekery. This time, however, I have gone all out and have produced what I think is a neat little set-up.

I am using a small thin-client PC, an HP T5700 with only a 750Mhz Transmeta Crusoe CPU and 512MB Ram. My PC is low-power and silent (perfect as it is running in our bedroom). I am also using a cheapo Nightvision Webcam from eBay (make sure it is true nightvision and not just some LEDs that you can turn on and off – the description needs to  say that the webcam uses IR LEDs and that they are “invisible to the human eye”) with a combined microphone.

To stream the video from the webcam, I use the rather excellent motion via sudo apt-get install motion. You’ll need to mess with the settings in motion.conf to activate the webcam server and to allow access from users other than localhost, for reference, here is mine. Then, all you need do is set motion running at boot, there is startup script included with motion when you install it, but I am pretty sure that is borked, so I just added “motion” to my /etc/rc.local file. Thus, to view the video, I simply browse to the http://IPADDRESSOFPC:8081, which is easily opened in VLC.

To stream the audio from the microphone on the webcam turned out to be a much more difficult process, as I detailed in the post prior to this one. Suffice to say, FFmpeg came to my rescue, so I simply run the command:

ffmpeg -f oss -i /dev/dsp -acodec libmp3lame -ab 32k -ac 1 -re -f rtp rtp://234.5.5.5:1234

at boot and my microphone is miraculously streamed to rtp://234.5.5.5:1234, which I can open in VLC (if you are using Linux, you have to use the most recent version of VLC, i.e. 1.1.1, previous versions don’t play well with rtp streams on Linux).

I use the following simple script on my laptop to view both streams, so I can see and hear our lovely daughter, even when she is sound asleep in a dark room:

#!/bin/bash
echo "starting vlc"
VPID=( $(ps -e | grep vlc | awk '{print $1;}'))
if [ $? = 1 ];then
echo "error getting vlc PID, exiting"
exit
fi
while [ -n "$VPID" ];do
kill $VPID
VPID=( $(ps -e | grep vlc | awk '{print $1;}'))
done
cvlc http://192.168.1.5:8081 &
PID1=$?

echo video status $PID1
if [ "$PID1" == "1" ];then
echo "error starting vlc video"
exit
fi
vlc rtp://234.5.5.5:1234 --equalizer-bands="0,0,15,15,15,-20,0,0,0,0" &
PID2=$?

echo audio status $PID2
if [ "$PID2" == "1" ];then
echo "error starting vlc audio"
exit
fi
exit

This set-up has worked perfectly for the last week and even my wife appreciates my geeky skills on this one! Plus, I have a very small WiFi router (a La Fonera2) which makes the system completely portable, as the video feed can be viewed on pretty much any device. This now frees my IP webcams for the job they are much better suited for, home security. The end result are videos of this quality (to be clear, this is a freezeframe from the video feed, taken in a pitch black room):

So, why do all this? Well, for one, it can only up your geekery skills ;) But also, motion has some cool features, that, for example, let you take regular photos, allowing you to make cool time-lapse videos of your baby as she grows and develops (or sleeps through one night – man they move a lot). motion also has built-in motion detection (that is its main job) so I am sure you can configure it in such a way to act as an early warning system if the baby stops moving (I am thinking the horror that is cot-death here, but I have yet to fully look in to getting this to work yet). Also, if have a spare PC lying around that you can put aside for this, it means that in the future you can use that PC for other jobs as your baby gets older. I am planning to, for example, get a cheap touch screen monitor off eBay, to allow me to turn it into an interactive activity centre for our daughter, to help her learn numbers and the alphabet (there are already some great tools in Ubuntu for just this purpose, but I am learning Python and hope to program my own bespoke software for the job). You could add some speakers and use the PC to play soothing music to your baby to help her sleep or even go all out and hook up some kinda remote-controlled mobile. The options are endless and hopefully it’ll mean that once your baby is all grown up, she wont think of you as her embarrassing geeky mum / dad, but her “makes-really cool stuff for me to play with” mum / dad…. ;)





Make Your Own Video Baby Monitor

4 02 2010

I’ve been quite quiet on the blog front lately, mostly because my Wifey is pregnant and we’ve only got one month to go! Being a through-and-through geek, I am always looking for ways to make my life easier or to do something cheaper through a clever technical hack and I plan to make my, my Wife’s and my baby’s lives as easy as possible through the power of the geek!

One thing I planned to do was to make my own baby monitor, rather than dropping up to £150 on some pre-built device. I wanted to be able to see as well as hear my baby when it is asleep upstairs, but those devices are very expensive. I thus thought I would try to make my own device using things lying around the house already. It actually wasn’t too difficult in the end, but I was lucky that I had the right equipment lying around. The first and most important piece of equipment is a Webcam. There are loads of options out there, but I wanted to use one that didn’t need to be connected to a PC to use. I had a Dlink DCS-2120 IP Webcam, that can connect to a Wireless network and doesn’t need a PC to run, it perfectly suited my needs.

Dlink DCS-2120

Dlink DCS-2120

The DCS-2120 includes some built-in features that are very useful, but I’ll mention that later. You can use other Webcams, even just simple USB versions, but you’ll need something to handle the video feed. If you don’t want to run a PC all the time, you could use something smaller, like a Fonera 2.0 router, that allows you to plug a USB Webcam.

So, next, you need a wireless network. Now, I didn’t want to carry around a huge router just to get this system up and running, because after all, this system should be portable enough to take to other people’s houses when we go travelling with the baby, so I chose to use the smallest WiFi router I could get my hands on. Luckily, I had one of the smallest routers already, a La Fonera. I already had another La Fonera installed and connected to the excellent free WiFi-sharing FON network, so I didn’t mind using this router for my own devices. Since the firmware (the software that runs on the router) that comes pre-installed on the router isn’t suitable for use as a normal router, I had to install (called flashing) some alternative Firmware. I chose to use DD-WRT, since it is fully supported on the Fonera and is very flexible. I used the guide from here that had some very detailed instructions on how to install DD-WRT on the Fonera. I shall summarise it here:

  1. Enable SSH access to the Fonera using a special web page hack.
  2. Enable the Redboot boot loader (allowing you load alternative firmware on the Fonera).
  3. Copy over the DD-WRT firmware and flash it on the Fonera.

It isn’t that simple, there are lots of steps involved, but the guide is very clear and easy to follow. Once I had DD-WRT installed, I now had a cool mini router, that I could then set-up to use with my IP Webcam.

La Fonera

La Fonera

Finally, I had to figure out how to actually view the feed. I wanted both a portable and a static solution. The Webcam I was using provides a feed using the rtsp protocol, so I needed a video player that could handle the rtsp stream. For my portable solution, I decided to use my Nokia N82 mobile phone, that has built in WiFi and can run the Core Media Player, that supports rtsp streams. For my static solution, I decided to use my laptop, running VLC on Ubuntu Karmic. In fact, because the Webcam just sends out the stream, any client that can access the wireless network and can play an rtsp stream will work. So, I can view the stream on my Windows Desktop upstairs, using VLC, whilst my wife can view the same stream on her Ubuntu Karmic netttop downstairs (yes Jobsworth, nettops can be useful).

I set-up the Fonera router, so that it provided a WiFi network with the same name (SSID) and security credentials as my main WiFi network at home. Thus, the Webcam automatically connects to my WiFi network when at home and my phone connects to it automatically also. Then, if I take the baby elsewhere, the Fonera replicates the WiFi network, so as far as the Webcam and phone is concerned, it is connected to the same network (this is very useful, because, the only way to change the wireless connection on the Webcam is through a wired interface, which is a bit of a complicated pain).

The real advantage of using this set-up is that you can have as many clients connected as you want to the video feed. The Webcam features a powerful microphone, so you can hear as well as see that the baby is ok and finally, the DCS-2120 includes some handy additional features, including the ability to take a photo at set intervals and upload them to an FTP server. Thus, I will be able to create one of those cool time-lapse movies of my baby as it sleeps and grows over time. I also chose the Fonera, because you can connect alternative aerials to it, most noticeably the La Fontenna, so this set-up should even work in my parent’s old house that has 12″ thick solid stone walls.

Since this whole system is meant to allow me to check up on our baby whilst it sleeps, I wanted to make sure it doesn’t look quite so scary and also allow it to be quite versatile. I thus bought a little teddypig, put the Webcam inside and used a Gorillapod camera stand to keep the Webcam in place (and also so I could attach it to pretty much anything).

It might look a little freaky, but I think it looks much less scary than the Webcam on its own.

Finally, here is a quick movie of the WebPig in action, alongside my laptop and mobile phone, showing it all working. The Core Media Player isn’t the best app in the world, so the video feed on the phone occasionally breaks up, as the video shows, but in general, it works very well.

The WebPig

The WebPig








Follow

Get every new post delivered to your Inbox.