How to install Zoneminder 1.30.0 on Raspberry pi 3 with Raspbian 9 ( Stretch)

 

RASPBIAN STRETCH WITH DESKTOP

 

Install Zoneminder 1.30.0

Open the Ubuntu terminal

sudo apt update

sudo apt upgrade

sudo apt dist-upgrade

 

Installation of Zoneminder

sudo su

apt install zoneminder

rm /etc/mysql/my.cnf
cp /etc/mysql/mariadb.conf.d/50-server.cnf /etc/mysql/my.cnf
service mariadb restart



mariadb -uroot -p < /usr/share/zoneminder/db/zm_create.sql

maiadb -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"

service mariadb restart

Note :- When you enter above commands on the terminal there will be prompts , asking for a  password. In that event , just press enter key of the key board ( blank pass word) and wait until the process is over and command prompt appear on the terminal.Some times  it will take more than 10 minutes.

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

Screenshot from 2018-08-06 09-49-29

 

gedit /etc/php/7.0/apache2/php.ini

edit the opened file  with your timezone

Then save the file php.ini

Your time zone can be get from here

sudo service apache2 reload

reboot the pi

Open Zoneminder http://localhost/zm/

 

Screenshot from 2018-08-10 13-49-39

 

Reference :- Zoneminder Wiki

Note:- If you want to uninstall Zoneminder completely for a clean re installation use

“sudo apt purge zoneminder”

sudo apt autoremove

on the terminal

 

 

Advertisements

Adding a Hikvision Q1 NETWORK PT CAMERA to Zoneminder v1.31.44. on Ubuntu 18.04 LTS

 

IMG_20180623_213220

Hikvision Q1 NETWORK PT CAMERA is a low cost quality camera.

Item specifics
  • Brand Name:HIKVISION
  • IR Distance(m):5M
  • Alarm Action:FTP Photo,Email Photo
  • Sensor:CMOS
  • Storage:None
  • Viewing Angle (Degree):100°
  • Model Number:DS-2CV2Q01FD-IW
  • Dimensions (L x W x D)(mm):10*10*8
  • Supported Operating Systems:Windows 7,Windows 10,Windows Vista,Windows 98,Mac os,Windows 8,Windows XP
  • is_customized:Yes
  • Special Features:Vandal-proof
  • Power Supply:With POE
  • Supported Mobile Systems:Android,iOS,Windows Mobile
  • Video Compression Format:H.264
  • Minimum Illumination(Lux):Pan 355 degrees and Tilt 100 degrees
  • High Definition:720P(HD)
  • Technology:Pan / Tilt / Zoom
  • Power Consumption(W):7w
  • Audio Output:1CH RCA
  • Power Supply(V):DC 5V
  • Connectivity:IP/Network Wireless
  • Color:White
  • Style:Mini Camera
  • Wall Bracket:Ceiling
  • Type:IP Camera
  • Sensor Brand:SONY
  • Installation:Ceiling
  • Lens (mm):2.8mm
  • Network Interface:RJ-45 10/100Mb Ethernet Slot
  • feature 1:poe ip camera
  • feature 2:wireless ip camera wifi
  • feature 3:wifi baby camera
 The live view can be seen using a mobile app called Hik-Connect
Screenshot_2018-06-24-19-12-23
 Live view of the camera on mobile phone using Hik-Connect app
For installation of Zoneminder on Ubuntu please refer my other post 
Our main objective is to see how to connect this camera to zoneminder .
To add a camera monitor to zoneminder , under the Source sub menu  , ONVIF button at the top has to be pressed .
It was observed that the camera can be detected automatically in zoneminder .

 

Adding camera monitor to zoneminder

 

 

Detecting camera in zoneminder for adding monitor

 

In the brochure of the camera the default device password was not indicated. Therefor it was essential to reset the device password to be able to connect to zoneminder.

For resetting the device password SADP Tool was used .Please refer my other blog for the details .

After resetting the device password  the respective cages in the above figure was filled  and saved  .Then the  camera monitor was created successfully.

Source Path entered under the source menu of the monitor

rtsp://camera password@local ip address:554/Streaming/Channels/1

Note:- on the above source ,your camera password and local ip address have to be entered.

Entering Username and Device Password & creating monitor

 

After restarting zoneminder adding the camera was successful

 

How to install Hikvision camera Software (SADP tools & ivms4200 linux) on Ubuntu 18.04 LTS (Bionic Beaver)

Hikvision camera software have been written to suit Windows environment .If you want to run those software on Ubuntu ,you have to first install Wine .But Wine is not included in the  Ubuntu  Software center in Ubuntu 18.04.The  Synaptic Package Manager is useful in installing most of the software that has not been included in the Ubuntu software center.

Installing Wine

Open the terminal and run (or use  Synaptic Package Manager)

sudo apt install wine64

Installing SAPD Tools

Download SADP tools from softpedia

Double click on the downloaded  file  to install SAPD tools (Only the SADPTool_V3.0.0.10 version woks with Ubuntu 18.04)

Screenshot from 2018-06-24 19-54-53

              SADP panel on Ubuntu 18.04

In the above penal you can see the ip camera in the local network has been detected by SADP automatically .

If you don’t have the device password of the camera, you can use SADP tools to reset it. In that case you will have to generate a QR code using the SADP as shown in the figure below and take a picture of the QR code and e- mail  it to the closest technical division of the Hikvision company  . 

Then they will send you a xml file to be used in the SADP Tools to reset the device password.

 

Screenshot from 2018-06-23 22-56-08

Resetting forgot device password of cameras

IMG_20180623_094021

 

Uploading the  xml file received  from the technical division of Hikvision to SADP to reset device password

 

Installing ivms4200 linux on Ubuntu 18.04

Latest ivms4200  is only compatible with MS Windows. There was a Linux beta version in Hikvision web site long ago. This software can be downloaded from this site https://upload.bkeesti.ee/Hikvision/Software/  ivms4200-Linux.tar.gz

Alternative download

Extract the file and go to Linux sub folder and double click on iVMS-4200 executable file

Screenshot from 2018-06-24 19-57-50

 

Screenshot from 2018-06-23 21-53-31

ivms4200 panel on Ubuntu 18.04

 

 

 

How to install ZoneMinder, v1.31.44. on Ubuntu 18.04 LTS

Install Zoneminder
Please refer Connor's web site
Open the terminal and run following commands.
sudo add-apt-repository ppa:iconnor/zoneminder-master
sudo apt-get update
sudo apt install zoneminder

sudo su

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

systemctl restart mysql

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.2/apache2/php.ini

edit line 939 with your timezone

 

Then save the file php.ini

Your time zone can be get from here 

Adding cambozola.jar to the directory /usr/share/zoneminder/www/
Download the latest cambozola and extract to the Downloads directory 
of your PC
Then copy the cambozola.jar to the directory 
/usr/share/zoneminder/www/
On the ubuntu terminal run 
sudo cp /home/bkjaya1952/Downloads/cambozola-latest/cambozola-0.936/dist/cambozola.jar
 /usr/share/zoneminder/www/
Open zoneminder web console (http://localhost/zm/)
Screenshot from 2018-05-22 08-43-37
It was observed in ZM-Console,  the monitor adding editing Deleting  buttons are
not working. This is due to the default setting in  /etc/apache2/conf-available/zoneminder.conf
This problem can be solved by editing the zoneminder.conf file as follows.
Open the terminal and run following commands
(In ZoneMinder, v1.31.45 this error has been rectified)

sudo gedit /etc/apache2/conf-available/zoneminder.conf
Screenshot from 2018-05-22 08-13-53

Add following lines at 13 and 14 as shown in the above figure and save
 
AllowOverride All 
Require all granted


Then to restart Apache

sudo service apache2 reload
Then open the ZM-Console and restart zoneminder


Screenshot from 2018-05-22 08-48-04
Now you can see all the buttons in zm-console are working.
In my case ,I have added an usb camera as shown in the following figures
 Screenshot from 2018-05-22 09-09-56

Adding USB camera

Screenshot from 2018-05-22 09-09-56Adding USB camera

Screenshot from 2018-05-22 09-12-23
ZM- Console after adding the camera

Screenshot from 2018-05-22 09-12-54Camera view

Screenshot from 2018-05-22 09-13-31
Facility to add storage areas


Reference - Zoneminder forums

How to install Viber on Ubuntu 18.04 Bionic Beaver without clashing with other software like Virtualbox & Opera

Since viber uses libcurl3 instead of libcurl4 , when installing it on Ubuntu 18.4 some problems arise in  keeping  Virtualbox  and Opera in the same pc  (Ubuntu 18.04).

The following method can be used to eliminate the above problem

In this procedure, you will have to  obtain viber rpm version from the official viber web and convert it to a deb file using “alien” command and then install it on Ubuntu 18.04 PC

Assuming the viber.rpm file is being downloaded to Downloads folder of the PC.

Open the Ubuntu terminal and run following commands

cd Downloads

Installing alien

sudo apt install alien

Making a deb file

sudo alien –to-deb –scripts viber.rpm

After the deb file is formed you can see the file in the Downloads folder as in the following figure

Screenshot from 2018-05-02 19-34-32

Then install the package

sudo dpkg -i viber_7.0.0.1035-3_amd64.deb

Now you can see the viber is being installed properly on the pc without harming other software like VirtualBox installed on the same pc

 

 

How to install ZoneMinder, v1.31.1. on Ubuntu 18.04 LTS (Bionic Beaver)

Install Zoneminder
The Zoneminder deb file can be obtained from Isaac Connor's web site 
Install the downloaded zoneminder deb file using the default software 
installer of Ubuntu.

 

Then open the ubuntu terminal and run following commands

sudo su

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

systemctl restart mysql

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.2/apache2/php.ini

edit line 939 with your timezone

Then save the file php.ini

Your time zone can be get from here 

Adding cambozola.jar to the directory /usr/share/zoneminder/www/
Download the latest cambozola and extract to the Downloads directory 
of your PC
Then copy the cambozola.jar to the directory 
/usr/share/zoneminder/www/
On the ubuntu terminal run 
sudo cp /home/bkjaya1952/Downloads/cambozola-latest/cambozola-0.936/dist/cambozola.jar
 /usr/share/zoneminder/www/
Screenshot from 2018-04-27 22-15-31

sudo service apache2 reload
Open Zoneminder http://localhost/zm/

 

Adding an USB camera

 

Screenshot from 2018-05-06 08-58-20

USB camera view

Screenshot from 2018-04-27 17-45-37Note :-Installation of zoneminder v1.31.1 can also be done by adding PPA to your system. Please refer Isaac Connor’s web site 

How to use Motion Linux (4.1.1.1) with 2 web cams & Chinese IP camera on Ubuntu 17.10 (Artful Aardvark)

Motion Linux is a highly configurable easy to use cctv software.

The CCTV system that is explained here is based on 3 cheap cameras.

2 web cams and one Chines Yoosee IP Camera (wifi)

IMG_20180201_111426

The Motion linux  in the Ubuntu software is not the latest version .Therefore it is advisable to get the software from the Motion website

First install Motion Linux latest release  using the GDebi  Package Installer .

Screenshot from 2018-02-02 18-27-09

Now if you see the folder motion is being created at /etc/motion/. You can see  5  files in this folder as i the following figure

Screenshot from 2018-02-02 18-28-44

Out of the 5 files shown in the above figure ,the main file is motion.conf

Other 4 files are the configuration  files of linked cameras

If you open the motion.conf file you can see the commands of linking camera are placed at the bottom as follows (728-731).

sudo gedit /etc/motion/motion.conf

 

Screenshot from 2018-02-02 16-51-03

There was an error in the names of camera files in the default installation in the lines 728 to 731. Therefore you will have to correct and save the file as in the above picture.

You will have to delete ” ; ” placed at the beginning of the commands in order to activate the corresponding camera .You can see it in 728,729,and 730.

Now the corresponding configure files of cameras are edited as follows.

Usb camera 1

sudo gedit /etc/motion/camera1-dist.conf

Screenshot from 2018-02-02 12-55-58

Then save the file

Usb camera 2

sudo gedit /etc/motion/camera2-dist.conf

Screenshot from 2018-02-02 12-57-48

Then save the file

IP Camera

sudo gedit /etc/motion/camera3-dist.conf

Screenshot from 2018-02-02 12-57-03

For the netcam_url  you will have to enter your camera’s url . To see how to get your url using xeoma please refer this blog here 

I have created a target directory for videos generated when a motion is detected in my Video directory under the home directory as shown in the above .You can make your directory for videos as your wish .But you have to correctly mentioned path in the configure  files.

Now you can see the 3 cameras operating in the following figure when you open the Ubuntu terminal and enter the following command to start Motion

sudo /usr/bin/motion

Then open the web browser and enter the url

http://localhost:8080/

 

In the web panel itself there are facilities provided to start ,restart , stop motion program.  The stopping  or resuming motion detection also can be done using the web panel .

How to add a startup icon for start Motion

Please use the Mainmenu program to add an icon as in the following figure

launchercommand

How to upload motion detection videos instantaneously  to dropbox cloud using dropbox sync in order to view remotely

Make a symlink of the folder of motion detection videos and copy it to the dropbox sync directory in the home page as follows

link

sudo ln -s /home/bkjaya1952/Videos/bkj /home/bkjaya1952/

link

Now you can copy the symlink  folder to the dropbox sync floder

dropboxlinking

You can see the videos are being uploaded to the dropbox cloud in the above figure

How make alarm sounds when a motion is detected

First store a alarm sound clip in a folder of your PC

Install mplayer software using the Ubuntu software center

In my case My-recording-1.wav.wav  file has been saved in /home/bkjaya1952/Music

Open the terminal and enter

sudo gedit /etc/motion/camera2-dist.conf

Screenshot from 2018-02-03 09-31-32

Please enter the following line as shown in the above figure and save the file.

on_motion_detected mplayer /home/bkjaya1952/Music/My-recording-1.wav.wav

and save the file

Now you can hear an alarm sound when a motion is detected by the camera 1

 

How to record the sound using the camera microphone when a motion is detected

The program “arecord” needs to be installed on your system and you need a full working “motion” installation on your system.

Following example shows how to record sound using the camera 2

Open the terminal and enter

sudo gedit /etc/motion/camera2-dist.conf

Then the camera2-dist.conf

Edit the file as shown in the figure below

Screenshot from 2018-02-03 17-59-56

Please see the command line no 10

on_event_start arecord -d 60 -f cd /home/bkjaya1952/Videos/bkj/c4/%v-%Y%m%d%H%M%S.mp3

Here the duration of the recording is limited to 60 seconds (-d 60) in my case as the maximum duration of a motion detection of an alarm  event in the main file (motion.conf) is limited to 60 seconds.

In my case the recorded sound file is saved at  the directory of  /home/bkjaya1952/Videos/bkj/c4/

 

Motion linux is a very useful software in making cctv systems.

We must be thankful to the developers of Motion Lunux for providing us a great cctv software free of charge