Affordable Home Security, Using a Repurposed Surface Pro 4

Surface Pro 4 Flickergate Got You Down? Need To Re-purpose Your Old Flickering Surface Pro 4?

I’ve recently needed to set up a home security system at home. Sure, I could have spent a small fortune on an NVR system (networked video recorder) with cameras and saved myself a bit of time. And if you’re not technically minded that’s exactly what I’d recommend to be fair.

But, if you don’t mind a bit of tinkering and you have a Surface Pro 4 with a broken screen (either due to flickering or because it’s cracked and doesn’t work properly) then this article might be of interest. It’s written based on my own experience, so there may be steps that you don’t need, or I may have missed some steps that you might need (though I suspect not, cos I started with nothing). Some of the items are definitely optional. In reality, you need a Surface Pro 4 (a 3 might work too, not sure, not tried). You also need a wireless router (preferably with some spare hardwired ethernet ports but not essential). Finally you’ll need a wireless camera. I’ll list the optional extras I used below.

Surface Pro 4 for Home Security – Will It Work?

One of the biggest questions I had when I embarked on this little experiment is whether or not the Surface Pro 4 processor and GPU is powerful enough to take on the role of decoding and storing video streams from security cameras. In my case, I actually only needed one security camera just to cover the back garden. Nevertheless, it’s still a fairly demanding application so I wasn’t sure if the Surface Pro 4 was up for it.

Turns out, that for one camera at least, the Surface Pro 4 is plenty powerful enough. I suspect, but haven’t tried yet, that it would cope with probably 3 cameras before getting too bogged down. It might do 4.

Don’t Use MS Windows For This

Now, to be fair, there are some good applications available for Windows and Home Security, such as Blue Iris for example. It’s fully featured and works well. But it requires a decent server to operate and the Surface Pro 4 is going to need all the help it can get.

Windows 10 requires a fairly sizeable amount of RAM and disk just to do its thing. RAM is going to be one of the biggest restrictions on this build so that’s why I recommend going with Ubuntu Server instead. For the surveillance software I’m going to use ZoneMinder.

ZoneMinder is free and open source. It runs on Linux. I did initially try to run it using WSL2 but I found that I couldn’t connect to the necessary ports through WSL. Seems there’s an ongoing issue with WSL2 networking where only the first port that’s opened can be mapped or something. I didn’t try to hard to fix it to be honest, I decided a vanilla Linux installation was better.

Advantages of a Surface Pro 4 Running ZoneMinder for Home Security

  • It’s thin and light and can easily be hidden in a cupboard somewhere.
  • Built in wireless (caveat, you’ll need to follow the instructions below to get it working though).
  • ZoneMinder and Linux is free and Open Source.
  • It’s power failure tolerant. (Though your cameras may not be)?
  • Surface Pro 4 is cheap and plentiful on eBay if you don’t need a functioning touch screen – which you don’t for this.

Disadvantages of a Surface Pro 4 Running ZoneMinder

  • RAM and CPU/GPU are not upgradeable
  • Will probably only support up to 4 cameras – if that.
  • Must use wireless network – unless you add a USB ethernet port (which is easy to do though).
  • Limited hard disk space – but external hard drives can be bought and added.
  • Linux and ZoneMinder can be hard to install and maintain. But don’t let that put you off – there’s a huge amount of information on the internet about them both and this article will get you up and running before you know it.

Preparing To Use a Surface Pro 4 with ZoneMinder for Home Security

OK, so you’re sold on the idea – let’s get on with How To.

What Equipment Will You Need?

  • A Surface Pro 4. A Surface Pro 3 may work too but likely will not support as many cameras.
    My Surface Pro 4 I am using is a Core i5 processor, with 128G NVME hard drive and 4G of RAM.
  • USB3 Flashdrive (USB2 is OK, but 3 is significantly faster). 4 Gigabytes or bigger is recommended.
  • A Linux (Ubuntu is what I use in this article) distribution. You do not need ZoneMinder yet.
  • A Surface Pro 4 power adaptor of course.
  • At least 1 IP camera that supports ONVIF protocol. I’ll list 2 that I’ve used successfully with ZoneMinder at the end of the article.

Optional Equipment That Might Be Required

  • A computer monitor or TV that accepts HDMI inputs. This is required if your Surface Pro 4 screen is damaged and can’t be viewed. In my case my Surface Pro 4 literally had no screen at all.
  • A MiniDisplay Port to HDMI adaptor if you’re needing the external screen as above. These are available from Amazon and are very reasonably priced. They’re plug and play.
  • USB3 Hub with Gigabit Ethernet connection. This is only needed in a couple of scenarios;
    • You want to use a wired ethernet connection for speed and stability
    • Your TypeCover isn’t working (or you don’t have one) – in which case you’ll also need a USB keyboard. Because you need to boot from USB device to install Linux you can’t plugin your keyboard to the only USB slot on the SP4. Annoying, they should’ve at least provided 2 ports…
  • A drill if you’re mounting outside on a wall. The physical installation of cameras is beyond the scope of this HowTo though.
  • Ladders etc. See above list item though.
  • Power near to the camera. Also, potentially enough ethernet cable length if your camera is going to be wired, not wireless.

I’ll list all these items with pictures and details at the bottom of the article.

Download Ubuntu Server and Flash to USB

The first step of the process is to grab a copy of Ubuntu Server;

Why Ubuntu Server? Why Not Ubuntu Desktop?

You can use Ubuntu Desktop if you want to. But it’s bigger, takes up more space on the hard drive, is a bigger download and most importantly it will boot up with a graphical user interface.

You’re using a Surface Pro 4 with a broken screen. So I’m assuming you don’t really want a graphical user interface (GUI). A GUI takes up unnecessary RAM and processing cycles that are best left for ZoneMinder to process camera data. There’s nothing you need to do that can’t be done from the terminal or web browser once it’s all set up anyway ๐Ÿ™‚

There is one problem with Ubuntu Server though – and that is that it does not support wireless out of the box. If you’re using the USB3 Ethernet solution above that won’t be a problem, but if you’re relying on wireless you’ll need to pay attention to the part below about getting wireless working.

Download Ubuntu Server 20.04 LTS

I’m going to assume that you’re using a Windows machine to do this. And that said Windows machine isn’t your Surface Pro 4 with the broken screen – although it could be so long as you can actually see the screen.

In your web browser, visit;

https://ubuntu.com/download/server

Download the latest LTS version of Ubuntu Server onto your hard drive (at time of writing it’s 20.04 LTS). It should weigh in at around 200 Megabytes. Remember where you’ve saved it as you’ll need it for Rufus shortly. I’m going to assume you’ve saved it to your Downloads folder.

Download Rufus

Also in your web browser visit;

https://rufus.ie/

And download the latest version of Rufus. Once the Ubuntu download has finished, plug in your USB Flash drive and open Rufus from where-ever you saved it. You should see a screen like below;

Rufus Screenshot
Rufus Application Screenshot

Click the SELECT button toward the top right of the application. Then choose the Ubuntu Server ISO file that you downloaded. Make sure your USB device is properly selected in the dropdown box at the very top of the application.

The rest of the settings will be set to the defaults which is correct. Click START at the bottom and Rufus will do it’s thing. If it suggests downloading a new SysLinux you’ll need to accept that option and download a new SysLinux. You won’t need to do anything for it, just accept the download.

Once it’s finished you should have Ubuntu Server installed on your USB drive.

Download the Wireless Packages

This article is copyright 2020, Most Useful Information. All Rights Reserved. Original is at https://most-useful.com.

You only need to do this if you do not have any fixed Ethernet capability. If you’ve bought the USB3 hub and Ethernet dongle and can plug in directly to your router with a cable then you don’t need this. But, if you don’t have any ethernet connections then you need to get these packages beforehand. You’ll need to download the following in your web browser;

https://packages.ubuntu.com/focal/wireless-tools
https://packages.ubuntu.com/focal/libiw30
https://packages.ubuntu.com/focal/wpasupplicant
https://packages.ubuntu.com/focal/libpcsclite1
https://packages.ubuntu.com/focal/libnl-route-3-200
https://packages.ubuntu.com/focal/libnl-3-200

Copy these files, once downloaded, onto your USB Flash Drive, perhaps into a subdirectory of it’s own. I stored them in a folder called Wireless. But you can call it whatever you want. We’ll come back to these later.

Eject the USB device safely and then plug it in to your Surface Pro 4 that is about to become your new ZoneMinder server.

Boot Surface Pro 4 From USB Flash Drive

Provided that your Surface Pro 4 is setup to boot from USB before Windows 10 (or 8?) you should be able to simply power it on with the power button with the USB Flashdrive plugged in and Ubuntu should start to install. If it’s not setup that way, you’ll need to enter the UEFI settings screen and change it.

Surface Pro 4 UEFI Screen
Click to enlarge

To enter the UEFI settings screen you can either reboot your Surface Pro 4 from Windows using the Settings -> Update And Security -> Recovery -> Advanced Startup option and then choose the UEFI Firmware settings option when your computer reboots.

Or;

Switch off your Surface Pro 4. You can hold the Power button until it powers off if you cannot switch it off any other way. Then, with the power off, press the VOLUME UP key ( marked + ) on the top of your SP4. Whilst continuing to hold the VOLUME UP key, press the Power button until your Surface Pro 4 boots. This should put you into the UEFI screen.

On the screen shown above, make sure there is no black square in the box next to Windows Boot Manager. Make sure there IS a black dot next to USB Storage. It’s safest to make sure none of the other boot options have black squares next to them either. Also make sure that Enable Boot From USB Devices is marked as On.

Once you have the settings as appropriate, choose the Exit option and save the changes and exit. Your Surface Pro 4 should now reboot into the Ubuntu Server setup.

Install Ubuntu Server on Surface Pro 4

Follow the on screen instructions for setting up Ubuntu Server. It’s pretty straight forward and will prompt you all the way. I do recommend erasing the entire disk and reformatting for Ubuntu Server rather than letting it dual boot with Windows – if it gives you that option. I’m not sure if it does because my hard drive was corrupt anyway, so I didn’t have a Windows install in any case.

On my Surface Pro 4 the installer crashed repeatedly for some reason, though on a different SP4 I ran it using a different USB flash drive and it worked first time. So I suspect there’s something up with my USB flash drive. Nevertheless, it did eventually install and once installed is absolutely rock solid.

When it’s finished, it’ll tell you to remove the boot media and reboot. You’ll need to do this. Make sure you remove the USB Boot disk, otherwise it’ll simply go back into the installation process all over again, even though it’s already installed.

Install the Wireless Helpers

Once you’ve rebooted and logged back in, you’ll need to install the Wireless helper applications. This is because Ubuntu Server is geared towards server systems that WiFi isn’t going to be a good match for. Server systems work better on Ethernet networks because they need the speed. But we might want WiFi. If you do, this section is for you.

You will see a lot of console error messages when you first login. Ubuntu Server, by nature of being a server, is fully expecting to have network access. It gets quite grumpy when it doesn’t. Be patient with it ๐Ÿ™‚

Once you’re logged back in, re-insert the USB pen drive – the one where we copied those wireless drivers to. Now, because we’re on a console with no GUI and none of that fancy automounting software running, you’ll need to find out where the USB mounted. To do that issue the command below;

lsblk

It’s quite likely that your USB system will be the same as mine, unless you do have a USB hub and have multiple different disks attached. If you only have the one disk it’s probably going to be /dev/sda as in the picture to the right. You can tell which one is the USB pen drive by looking at the size column. Clearly, in the picture, nvme0n1 is not my USB flash drive because my USB flash drive is 32Gigabytes in size. Nvme0n1 is showing as 447G in size. You’ll notice that sda is showing as 28.7G in size, which is very close to 32G – so this is my flash drive.

To get access to those wireless drivers you’ll need to issue the following command;

sudo mount /dev/sda1 /mnt

This is telling Linux that you want the sda1 partition to be attached to the file system at the mount point (also a folder) called /mnt.

Then issue the following command;

cd /mnt/Wireless

The above assumes you stored your wireless drivers in a directory called Wireless on your USB key. If you stored them in the top level directory, or somewhere else, just substitute Wireless as appropriate. You can use the ls command to look at the files and directories on your USB key to find the files. They will all end in the .deb extension so you can issue the command ls *.deb – if you get no files shown you’re in the wrong directory.

If you’re stuck, you can try the following;

cd /mnt
find . -name \*.deb -print

That should show you where you stored your wireless drivers. If the files start with ./ then they’re in the current working directory and you’re good to go. If they start with anything else, you will need to issue the cd command to change directory. For example;

./Wireless/wireless-tools_30~pre9-13ubuntu1_amd64.deb

Then issue the command;

cd ./Wireless

(Technically the ./ isn’t needed, but for clarity I’ve included it and it won’t hurt)

Now that you’re in the right directory you can install them with the following command;

sudo dpkg -i *.deb

Provided you downloaded all the recommended files listed at the beginning of this article, and copied them correctly, they should install without any errors. If you get errors you can leave a comment and request some assistance (preferably with a screenshot using a camera-phone or similar) but the best bet is to go back to the top of the article and see which files you forgot to download ๐Ÿ™‚

Configure the Wireless Drivers

So, they’re installed. That’s nice. They won’t do anything though until we configure them. Fortunately configuration of the wireless devices in Ubuntu 20.04 LTS Server isn’t that difficult. There’s a couple of hoops to go through but they’re easy enough. The first is that we need to find out what the Wireless Network Interface is called. To do this issue the command;

iwconfig

You should see something like the screenshot on the right.

On that screenshot you’ll see the top item, marked as wlp2s0 and then some text beside it. You can ignore the text beside it, except to realise that because, unlike the item named ‘lo’ it actually has options showing. This means that’s the name of the wireless interface card Linux has assigned to the physical wireless interface in your Surface Pro 4. Remember, or write down this name. Yours will (if you’re using this guide to setup a Surface Pro 4) likely also be called wlp2s0 (that’s a zero on the end).

Now you need to issue the following command ( this answer is taken directly from https://askubuntu.com/questions/1105069/how-to-enable-wireless-on-ubuntu-server-18-04-via-cli )

sudo nano /etc/netplan/01-netcfg.yaml

The file will not exist. That’s OK, we’re going to create it. I have modified the contents of the original AskUbuntu forum to match our Surface Pro 4’s wireless naming scheme.

network:
  version: 2
  renderer: networkd
  wifis:
    wlp2s0:
      dhcp4: true
      dhcp6: true
      access-points:
        "network_ssid_name":
          password: "**********"

Pay attention to the indentation in that file. If you get it wrong this will not work. The YAML markup language used in this file is extremely picky about indentation. You should use the SPACEBAR key to create the indentation of the various lines, TAB is not allowed. They must be typed as you see them above. Fortunately the netplan program will give you good feedback if you get it wrong.

Once you’ve edited the file, use CTRL-X to exit and follow the nano prompts at the bottom of the screen to save the file.

Then issue the following commands;

sudo netplan generate
sudo netplan apply

Reboot your Surface Pro 4 by typing reboot at the command prompt. You’ll need to relogin when it’s finished rebooting. If all went well, and it should, then this time your Surface Pro 4 reboots you shouldn’t see any error messages. You can confirm that your wireless is working with the following command;

ping www.google.com

You should see a few rows of output as in the picture to the right. If you get an error message then something went wrong.

Improve Wireless Stability

If you look at the output of the wlconfig command you can see that there is a setting there which suggests Power Management is switched on. On the Surface Pro 4 (and probably other devices) this causes the WiFi network to glitch out after a while. It might be minutes, hours or days. It’s a pain in the backside and on a server it’s definitely no good.

There’s lots and lots of tutorials around for switching off Wireless power management on linux systems that are using NetworkManager. But NetworkManager is a GUI system that makes controlling network interfaces nice and easy. We’re not using a GUI so this won’t work for us. We need a better way.

This way is a little bit fiddly but should see your wireless network remain stable. You’ll need to follow these commands exactly;

sudo mkdir -p /etc/pm/power.d
sudo nano /etc/pm/power.d/wireless_power_management_off

This will create a new file into which you need to type (or paste) the following;

#!/bin/bash

/sbin/iwconfig wlp2s0 power off

If your wireless interface is called something different, change the command above and replace wlp2s0 with whatever your wireless interface is called. You can find your wirless interface name through the iwconfig command.

Save that file. The issue the command;

sudo chown root:root wireless_power_management_off
sudo chmod 700 wireless_power_management_off
sudo crontab -e

If you’ve not used crontab command before it will ask you to choose which editor you wish to use. You can choose whichever you’re happy with. We’ve been using nano throughout this tutorial so you may want to choose that since you’re hopefully now a little bit familiar with it.

Into the nano editor you need to type (or paste) the following;

*/1 * * * * /etc/pm/power.d/wireless_power_management_off

Exit nano and save the file. This has the effect of telling the Linux system to switch off the power management feature of your wireless card every minute. It’s a kludge. It’s crap. I hate it. But it work. And after a minute passes, if you type iwconfig again, you should see Power Management: off underneath the Wireless card. Which should improve stability.

This advice has been taken from https://unix.stackexchange.com/questions/269661/how-to-turn-off-wireless-power-management-permanently and modified slightly for our Surface Pro 4 device names.

Install Linux-Surface Kernel (Optional)

The Linux Surface kernel has some additional stability fixes and firmware updates that can help improve the stability of the Surface Pro 4 under Linux. Much of it is related to touch screen drivers and Surface Pen for example. We’re not going to need any of those so that’s why this step is optional.

I haven’t used the Linux-Surface kernel on my ZoneMinder Surface Pro 4 setup and it’s been fine, but if you do want to install the latest and greatest Linux-Surface kernel, you can find all the details at https://github.com/linux-surface/linux-surface

Installing ZoneMinder on Surface Pro 4

So, if you’ve made it this far you probably deserve a medal. This has been a long long post hasn’t it. It’s still going! But you’re over the brunt of it now, you’re almost there.

There’s a couple of ways you can install ZoneMinder to run on your Surface Pro 4, and the level of technical detail required depends largely on how you want to be able to access the system. I’m not going to go into detail about how to setup an NGINX server to act as an SSL gateway to provide secure connectivity because this article is getting too big. If you want to do it, let me know in the comments and I’ll write a guide if you can’t find what you need on the internet already.

I’m going to set it up so that you can access the ZoneMinder web interface using ZoneMinder itself with no SSL security. This is OK provided you only want to access ZoneMinder from inside your local network. Don’t open your ZoneMinder setup to the rest of the world if you haven’t got SSL protection.

Install Docker on Ubuntu 20.04 on Surface Pro 4

So, I use ZoneMinder on 2 different servers and I’ve used the Docker method on both systems. It’s by far and away the easiest way to install ZoneMinder and the database required to run ZoneMinder on Ubuntu Server on Surface Pro 4 machines.

Installing docker on our new Ubuntu server is easy. The following guidance is taken from the official Docker Docs site.

First we need to setup our new Ubuntu Server on Surface Pro 4 to use the official Docker repository. It’s simply a case of entering the following commands on the command line;

sudo apt-get update

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

Then, to make sure we’re getting the software from the official source, we add the Docker GPG key and check it using;

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88

If the final command gives you no output then the key didn’t get installed correctly. Now, we can add the Docker repository to our Surface Pro 4’s Ubuntu Server software sources using;

sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

And finally we can install Docker with;

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

Allow non-root User to Run Docker Applications

You don’t need, or want, to have to run your ZoneMinder server as root. You only want to use the ‘root’ user (the administrator user) for administration tasks on the server itself. So to make it so that your normal Ubuntu server user can use Docker we need to give them permissions. This is straightforward;

sudo usermod -aG docker your-user

In my case, my normal user account is called steve so, the command I would issue is sudo usermod -aG docker steve – this tells your Ubuntu server to add the user ‘steve’ to the ‘docker’ group. Anyone in the ‘docker’ group is allowed to run docker!

You’ll need to log out of the console session and log back in for the new group permission to be added. You do not need to reboot – just log out and back in is fine.

Test Docker

Type the command;

docker run hello-world

If it works – you’re sorted. If you get an error you probably messed up the group permission step above, or didn’t logout and log back in again properly…

Install Docker Compose

Our ZoneMinder Docker installation uses a tool called docker compose to make life easier. So we’ll need to install that too. We can do that with the following commands;

sudo curl -L "https://github.com/docker/compose/releases/download/1.27.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

SetUp ZoneMinder On Ubuntu Server on Surface Pro 4

I have tended to run all my Docker applications on my servers from a separate subdirectory – so I create a directory called, for example Apps using;

mkdir Apps
cd Apps

Next we’re going to use Docker Compose to run our ZoneMinder container. We’re going to use the excellent docker container image maintaned by Dan Landon, which is available at https://github.com/dlandon/zoneminder and contains instructions for how to set it up on Docker. We’re going to use a slightly different way just because I prefer Docker Compose.

mkdir ZoneMinder
nano docker-compose.yml

Then, copy and paste the following file contents into the nano screen;

version: '3.7'

services:
    ZoneMinder:
        image: dlandon/zoneminder
        container_name: Zoneminder
        volumes:
            - ./config:/config:rw
            - /data:/var/cache/zoneminder:rw
        ports:
            - '8080:80/tcp'
            - '9000:9000/tcp'
        network_mode: bridge
        privileged: true
        shm_size: 2g
        environment:
            - TZ=Europe/London
            - PUID=99
            - PGID=100
            - INSTALL_HOOK=0
            - INSTALL_FACE=0
            - INSTALL_TINY_YOLO=0
            - INSTALL_YOLO=0
        restart: unless-stopped

Once again, indentation is vital because this is a YAML file. If you get the indentation wrong it won’t work.

There’s a few points to note here. Firstly, I have set up a mounted volume called /data – this is where my ZoneMinder installation will write it’s video and audio files. I’ve created this separately on an external spinning hard drive. SSD is not a good choice for storing the video files because it will wear out too quickly. I use a 4 Terabyte Western Digital Drive for this and I’ll go into more detail about how to format it and mount it in a moment.

You’ll also notice the ./config volume. You can ignore this – Docker will create this the first time you run the container and ZoneMinder will populate it. It will be a subdirectory in your Apps/ZoneMinder directory though so you can inspect its contents.

Don’t start ZoneMinder yet, unless you have your data drive setup, which we’re going to do now.

Setup A Data Drive For Your ZoneMinder Application

Before we start ZoneMinder for the first time, we need to make sure we can put it’s images and audio files somewhere, along with any other data files it needs. Depending on how many cameras you’re going to use and the resolution of those cameras, you may need hundreds of Gigabytes of storage. If you want to store them for weeks or months, you may need terabytes of disk space.

If you’re just going to be testing your setup you don’t need to set up a special drive yet. Just issue the following command;

sudo mkdir /data

This will create the data directory for you. This is needed whether you’re going to use external storage or not. So for now, if you’re just testing, you can ignore setting up an external drive and skip to the next section.

I use a Western Digital 4 Terabyte USB 3 2.5″ drive for storing my data on. It’s compact, uses very little power and it’s perfectly fast enough for what we’re going to do. However, you may find you’re limited to perhaps 4 cameras at most because this is a very lower powered solution (ie, the Surface Pro 4 running ZoneMinder at all is low powered). I run two cameras and it’s OK.

OK, so to setup the external disk you’ll need to plug in your disk into the USB port on the Surface Pro 4. Then issue the command;

lsblk

You should see a drive, probably listed as /dev/sda somewhere in that list. The ONLY way to tell it’s the right disk is to look at the size. Make sure the size matches the drive (within a few Gigabytes) that you just plugged in. If it’s showing as /dev/nvme0n1 that’s the wrong disk. The one that starts with nvme is your Surface Pro internal disk.

In order for Linux to use the disk as storage for your ZoneMinder, you’re going to need to reformat it. This is dangerous and could cause data loss. Make sure you issue the commands for the right disk.

sudo mkfs.ext4 /dev/sda1

Now that we’ve formatted it, we want to be able to mount it. But we don’t want to rely on Linux always assigning it the /dev/sda1 device, because it might not. So we can instead use a Unique Universal IDentifier (UUID) to mount it where we want it. To find out the UUID of the drive you’ll need to do;

sudo blkid

Then look for the ‘UUID=’ portion of the results which correspond to the drive you just formatted.

If you’re running these commands using an SSH terminal session, copy the UUID= section for later use. If you’re on the console using a keyboard, take a photo with your phone or write the UUID down. Next we need to make sure Linux can mount the disk every time we reboot (if it’s attached). To do this, we’re going to edit /etc/fstab ( FileSystem TABle ).

sudo nano /etc/fstab

At the bottom add the following line;

/dev/disk/by-uuid/THE_UUID_YOU_FOUND_HERE /data ext4 defaults 0 0

And exit the file. You can then issue the command;

sudo mount -a

to mount the external drive now. Next time you reboot it should mount automatically.

Start ZoneMinder

Before we start ZoneMinder we will need to know the IP address to point our web browser to later. To do that, type the following command;

ip addr

Look for the line which starts with ‘inet’ underneath wlp2s0 in that output. In my case it’s 192.168.2.50/24 but yours will differ. Ignore the /24 on the end. But remember the number at the beginning – maybe write it down somewhere…

Now we can start ZoneMinder using the command;

docker-compose up

from the Apps/ZoneMinder directory we created earlier. Once it’s finished installing and the screen has stopped scrolling, if everything went well you should be able to point your web browser to the new ZoneMinder installation.

Open up your favorite web browser and in the address bar type;

https://192.168.2.50:8080/zm

Change the 192.168.2.50 to be whatever number you found earlier.

If everything is working you’ll get a screen that you need to accept or decline which goes through the ZoneMinder Privacy policy. Read it and if you’re happy with it, accept it. Once that’s done you’re into the main ZoneMinder screen.

Congratulations – You have successfully installed ZoneMinder on Ubuntu Server on Surface Pro 4 !!

Good Budget Cameras For ZoneMinder

It might seem a little weird to put the camera information at the end, but I suspect if you’re asking how to setup your Surface Pro 4 to run ZoneMinder you probably already know which cameras you want. But if you don’t, these are the two cameras I’ve used.

It’s worth noting that some reviews on Amazon suggest these cameras call home and have firmware bugs which can enable them to be viewed remotely without any password. I don’t know if this is true or not when using their own software and set up – but I do know it’s not true if you’re using ZoneMinder to provide viewing for the cameras. This is because, even if you want to view the cameras from outside your home network, you’ll be exposing ZoneMinder ports (which is secure) not the cameras ports.

It’s perhaps also worth mentioning that you will need an IP based camera that supports H264 or H265 and preferably ONVIF. You can’t use an analogue camera in this setup. If you want to use analogue cameras you’d need to look at a dedicated home security box for that. Which renders the whole point of repurposing your Surface Pro 4 as a home security recorder pointless…

So, here’s the two cameras I use with ZoneMinder and they both work quite adequately for budget home security cameras attached to ZoneMinder.

SV3C ProHD 1080p Outdoor Video Security Camera

These are the main cameras that I use at home. You can easily recognise faces of people walking up the driveway to my front door, or trying to hop over the fence at the back. The SV3C ProHD cameras come with a built in microphone which is also compatible with ZoneMinder so you can record any conversations or sounds that might be happening too.

Do be aware that recording images and/or sounds might be subject to special legislation depending on where you are. Most places will allow you to record on your own premises if you’re not able to see anyone in public. But, recording sounds is not so easily controlled. Check your local laws and by-laws to make sure.

Anyway, these cameras have good infra-red night vision and the little LEDs glow red around the outside when they’re active. They’re not overly bright, but they’re enough to let someone know they’re being watched if they think that maybe the camera is a dummy. And if they check with their phone, they’ll certainly see them glow. So they’ll know they’re not fake camera housings.

These cameras also support PoE (Power Over Ethernet) which is how I use them. This means that when they’re attached to a PoE compatible hub, you do not need to run separate power cables as the ethernet cable itself will also supply power. This makes for a superb fitting outside with no cables visible and the camera can be located a long way away from any power source.

They’re easy to configure and provide 2 separate streams – one lo-res stream and one hi-res stream. I use the lo-res stream on ZoneMinder to provide the motion detection and then the hi-res stream is recorded if there is motion detected on the lo-res stream. This is fantastic for the Surface Pro 4 because processing a lo-res stream uses a lot less CPU power and means you can run more cameras at once.

I have found though that running 2 cameras with both streams is about as much as the Surface Pro 4 can handle, and if you watch the live stream at the same time you’ll definitely start the fans whirring but it does cope. You can probably tweak ZoneMinder and the camera output to go a little easier on the Surface Pro 4 processors by reducing the framerate and image resolution at the camera if you needed to.

ieGeek Security Outdoor Camera 1080P, WiFi Surveillance Bullet IP Camera

I use this camera on a different ZoneMinder installation. I personally prefer the SV3C cameras although there are some advantages to these ieGeek Wireless cameras. Notably, they’re wireless.

Having said that, in our usage scenario we went with wired anyway. To my knowledge they do not support PoE (Power Over Ethernet) and require a separate power supply available even if you’re using them in wired mode.

They do work well in wired mode, providing decent image quality which is comparable to the S3VC cameras listed above at similar range. The night time infra-red also works similarly to the SV3C and provides reasonable quality night time surveillance.

But, beware with wireless. It works, but it requires a really good signal. And if you’re mounting outside on a brick wall (such as we were) the signal was marginal even though the wireless hub was only about 15 feet the other side of the wall. Hence, we went wired anyway. Like I say, it worked but I wasn’t happy with it.

Also, remember, if your Surface Pro 4 is using WiFi and the camera is using WiFi then you’ll have some potentially serious traffic problems and slow downs. If possible, run a separate WiFi SSID (on a separate channel if possible!) for the camera and Surface Pro to keep your other wireless devices, such as phones and streaming TV’s from competing for the airwaves.

Nevertheless, for budget home surveillance cameras that work with ZoneMinder, both these are good options;

ieGeek Security Outdoor Camera 1080PSV3C ProHD 1080p Outdoor Video Security Camera

ieGeek Security Outdoor Camera 1080P

Conclusion

So, does the Surface Pro 4 work as an affordable home security network video recorder? The short answer is yes, if you use ZoneMinder on Ubuntu Server. But I wouldn’t recommend any more than 2 cameras if you’re running them at High Definition 1080p. It might manage more at 720p but I haven’t tried.

It does have the advantage of being extremely slim, light and very easy to hide somewhere – potentially making it more secure. Also, being very lower power requirements it could work nicely for a security system for a caravan or #vanlife security system. Being so slim means you could potentially hide it somewhere to reduce the risk of it being discovered and therefore stolen as well. Of course, if the whole van is stolen then you wouldn’t have any footage to see where it went unless you managed to upload to the cloud as well. But for the average CamperVan security system it could work nicely without putting too much pressure on your limited electricity system.

Indeed, it’s the usefulness as a vanlife security system that made me investigate it myself because I’m hoping to convert a camper van soon… Watch this space for that one lol.

Spread the love

2 thoughts on “Affordable Home Security, Using a Repurposed Surface Pro 4”

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.