A Raspberry Pi project

I had not played around with a Raspberry Pi SBC (single board computer) before now, and I’m not really sure why not. Maybe because I have enough computers around the house, but I suspect the real reason is that I just didn’t have a viable use for it. I came up with one, and decided to jump in.

I picked up a Raspberry Pi 4B with 4gb ram from Canakit. It came with a power supply, a 32gb micro-sd card containing NOOBS (New Out Of Box Software), and the raspberry pi itself. Connecting an HDMI monitor and keyboard/mouse was trivial. Inserted the micro-sd card, and powered it up. A few minutes later I had a running computer. I updated the software, which was easy using the available tools from the OS. Not blazingly fast by any measure, but usable. Now toy day is always a good day.

I decided that I wanted a case for it, so I did some digging around and chose the Argon One case. The plus for this case is that the connections are routed out the back of the case, and it has a programmable power switch. There is a very nice program that uses an overlay to manage the fan and the power switch. A long press of the power switch shuts the pi down; a double-press reboots the pi, and a single press will start it if the power is off. You can set the temperature thresholds and desired fan speeds, and the settings survive a reboot.

I decided to use an SSD instead of the micro-sd card to hold the OS and also wanted to boot the pi with this configuration. The micro-sd card would not be needed once this is configured. I picked up this SSD and this adapter to connect it to one of the USB3 ports. Worked great. Except for the small hiccup – you can copy the running OS to the SSD, but you can’t boot an SSD from the NOOBS version of Raspbian. So I downloaded an ISO of the Raspbian OS, loaded it onto the micro-sd card, and powered up the pi. I had to reconfigure everything that I had just finished configuring, but since that was recently done it went fairly quickly.

Copying the OS to the SSD was simple using the “SD Card Copier” utility from the “Accessories” menu, and we were at the precipice. Powered down the pi, removed the micro-sd, and powered up the pi. It booted just fine, and I was now running the pi with a 500gb SSD. Not really a major accomplishment, but a big step forward in performance and reliability.

Now we have a Raspberry Pi in a well-designed case, using a 500gb SSD for storage, and a daemon that manages temperature, fan speed, and the multiple functions of the power button.  A very good start.

Video security project – Cameras

We need cameras to provide us with video.  There are a bewildering number of video security cameras available, some really cheap ones (don’t bother), mid-range cameras with fair resolution, higher-end cameras with very good resolution, and top-shelf cameras that have PTZ features (Pan, Tilt, and Zoom).

A primary requirement for me was that the cameras have IR (infrared) emitters so that they can provide a useful image in the dark.  If your cameras don’t have IR capabilities, you’ll need to provide lighting so the camera can “see”.  Not an attractive option.

So far, we want very good resolution images and video, and we want IR emitters so the camera can provide images and video without ambient light.  There are other decision to make as well.

There are may styles of cameras – bullet cameras, dome cameras, eyeball cameras, etc.  I chose eyeball cameras.  They provide good wide-angle images, and are not affected by ambient light reflecting from the dome enclosure.  Bullet cameras don’t typically have the same wide angle viewing as dome and eyeball cameras, so they are better suited to monitoring a specific location, such as a door or sidewalk.

Now we need to consider how we will connect these cameras to the software.  There are cameras that communicate over wifi – they are easy to install because you don’t need to wire them into your network, but they might require a wired power connection.  Battery-powered units (even those with a small solar panel) are frankly just more trouble than they’re worth.  The other main type of camera is wired using an ethernet cable, sometimes called cat5 or cat6.  There are other designations also.  Some of these require separate power connection, but there is a sub-type of wired cameras – those that connect to a POE switch.  POE is Power Over Ethernet, which allows the same cable that handles the video stream to supply power to the camera.  This is probably the best way to connect a robust video surveillance system.

I chose an eyeball camera with very good video and still image resolution, and a POE connection for both power and data.  Now that we’ve made that choice, let’s look at how we might put this together.

Video security project – I want one

I’ve been intending to install a video security system at my cabin for some time now.  But making that a reality has been a more difficult journey than I initially expected.  Sure, the easy way is to hire someone to do all of the work and install a system, but I’m a DIY-type and this is not beyond my capabilities.

I did not want to sign up for a “security system in the cloud” because I don’t want my information available to anyone but me.  Maybe I’m a little paranoid about that – but to quote Dr. Johnny Fever from WKRP – “When everyone is after you, paranoid is just good thinking.”

So I decided to do this myself.  I have a lot of IT experience with networking, server security, and programming – but not any experience with video security.  So I started looking around at software to run the system, and found a package called Zoneminder.  The name comes from one of the project’s biggest features – that you can define zones where any detected motion will trigger an alarm.  Where smaller (read less flexible) systems trigger an alarm on any motion within the camera’s view, you can define multiple zones where motion should trigger an alarm, and also zones where motion is to be ignored.

The last statement may not make a lot of sense to some folks – but think of an outdoor camera monitoring the front door in a wooded yard.  Trees have leaves, and they move when it’s windy.  To a computer program, that’s motion.  The fact that it isn’t human or animal motion is an unimportant distinction.

You can also define what amount of movement is considered important enough to trigger an alarm.  Whether that is by the number of image pixels that change, or how many pixels change compared to the total number of pixels in the image – you have a great deal of control over these behaviors.

We’re going to need some cameras, a computer to run the system, software (which I already chose), and some way to connect everything together.