How to upgrade zoneminder 1.29 to 1.30 on Ubuntu 16.04

You will have to refer iconnor  for adding Adding Zoneminder  PPA to your system.

Open the Ubuntu terminal

sudo add-apt-repository ppa:iconnor/zoneminder
sudo apt-get update
sudo apt-get upgrade 
sudo apt-get dist-upgrade


Then open the Synaptic Package Manager and see whether the  Zoneminder is upgraded to version 1.3 properly .If not upgrade using the Synaptic Package Manager.

Now open the ZM Console to find Zoneminder is running.

How to email using SSMTP

Please refer Zoneminder Wiki 

Installation of SSMTP

sudo apt-get update

apt-get install ssmtp

apt-get install mailutils

Configuration of SSMTP

To open ssmtp.conf

sudo gedit /etc/ssmtp/ssmtp.conf.

Then edit to include following  lines and save the file

root="your gmail"
mailhub=smtp.gmail.com:587
hostname=localhost
RewriteDomain=gmail.com
UseSTARTTLS=YES
UseTLS=YES
AuthUser="your gmail"
AuthPass=" password of your gmail"


Screenshot from 2016-09-04 13-04-12

revaliases

Configure

revaliases

Configure the revaliases with the correct “From” addresses while sending email

sudo gedit  /etc/ssmtp/revaliases

Add following lines and save the file

root:"your gmail":smtp.gmail.com:587
www-data:"your gmail":smtp.gmail.com:587
 
Screenshot from 2016-09-04 13-05-55

 

Checking to see mail works

Go to root sudo su enter the root password cd ..

echo "Hello, World" | mail -s "My email check" "your gmail"

Note:- All the places where "your gmail"  mentioned in above commands
have to be replaced with your e mail address


Making changes in ZM Options 
Open sub menu ZM/Options/Email
Make changes as follows
Screenshot from 2016-09-04 13-06-45
To attach alarm videos to email body you will have to include %EV% as 
follows in the ZM/Options/Email/EMAIL_BODY


Screenshot from 2016-09-04 13-09-19


To create alarm videos you will have to tick the box against OPT_FFMPEG 
in ZM as follows
Screenshot from 2016-09-04 13-10-16
Creating a filter to send alarm email

you will have to create , save and run on the background to be enable 
to email alarms  as follows.


Screenshot from 2016-09-04 16-45-13
Advertisements

How to install Zoneminder 1.29.0 on Ubuntu 16.04

Open the Ubuntu terminal

sudo su

apt-get update
apt-get upgrade
apt-get dist-upgrade

rm /etc/mysql/my.cnf  

cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf
gedit /etc/mysql/my.cnf

add the following line at 32

sql_mode = NO_ENGINE_SUBSTITUTION

Screenshot from 2016-04-23 21-38-28

Then save my.cnf

systemctl restart mysql

Install Zoneminder

Install Synaptic package manager using Ubuntu Software Center

Then install Zoneminder 29.1.0 using the Synaptic package manager

(Ubuntu Software Center in Ubuntu 16.04 does not have Zoneminder)

Create Zoneminder database in MySQL (Note: this also creates the default Zoneminder user and permissions in MySQL)

mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"
mysqladmin -uroot -p reload

 

chmod 740 /etc/zm/zm.conf

chown root:www-data /etc/zm/zm.conf
adduser www-data video
a2enmod cgi
a2enconf zoneminder
a2enmod rewrite
chown -R www-data:www-data /usr/share/zoneminder/
systemctl enable zoneminder

service zoneminder start

Add timezone to PHP

gedit /etc/php/7.0/apache2/php.ini
 
edit line 912 with your timezone

Screenshot from 2016-04-23 21-40-45
Then save the file php.ini

Your time zone can be get from here 


service apache2 reload

Open Zoneminder http://localhost/zm/
Note:- If you do not get the streaming ,Plese goto ZM-Options in 
ZM-Console and check the Paths for PATH_ZMS. It should be changed 
to /zm/cgi-bin/nph-zms.
Referance Zoneminder Wiki

How to use a Chinese Yoosee/2cu IP Camera with Zoneminder on Ubuntu

ipcamera

This IP camera is a fairly cheap one (30-40 US$). According to the user manual it is supposed to be used with Yoosee mobile camera app to view photos remotely.But after upgrading “yoosee” the remote viewing had failed. Luckily the “2cu” app could be used to view photos remotely with out any problem  . Therefore I had to drop ” yoosee” and select  “2cu ” app for the mobile phone. As an alternative measure for  this type of unexpected problems I thought of exploring possibilities of using this camera on Zonemider .

(First I have started and connected the ip camera to the wireless router through wifi .

Then I have used “nmap -A -T4 192.168.1.*” on the terminal .
The results of nmap showed that the ip camera is connected through ip address 192.168.1.4
and the opened ports were 554  and 5000.

I tried to view the server using 192.168.1.4 :554 and 192.168.1.4:5000 but failed.)

My operating system is Ubuntu 15.10 .The Zoneminer version is v1.28.1.

First download free Xeoma app and ran to find the streaming address of the camera.

Screenshot-Untitled Window

IP camera view on Xeoma ( photo at right)

Screenshot-Untitled Window-1

From the above figure you can see that  the URLs  are  rtsp://192.168.1.4/onvif1 and rtsp://192.168.1.4/onvif2

I have used one of the above URLs to configure the monitor of  Zoneminder.

Screenshot-1

monitor of  zoneminder

Screenshot-2

I have used the Monitor Preset  of Foscam F1820 ffmpg H264 as a guidance . But used the Source path and the resolution from the Xeoma results.

Screenshot-ZM - Monitor - Monitor-2 - Mozilla Firefox-1

Screenshot-4

IP camera view on Zoneminder( photo at left)

You can use this cost effective night vision Chinese IP camera on Zoneminder very easily.

How to use an old Android phone as an IP camera on Zoneminder

I thought of using my old of  Micromax 60 Android phone as a IP camera for Zoneminder software .When I search the internet for a software that can convert a phone to an IP camera ,I came across an interesting software called  IP Webcam.

Let us see how a phone can be used with Zoneminder.

First you will have to have a wireless router connected to the computer where the Zoneminder installed.

1.Install IP Webcam software on the phone.

2.Activate the wireless connection in the phone and connect to the wireless router.

3.Open the IP Webcam and go through the menu and activate the server.Now you can view the IP address of the phone and the port number on the screen.Write down the IP Address and the port .(my IP Address and port    192.168.1.3:8080)

4.If you enter the above IP Address  on the address bar of the computer ,you will get a screen as follows

Press here to see 192.168.1.3:8080

5. Add a monitor in the ZM-Console.

Fill the general and source sub menus as follows.

Press here for general

Press here for source 

Press here to see the ZM-Conzole

6.Restart ZM using the runnig/stop key in the ZM-Console. Now you can view video streaming on the phone on the ZM monitor .

Press here to see ZM monitor

 

Note :- The charging adopter has to be connected to phone while the IP Webcam is activated to avoid the battery runs down .There should be sufficient ventilation provided to avoid heating the phone.

More details on IP Webcam can get from here

 

 

 

How to view Zoneminder monitor remotely using ngrok

When the  Zonminder is using Apache HTTP Server , the ZM-Console address is localhost/zm. The ngrok software can be used to access the localhost of the computer where the zoneminder is installed .

First you will have to install the ngrok software on the computer where the zoneminder is installed .

Once  you run ngrok on the terminal you will get the web address for you to access the localhost remotely .

You can get ngrok from here

First ,download the ngrok zip file and extract it in to the home directory of the computer.

Then open the terminal and run the following command  to install ngrok

sudo apt-get install ngrok-client

Then run

./ngrok http 80

Now You see the ngrok terminal as follows.

Press this to see ngrok terminal

Here the web address under the forwarding will give the access to localhost:80 of your computer. Now you can use this web address to access your localhost on a remote computer .

 

Press this  to see  the result 

Now you can access the ZM-Console by adding /zm to the web address

Press this to see the ZM-Console and the Monitor

How to install ZoneMinder, v1.28.1. on Ubuntu 15.10

When you upgrade Zoneminder to v1.28.1. the ZM – Console will stuck  due to a data base error.It is also noticed that the sound folder is missing at /usr/share/zoneminder/www/ .

Let us see how those errors mentioned are rectified.

Open the Ubuntu terminal and run the following commands

Step 1: Make sure we add the correct packages

sudo  add-apt-repository ppa:iconnor/zoneminder-master
sudo apt-get update

if you don’t have mysql already installed:

sudo apt-get install mysql-server 

Step 2: Install ZoneMinder

sudo apt-get install zoneminder

Step 3: Configuring  the Database

mysql < /usr/share/zoneminder/db/zm_create.sql
mysql -e "grant select,insert,update,delete,create on zm.* to 'zmuser'@localhost identified by 'zmpass';"

Step 4:

Set permissions of /etc/zm/zm.conf to root:www-data 740

chmod 740 /etc/zm/zm.conf
chown root:www-data /etc/zm/zm.conf

Enable Zoneminder service to start at boot

systemctl enable zoneminder.service

Create a new user

adduser www-data video

Start Zoneminder

systemctl start zoneminder.service

Check to see that Zoneminder is running

systemctl status zoneminder.service

Enable CGI and Zoneminder configuration in Apache.

a2enmod cgi
a2enmod rewrite
a2enconf zoneminder

Step 5:

Restart Apache

service apache2 restart

If the apache server does not start for above command please see the foot Note

Download cambozola tar.gz file from the following link and extract it to the home folder 

http://www.charliemouse.com/code/cambozola/

Then open the terminal and execute
sudo cp cambozola-0.936/dist/cambozola.jar /usr/share/zoneminder/www/

Then open the web browser http://localhost/zm/

How to make alarm sounds

The sound folder is missing at the /usr/share/zoneminder/www/ sub directory. Therefore you will have to create it manually.

First you will have to select a suitable sound clip and copy it to the home directory of your computer.

Let us say our sound clip is alarm.ogg

Open the Ubuntu terminal

cd /usr/share/zoneminder/www/

sudo mkdir sounds

cd sounds

sudo sudo cp /home/bkjaya1952/alarm.ogg /usr/share/zoneminder/www/sounds/

Now open the ZM- Console and add a Modect

Open the Options / Web of the ZM- Console

and tick WEB_SOUND_ON_ALARM

enter alarm.ogg at the cage facing  WEB_ALARM_SOUND

Now the alarm sound will be  activated once an alarm is occurred.

Note :-Some web browsers like Firefox at present does not work on above alarms.Chromium web browser can be used successfully .

Reference http://www.zoneminder.com/wiki/index.php/Ubuntu_Server_15.10_64-bit_with_Zoneminder_1.28.1_the_easy_way
 
Note:-

If an error massage of

“AH00526: Syntax error on line 11 of /etc/apache2/conf-enabled/zoneminder.conf:

Invalid command ‘php_flag’, perhaps misspelled or defined by a module not included in the server configuration”

occurred when you try to start apache , please install the following software.

Open the terminal and run

sudo apt-get install libapache2-mod-php5
sudo a2enmod php5

sudo /etc/init.d/apache2 restart


How to change the default port 80

Suppose ,you want to change the localhost default port to 80 to 8080

Open the terminal and run

sudo gedit /etc/apache2/ports.conf

Then the file port.conf file will be opened

Screenshot-*ports.conf (-etc-apache2) - gedit

In the file change the Listen 80 to Listen 8080 and save

Similarly open the file 000-default.conf by running

sudo gedit /etc/apache2/sites-enabled/000-default.conf

Screenshot-*000-default.conf (-etc-apache2-sites-enabled) - gedit

and change  <VirtualHost *:80> to <VirtualHost *:8080> and save

The run

sudo service apache2 restart

Now you can access zm console using  http://localhost:8080/zm/

 

How to install Zoneminder 1.28.2 on Ubuntu 15.04

Open the terminal and execute following commends

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

Restart Apache

sudo service apache2 restart

Add Zoneminder Repository

sudo apt-get install python-software-properties

sudo add-apt-repository ppa:iconnor/zoneminder

sudo apt-get update

Install Zoneminder

sudo apt-get install zoneminder

Create a file called zoneminder.conf

sudo gedit /etc/tmpfiles.d/zoneminder.conf

Paste or enter the following to above file

d /var/run/zm 0755 www-data www-data

Then save the file

Change permissions on the file

sudo chmod 755 /etc/tmpfiles.d/zoneminder.conf


Create a symbolic link

sudo ln -s /etc/zm/apache.conf /etc/apache2/conf-enabled/zoneminder.conf

Create a new user

sudo adduser www-data video

Restart Apache

sudo service apache2 restart

Download cambozola tar.gz file from the following link  and extract it to the home folder 
http://www.charliemouse.com/code/cambozola/

Then open the terminal and execute
sudo cp cambozola-0.936/dist/cambozola.jar /usr/share/zoneminder

Then open the web browser http://localhost/zm/

Now you can add monitor and make your webcam a cctv camera .
If the camera doesn't work restart zoneminder using the start/stop button at the top 
of ZM -Console.

Reference http://www.zoneminder.com/wiki/index.php/Ubuntu_Server_15.04_64-bit_with_Zoneminder_1.28.1_the_easy_way
Note:-
It is better to uninstall previously installed zoneminder completely using  
Synaptic Package Manager.
This procedure does not delete files in zonemider folder at /usr/share/
To remove it, open the terminal and enter
cd /usr/share/zoneminder
then 
enter sudo rm *.*