Raspberry Pi PoE CCTV – Part 2

Pi PoE HAT with camera moduleMy project continues. This week I've set up the camera module and software.

This week I’ve continued to work on my upgraded Raspberry Pi PoE CCTV system. Those of you that follow my blog may have already read part 1 of this series but if not you can head back there now to see how the project started.

The project isn’t complete yet but it’s making good progress. I’ve managed to sort out the software side of things over the last few days, as well as kicking off work on the custom PCB that will hold my PiNoIR camera module.

Let’s show you my progress…

Camera Module Setup

Now that we have a Pi capable of being powered via Ethernet, it was time to get the camera module fitted.

I’m using standard official camera module for now but will eventually replace it with a PiNoIR version later on. As the PoE switch is a HAT (complying to HAT standards), it has a little cut-out for the camera cable – handy.

Camera Module HAT slot

Having a slot for the camera module is a HAT standard

I’m using a short thick cable from one of my ProtoCam Plus kits for now, but I’ll need to buy a much longer version for the final installation into the CCTV housing.

Camera belt fitting

“Metal to metal” – the metal side of the camera belt should always face the metal HDMI connection.

With the camera fitted it was time to take a look at software…

Software – MotionEyeOS

I’m using MotionEyeOS again (previously MotionPie) just like in my last CCTV project.

In a nutshell it turns your Raspberry Pi into a feature-rich IP camera, which can be viewed on your phone/tablet/PC connected to your home network (and even outside of your home if you set up a DDNS like No-IP).

It’s also very easy to set up – let me show you how…

Download the Image

MotionEyeOS is available on GitHub (you know, that really confusing website that only hardcore geeks seem to understand).

It’s very straight forward, with their main installation page giving you an overview of the process:

MontionEyeOS GitHub Page

The GitHub page gives high-level guidance for installation

Following these instructions I simply downloaded the latest image for my B+ from the downloads section:

MotionEyeOS Devices

MotionEyeOS supports a number of devices, including the various Pi models

Extract the Image

This part can catch you out if you haven’t done this kind of thing before, so let’s go through it.

The downloaded image file will have ‘.gz’ at the end of it. Now maybe it’s just me, but as a Windows user I’m more familiar with ‘.zip’ when looking at compressed files.

gz image files

Windows users might be a little confused by .gz files (or is it just me?)

These files are just a compressed archive like any other (I don’t know what the difference is between gz and zip), however I find that Windows won’t help me open these without installing a program first.

I use 7-Zip File Manager. It’s free, simple, handles .gz files and ‘just works’. Once you’ve installed 7-Zip, right click the downloaded image and extract it:

7-zip context menu

7-Zip gives you a context menu item to easily extract .gz files

Once you’ve extracted the image, your file should be available in the same folder:

7-Zip extracted file

Your extracted file will be ready for you in the same folder

Write MotionEyeOS an SD Card

With the image extracted it’s ready to be written to an SD card. It’s a small image so I’m just using a 4Gb SD card here. You might want to consider a larger card if you fancy saving camera recordings and images etc.

I use Win32DiskImager (Windows) to write images. You can learn how to use this application in my previous CCTV blog.

Win32DiskImager writing

Writing the image to an SD card is easy – check out my last CCTV project for a guide

CCTV Testing

With the SD card ready and everything set up it was time to check the output.

Remember I mentioned how MotionEyeOS turns your Pi into an IP camera? Well this is true in the viewing of the feed as well – we can view the output stream from a PC, app, smart TV or even display the stream on another Raspberry Pi.

For this initial testing I’m using the excellent MotionEyeOS browser interface. It’s shockingly good, with all the configuration settings, buttons and sliders you’ll ever need. After firing up the Pi I used my handy Android Fing app to find the Pi’s IP address on my network, then tapped this into my browser address bar.

The default user name is ‘admin’ and password is blank. I used the interface to log in and change the password, then checked out the camera. Everything was working as expected showing me a decent stream, however I decided to explore the tasty looking menu of settings I could play with.

Fast Network Camera

Within these settings is a new feature that wasn’t available last time I used this software, something called ‘Fast Network Camera’. It is simply perfect for this project!

Fast Network Camera option

The Fast Network camera setting, circled, gives you near real-time camera module viewing

I think this was introduced after the Raspberry Pi 2 came out, and makes use of the meatier hardware the newer Pi offered. It turns the camera from a jittery/laggy view to an almost real time stream. Using this option removes motion detection, media files and all the other advanced elements – but its worth it!

Check out the test video I posted to my Instagram account:

With that test complete, the camera/software side of things was sorted.

PCB Progress

You may remember I planned to make a custom PCB to replace the dummy CCTV casing’s LED board. I kicked this off this week.

Once again I’m using RS Designspark PCB to design my board – it’s free, reasonably easy to learn and…did I mention it was free?! I wrote a basic tutorial a while back if you want to give it a try yourself.

So far I’ve designed the board outline. It includes mounting holes to attach it to the casing, and cut outs to hold the camera module. I borrowed the camera module cut out lines from my ProtoCam PCB design file.

RS Designspark CCTV PCB design

I’m using RS Designspark PCB to design my custom CCTV IR PCB

Designspark PCB 3D view

Batman has already asked me where he can buy these…

To finish this I need to add pads and traces to allow me to add a number of IR LEDs. This part is the challenge for me – I have no idea which type of IR LEDs to use or how many the Pi’s 5V line can handle without getting stroppy.

I’ll be buying some different IR LEDs and running some tests at night once I get my hands on a NoIR camera module. Watch this space…and please comment if you have any advice. We need it nice and clear at night to ensure a sufficient jail sentence for the bad guys!

Summary & Part 3

In the first part of this series I got the PoE HAT working and found a suitable casing for the project.

In this part I got the MotionEyeOS software working perfectly and made some progress with the PCB design outline.

In the next part I need to do some IR LED testing. I need to find the right type and number of IR LEDs for this project, which will also let me complete my PCB design and order a prototype. I also need to start thinking about modifying the rest of my CCTV casing.

Lots more work to do yet!

Until next time…

3 Comments on "Raspberry Pi PoE CCTV – Part 2"

  1. Richard,
    Something to consider is the LED field of view. Apparently they come with different beam widths, and quite often they are very narrow. I got caught out with this on my bird box project. At night almost 1/3 of the box is not iliminated check this out in hours of darkness to see what I mean http://www.pi-tutorials.co.uk/birdbox.
    You probably want to drive the LED’s off the 5v rail. If you want to turn them on and off with GPIO use a transistor. I’ve got a guide linked here. http://www.pi-tutorials.co.uk/birdbox
    Good luck.

  2. Did you get any further with this?

    • I shelved it for a while when I was busy, then never returned to it. The casing was going to be too difficult to get right so I think my story ends here. Can’t win them all I guess

Leave a comment

Your email address will not be published.


This website uses cookies. Please visit our privacy policy page for more information. Privacy policy

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.