How to control Zoneminder CCTV installed on Raspberry pi3 remotely using TeamViewer

First install Zoneminder on Raspberry pi 3

Now our task is to find a method to control the Raspberry pi 3 computer remotely through inter net .

I have selected the  TeamViewer software for this purpose as it is

1.A free software

2. Very simple to install and use .No port forwarding is required

3.safe

We will have to install TeamViewer on Raspberry pi 3 as well as on the remote computer.

The  TeamViewer for the Raspberry pi 3 can be downloaded from here.

The downloaded  TeamViewer deb file can be installed on pi using the installer in Raspbian (Jessy)  ( by right clicking on the deb file and selecting the program)

15493945_10153938058500738_1313562409_n

The TeamViewer control Panel on Raspberry pi3

15502824_10153938058620738_1175822745_o

Setting up passwords

Then disable the random password and setup a personal password using the Option menu

Once the TeamViewer is installed it activates as a startup software .(Once computer is switched on the program is activated automatically )

 

The  TeamViewer for the remote computer can be downloaded from here

Install TeamViewer on the remote computer

15515561_10153941355910738_536065327_o

The TeamViewer  Control panel  on remote computer after installation

The add the Raspberry pi 3 to remote computer as a partner

Add the details of Raspberry pi 3 ( ID and password)to remote computer.

Then activate the connection  between the remote computer and the raspberry pi using the TeamViewer panel of the remote computer

15540435_10153941167040738_320529157_o

The  desktop of Raspberry pi 3  on the remote computer after the connection using TeamView

15491578_10153941168540738_1498553351_o

Zoneminder monitor of USB  Camera   on Raspberry pi3  appeared on remote  computer

The connection is very fast !

Thanks to Raspberry pi3 & TeamViewer !

Now you can control the pi from the remote computer!

I think there is a very big potential in developing cost effective Home Automation and Surveillance systems  using  Rasberry pi3 and TeamViewer

Reference :-How to install Zoneminder 1.29.0 on Raspberry pi 3

 

Advertisements

How to install Zoneminder 1.29.0 on Raspberry pi 3 with Raspbian 8.1 (Jessy)

First of all you will have to install Raspbian using Noobs on a class 10 sd card (16 GB or more) Pl refer this web site

screenshot-from-2016-11-23-224857

Please check the available version of zoneminder in Raspbian software center .You can see the available version version is zoneminder 1.26 wich is out dated .Therefore we will have to add the Jessie backports to source list and then update in order to obtain latest stable zoneminder version for Raspbian.

Using the terminal

Add The Jessie backports

sudo gedit  /etc/apt/sources.list

Then add following line to the bottom of the file and save

deb http://http.debian.net/debian jessie-backports main

screenshot-from-2016-11-23-213441

Adding  priority to this repository

sudo gedit /etc/apt/preferences.d/zoneminder

Add following lines to the above file and save

Package: *
Pin: origin http.debian.net
Pin-Priority: 1100

Then Update Sources 
sudo apt-get update

There are signature errors can be found

To fix those errors run following on the terminal

gpg --keyserver pgpkeys.mit.edu --recv-key  8B48AD6246925553
gpg -a --export 8B48AD6246925553 | sudo apt-key add -
gpg --keyserver pgpkeys.mit.edu --recv-key  7638D0442B90D010
gpg -a --export 7638D0442B90D010 | sudo apt-key add -

 

Then run on the terminal

sudo apt-get update

The Package ‘tar’ (tar (1.29b-1~bpo8+1)) seems to be broken.

Therefore exclude tar from upgrade

sudo aptitude hold tar

Then run

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

 


Now if you check the software center you see the latest zoneminder version 1.29 on it .

 

Install PHP, and MySQL server. You will be prompted to set a MySQL password

sudo apt-get install php5 mysql-server php-pear php5-mysql php5-gd

Then install zoneminder 1.29 using the software center of Raspbian

Create Zoneminder database in MySQL

Run following on the terminal

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
sudo chmod 740 /etc/zm/zm.conf
sudo chown root:www-data /etc/zm/zm.conf
sudo systemctl enable zoneminder.service
sudo adduser www-data video

sudo a2enmod cgi
sudo a2enconf zoneminder
sudo a2enmod rewrite
sudo chown -R www-data:www-data /usr/share/zoneminder/
sudo systemctl enable zoneminder
sudo service zoneminder start

Adding  timezone to PHP
sudo gedit /etc/php5/apache2/php.ini

Edit 894 line to enter your time zone as follows and save the php.ini file

screenshot-from-2016-11-23-213648
Your time zone can be get from here 


sudo service apache2 reload

Open Zoneminder http://localhost/zm/


Screenshot from 2016-11-23 21:29:42.png

 

ZM Console on Rasberry Pi 3

screenshot-from-2016-11-23-213014

Adding a monitor for IP Camera

screenshot-from-2016-11-23-213046

Adding a monitor for IP Camera

screenshot-from-2016-11-23-213201

IP Camera view

Reference

1 .Zoneminder wiki

2. Zoneminder wiki

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

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