Zoneminder - Part 2: Building the Package From Source on the ODROID-XU4

ZoneMinder is an integrated set of applications that provide a complete surveillance solution allowing capture, analysis, recording, and monitoring of any CCTV or security cameras.

Main features

    • Monitor from anywhere--Zoneminder has a full-featured web-based interface; you can access ZoneMinder from any internet-accessible device.
    • Use any camera--ZoneMinder allows you to use any analog or IP-enabled camera.
    • Control your data--ZoneMinder is fully on-premises; it allows you to own your data and control where it goes.
    • Run small or super-big systems--suitable for home and small business use, as well as multi-server enterprise deployments. It is compatible with many platforms, including ARM technology (ODROID-XU4 is built on an ARM platform).
    • Keep track of what matters--ZoneMinder allows you to browse information intuitively. Drill down to what you want to see in a matter of seconds.
    • Actively maintained and free of charge--ZoneMinder is actively maintained by a team committed to open source

.

Recently, I moved the ZoneMinder application from my old Radxa Rock Pro (an ARM board) to the more powerful ODROID-XU4. There is a harder way--building the package from source--to obtain a working setup: ODROID-XU4 - Ubuntu 16.04.3 LTS – Zoneminder 1.30.4.

Figure 1 – ZoneMinder console, configured with seven cameras

Figure 2 – ZoneMinder, watching camera #2

Installation

Let’s install Zoneminder on our ODROID-XU4 board. First, install Ubuntu 16.04.3 LTS image (upstream Release 4.14.y) on your SD card. This distro is provided by Hardkernel at the address: https://wiki.odroid.com/odroid-xu4/os_images/linux/ubuntu_4.14/20171213 Then upgrade the system:

$ sudo apt update
$ sudo apt upgrade
$ sudo apt dist-upgrade
$ sudo apt install linux-image-xu3 
$ sudo apt autoremove
$ sudo reboot
Now install LAMP (i.e.: apache, mysql, php) on the board:
$ sudo apt install apache2
$ sudo apt install mysql-server
$ sudo apt install php libapache2-mod-php php-mysql
Now install Zoneminder 1.30.4 (**):
$ sudo -i
Tweak MySQL configuration (not needed for ZoneMinder 1.32 or greater):
$ rm /etc/mysql/my.cnf (this removes the current symbolic link)
$ cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf

$ nano /etc/mysql/my.cnf
In the [mysqld] section add the following:
$ sql_mode = NO_ENGINE_SUBSTITUTION
Then restart MySQL:
$ systemctl restart mysql
Now build ZoneMinder 1.30.4: first add repository and download tools,
$ add-apt-repository ppa:iconnor/zoneminder-master
$ apt-get update
$ apt-get install php-apcu-bc
$ sudo apt-get install gdebi-core

$ sudo wget https://raw.githubusercontent.com/ZoneMinder/ZoneMinder/master/utils/do_debian_package.sh
$ sudo chmod a+x do_debian_package.sh
$ sudo apt-get install devscripts
$ sudo apt install git
then the real “very long” build process:
$ sudo ./do_debian_package.sh --snapshot=NOW --branch=1.30.4 --type=local
Now install ZoneMinder 1.30.4 (use the ls command to discover yyyymmddhhmmss to be used in zoneminder_1.30.4~yyyymmddhhmmss-xenial_armhf.deb):
$ sudo gdebi zoneminder_1.30.4~yyyymmddhhmmss-xenial_armhf.deb
Create ZoneMinder database:
$ mysql -uroot -p < /usr/share/zoneminder/db/ZoneMinder_create.sql
$ mysql -uroot -p -e "grant lock tables,alter,drop,select,insert,update,delete,create,index,alter routine,create routine, trigger,execute on zm.* to 'zmuser'@localhost identified by 'zmpass';"
Add permissions:
$ chmod 740 /etc/zm/zm.conf
$ chown root:www-data /etc/zm/zm.conf
$ chown -R www-data:www-data /usr/share/zoneminder/
Enable modules and ZoneMinder configuration:
$ a2enmod cgi
$ a2enmod rewrite
$ a2enconf zoneminder
$ a2enmod expires
$ a2enmod headers
Enable ZoneMinder to system startup:
$ systemctl enable zoneminder
$ systemctl start zoneminder
Configure php.ini with the correct time zone:
$ nano /etc/php/7.0/apache2/php.ini
Insert your time zone;
$ [Date]
$ ; Defines the default timezone used by the date functions
$ ; http://php.net/date.timezone
$ date.timezone = America/New_York
Restart Apache:
$ systemctl reload apache2
Now you can find the ZoneMinder web page at http://IP_of_the_board/zm and add your cameras. All types of cameras will work for this: ffmpeg and mjpeg cameras, connected via Wi-Fi, Ethernet cable, or USB.

Be the first to comment

Leave a Reply