Building a secure baby monitor

I just found out that my baby monitor has some seriously scary security concerns!! Research tells me it has ‘Built-in vulnerabilities that enable hackers to manipulate device functions, step into your home network, watch your children and upload what they see onto the internet.’ :open_mouth:

So, I’ve decided to build my own! As a balena employee, I’m somewhat ashamed to admit that other than the example project suggested during the new user onboarding process, I’ve never actually completed any other builds :flushed: But, with the help of @phil-d-wilson’s new security camera system project, I’m determined to complete this one (and also to beat Phils 25 minute build record - I’m nothing if not ambitious!)

I figured I’d share the process here, as I expect there will be lots of questions that may be of help to others.

Initially, I’m looking to build a baby monitor so my requirements are:

  • To view and hear within a single room via a video stream on my mobile (in a light or dark room)
  • To receive a mobile notification when my baby moves or makes a noise, to save me having to keep checking
  • To record the video stream, so I can review and see what happens at 5.30 AM most mornings that causes my child to wake up,
  • To include some sort of storage auto-overwriting functionality
  • Maximum security

I think that’s it. I do plan to expand this into a bigger home security system, with cameras on the garage (which was broken into a few months ago) and other external areas, but I’m going to learn to walk first!

So, Hardware… I have a Raspberry Pi 3 b+, which I can use and I’m planning to order this night vision camera module. I’ll need a way to hear what is happening in the room too, any suggestions on the best option for that? @tmigone @chrisys @phil-d-wilson

I’ve ordered this generic usb mic which I expect should do the job ok, it has fairly good reviews and seems like a fair price.

I’m surprised it’s so difficult to find a pi compatible camera that has night vision and a microphone. There are lots of complete cameras with both those features but they’re all similar to the dodgy baby monitor i’m trying to replace, and i’m not convinced i’d be able to use my own software, so i’m going to have to go with individual parts.

Hey @Jazzagi, looks like Kerberos doesn’t support audio yet (see this issue). We should be able to use the audio block to get audio streamed into a custom dashboard, in fact I have a half-hacked “spybug” project that’s very close to that functionality wise. I need to clean it up a bit and then once you have all the hardware we should see what we can do. Then it’s a matter of figuring out how to integrate both dashboards, but we can cross that bridge when we get there :smiley:

Ok cool, that sounds great, thanks @tmigone I’m going to build the basic camera with night vision tomorrow (my first ever ‘hack-Friday’!) so we can add audio after. What do you mean by ‘block’ btw? And, out of interest, when you say two dashboards, does that mean I would open one to view the video feed and a different one to hear the audio?

YAY for hack-friday!!

Regarding dashboards, yes. Since kerberos doesn’t support audio apparently we need to figure out how to work around that. By two dashboards I mean two different “URLs”, one would be for the video system, the other one for audio. Now that’s not a great experience, so we should figure out a way of having only one dashboard. I’m not sure how to achieve that at this point, but with a bit more experience with kerberos and Phil’s project I’m sure we can find a workaround.

Blocks are the drop-in containers the labs team is developing to “solve common problems” for applications. So the audio block does all the “complicated” stuff that’s usually needed to work with audio, and provides you an easier (hopefully :sweat_smile:) way of adding audio to any project.

Thanks @tmigone, sounds great!

Update so far…

I followed the security camera system project and have successfully deployed the main project, I now have my Pi cam set up!

This was the equipment I used (plus a power cable for the pi):

One of the hardest parts was attaching the night vision lights to the camera, using those teeny tiny nuts and bolts!

Using the project tutorial I found most of the build super easy, except for a couple of small issues:

  1. After turning on the ‘public device url’ in balenaCloud I clicked the link immediately and was met with the following error:

‘tunneling socket could not be established:500’

It turned out this was just because the device was still updating, and I had just clicked the link too quickly, I tried again after a few minutes and was presented with the Kerberos set up page.

  1. Once Kerberos was set up I struggled to get a connection to my pi-cam.

The tutorial is designed for webcams, but if you’re using a pi-cam there is an additional configuration required. With the help of project owner @phil-d-wilson, we figured out that there was an additional configuration required for the Pi-cam. In the ‘Fleet configuration’ tab of my application I had to add a custom variable - BALENA_HOST_CONFIG_start_x = 1, like so:

As soon as that was added, and the device had updated, my Kerberos dashboard came to life! :slight_smile:

Lights on…

Lights off…

The night vision quality isn’t great, it’s good enough, I only really need to see if baby is moving around or sitting up, which I can just about do with this.

However, as you can see below, there are some issues with this setup:

If you have children, you’ll know that as soon as they see this shiny, interesting new thing with flashing lights, they will make it their aim in life to get to it! I think i deserve some extra brownie points for creativity here, and I did achieve perfect camera positioning, but it’s not going to work as a long term solution.

I also have some concerns about both the Pi cam and the Pi 3 overheating, I only had them powered up for a couple of hours max. and they became so hot, I wouldn’t be comfortable leaving them in my little ones bedroom.

I assume I can overcome these issues by buying/making a case and adding fans/heatsinks etc. but it feels a bit overkill, the reason for using the pi cam was to keep costs down, but if I have to purchase more parts perhaps I’d be better just investing in a webcam.

Would love to hear other people’s thoughts on this!

In the meantime, I’m pleased to have gotten this far :slight_smile: Next steps are as follows:

  • Research webcam alternatives
  • Research cases and cooling options
  • Have a play with motion detection functionality in Kerberos
  • Pester @tmigone for audio solutions so I can try out the new microphone