ZoneMinder on the Orange Pi Plus 2

After configuring ZoneMinder on a Raspberry Pi 3, I went looking for another single board computer with either fewer, or none, of the disadvantages of the Raspberry Pi. That is when I came across the Orange Pi series, particularly the Orange Pi Plus 2. Here is a summary of what I found in the Orange Pi Plus 2:

As you can see the Orange Pi Plus 2 is not without its issues. The biggest issue seems to be a lack of software driver support. I did not have a good experience using the distros available for download, nor did there seem to be a lot of activity in the community forum. Let's hope that improves over time.

And then there was light! Behold, I came across this wonderful third party site, which offered up a Debian-based distro, called Armbian. Having come from the underwhelming Orange Pi site, I was not expecting such a finely tuned masterpiece. As the name implies, Armbian, attempts to provide a Debian Linux operating system for Arm-based hardware. From the download page you choose your image by selecting which single board computer you own. As far as I can tell, the Armbian team has managed to incorporate software driver support for every widget on the Orange Pi Plus 2, right down to the LED's. Their forum seems very active. They have clearly put a lot of work into this, for which I am extremely grateful.

Target Audience

The following instructions should apply to anyone wishing to install ZoneMinder onto any Debian-Jessie-based Linux distribution. It also shows how to configure ZoneMinder with nginx, instead of apache, while using the https protocol.

Install Armbian

First, head on over to the Armbian Download page. Download then write the appropriate image onto your sd card. You want the image without a desktop. Boot from the sd card and follow the first time use instructions.

Once you get to a command prompt, get all your updates:

sudo apt-get updatesudo apt-get upgrade

Initial Prep

We want to use ntpdate instead of ntp since ntpdate does not reside in memory:

sudo apt-get purge ntpsudo apt-get install ntpdate

Now add the following to the root crontab:

0 0 * * * /usr/sbin/ntpdate-debian

Make sure the jessie-backports repo is enabled in the file /etc/apt/sources.list. In my case, this was already enabled:

The Debian Jessie repos are missing a required perl library, so let's build that now. Note that the dh-make-perl tool uses your git configuration to create an entry in the package changelog. It will abort if your name and email are not set. So let's set that!

I was asked several questions during the dh-make-perl build process above and just accepted the defaults, with one exception. One step asked to put a bunch of junk into my .profile, which I said no to.

Build a ZoneMinder package from Master

We have created a build script for you so this is far easier than it might sound.

We will use the external 2.5" sata drive for the events folder and a small swap partition. At this time, partition and format the drive. I partitioned sda1 as ext4 and left 512MB of space at the end of the drive for the swap partition, sda2. With that done, lets configure the mount point. The assumption is, at this point, your existing ZoneMinder events folder is empty. Create the file /etc/systemd/system/var-cache-zoneminder-events.mount and add the following to it:

Now from another machine, point your web browser to the ip or hostname of the Orange Pi Plus. Your browser will warn you the site's certificate is unsigned.

From the ZoneMinder web console, click Options -> Paths and set PATH_ZMS to /zm/cgi-bin/nph-zms.

Congratulations. You're done. You can begin adding cameras now.

Performance

Here is a summary using sysbench:

cpu - 568.3784s

event storage drive - 1.1249Mb/sec

database - 206.57 transactions per sec

Compared to the data from the Raspberry Pi 3, the Orange Pi Plus is significantly slower in all three categories!

Cameras

Thanks to the 2GB of RAM on the Orange Pi Plus 2, we don't have to worry quite as much about memory usage. Unfortunately, as you can see from the table below, cpu usage is noticeably higher for compared to the same test using the Raspberry Pi 3.

camera

format

resolution

fps

ring buffer (frames)

mmap (MB)

Max swap buffer (MB)

Zma (%)

Zmc (%)

Zms (%)

Airlink777W

mjpeg

VGA

5

35

42

24

20

10

15

raspicam

h264

720p

5

35

124

74

50

35

45

USGLBH245S400

h264

1080P

5

35

277

176

100

70

70

This confirms more precisely what sysbench told us. We can reasonably expect eight VGA cameras, just two 720p cameras, and you can forget about a 1080p camera. These results are unsatisfactory, compared to the Raspberry Pi 3.

Conclusion

Based on the disappointing results from sysbench, I don't think my Orange Pi Plus has a future as a surveillance video recorder. The sysbench i/o test was more than 15 times faster on the Raspberry Pi. Sure, something could be said that the Raspberry had an SSD while the Orange had a traditional 2.5" hard drive, but they both rely on the same USB 2 bus to transfer data. If the cpu results for the Orange Pi were higher, I would have been inclined to attach an SSD and run the test again. However, at this point I don't feel it is worth my time.

The manufacturer of the Orange Pi went out of their way to advertise supposedly better specs than the Raspberry Pi, while slapping on hardware widgets that the Raspberry Pi did not have. It turns out the claim of a faster cpu was false, and the software support from the manufacturer is so terrible that it doesn't matter what extra widgets the board comes with. If it were not for the members of the absolutely wonderful Armbian development team, this board would have already been in the trash can.

My recommendation on the Orange Pi Plus 2 is to skip it. Even when/if you get it working, there are simply better products out there.

Stay tuned. I'm pulling all the stops and have an Odroid XU4 on order. It looks to be a beast! Let's hope it performs as well as the specifications state!