How to solve dependency problems in Zoneminder (v1.32.2) on Ubuntu 18.10 (Cosmic)

Ubuntu 18.10 (Cosmic) has been released on this week .It is observed that the installation of  the latest Zoneminder master package (v132.2) on Ubuntu 18.10  has some dependency problems as shown in the  figure below.

Screenshot from 2018-10-26 16-08-08

Figure :-1 Dependency isuues

It is apparent that  the latest Zoneminder has not been adjusted yet to suit the environment of newly released  Ubuntu 18.10 .

Therefore we can include the necessary dependent software by adding Bionic repositories to the source list as follows  as a temporary measure until the Zoneminder is revised by the maintainers .

sudo gedit /etc/apt/sources.list

Add the following 2 lines to the bottom of the file sources.list and save

deb http://archive.ubuntu.com/ubuntu bionic-security main multiverse restricted universe
deb http://archive.ubuntu.com/ubuntu bionic-updates main multiverse restricted universe

Then on the terminal

sudo apt update

Screenshot from 2018-10-26 17-04-29

 

Figure 2:- Edited sources.list

Then on the Ubuntu terminal

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

sudo apt install zoneminder

(Or you can use Synaptic Package Manager to install Zoneminder )

Then follow the instructions in my earlier post on Zonemider installation

Note*

If the Apache is not started Please enter following commands on the Ubuntu terminal

sudo apachectl stop

sudo /etc/init.d/apache2 start

sudo /etc/init.d/apache2 reload

Screenshot from 2018-10-26 17-27-27

 

Figure 3:- Zoneminder 32.2 console and monitor on Ubuntu 18.10 (Cosmic)

 

 

 

 

 

 

 

Advertisements

How to mount Box.com on Ubuntu PC

This post describes ,how to mount Box.com cloud on a desktop with Ubuntu using ,  WebDav , davfs2, gio mount.

Please refer the following site for latest details

How to mount Box.com on Ubuntu PC

davfs2 is a Linux file system driver that allows to mount a WebDAV resource. WebDAV is an extension to HTTP/1.1 that allows remote collaborative authoring of Web resources

First of all you will have to open a free Box.com account

Install davfs2

On the Ubuntu terminal

sudo apt install davfs2

sudo addsuser your username davfs2  ( use your linux username )

sudo dpkg-reconfigure davfs

press <Yes> tab as shown in the flowing figure

(This is to mount Box.com as a non-root user)

Screenshot from 2018-10-15 15-38-19

Figure 1:- configuring  davfs

Open the Nautilus file browserPress the “+ Other Locations” tab .At the bottom of  the opened window you can find a box for connecting to the server .On the box  enter    davs://dav.box.com/dav and press the connect button at the right hand corner .

Then it will prompt to enter username and password of your Box.com account

After entering your password and username tick Remember forever box

Screenshot from 2018-10-13 20-15-53

figure 2:-Entering username and password of your Box.com account

Then a window will popup to enter a key . For the key just hit the enter key of the keyboard .( empty key). This is to make easy to automount the Box.com during the boot time.If you enter a key box.com will not mount at the boot time.

If you miss the entering empty key , you can make the default keyring  empty using “Passwords and Keys” tool as shown in the following figure

Screenshot from 2018-10-15 15-29-48

Figure 3:- Changing default keyring to empty key

Now Box.com is mounted as shown in the following figure.

Screenshot from 2018-10-15 15-36-00

Figure 4:-Bookmarking the Box.com at the location

Now Bookmark the location by pressing the button of the window as shown in Figure 3:-

Next task is to making a script for automounting Box.com at the boot time.

On the terminal

sudo gedit boxmont.sh

Enter the code  ” gio mount davs://dav.box.com “as shown in the figure below and save the file

To make boxmount.sh executable

In the Ubuntu terminal

chmod u+x boxmont.sh

 

Screenshot from 2018-10-14 19-05-24

Figure 5:-Script file to automount Box.com at the boot time

 

Then add the script to startup programs as shown in the following figure

Screenshot from 2018-10-14 19-15-41

Figure 6:-Adding the script to startup programs

If you  restart the computer you will be able to see your box account is mounted automatically on the desktop as shown in the following figure

Screenshot from 2018-10-14 19-12-55

Figure 6:-box.com mounted at the boot time

Note:- Box management has announced that they  will deprecate support for WebDAV after Jan 31, 2019 . Therefore you may not be able to use this method after Jan 2019. But linux users still can use Box.com for auto sync data using git-annex. Please refer my earlier post on “How to sync zoneminder events with box.com account using git-annex on Ubuntu 18.04

How to sync zoneminder events with box.com account using git-annex on Ubuntu 18.04

Our task is to find a method for linux operating systems to automatically upload zoneminder motion detection events to Box.com cloud storage.

I have 3 monitors created on zoneminder and events are stored in 3 separate storage areas. The storage details are shown in the following figure. This blog post explains how to sync events of 3 ZM monitors  with 3 folders in Box.com cloud storage.

Screenshot from 2018-10-14 23-31-17

Figure :-1

Box.com cloud service provides free 10 Gb storage for personal use. Box management has announced that they  will deprecate support for WebDAV after Jan 31, 2019 .Therefore other alternatives have to be found to sync  data in linux platforms with Box.com cloud service. The  syncing  facility is provided only for Microsoft Windows by Box.com.

Git-annex is a very good open source software for linux operating systems to solve the above problem in syncing with Box.com cloud .

How to install git-annex on Ubuntu 18.04

on the Ubuntu terminal

sudo apt update

sudo add-apt-repository ppa:kelleyk/git-annex
sudo apt update

sudo apt install git-annex


In order to use events files in git-annex,  the files at /var/cache/zoneminder/events , /mnt/sdb/zoneminder/events, and /mnt/sda3/zoneminder/events have to be given read and write permissions

On the Ubuntu terminal

sudo chown -R www-data:www-data /var/cache/zoneminder/events

sudo chmod -R g+w /var/cache/zoneminder/events

sudo chown -R www-data:www-data /mnt/sdb/zoneminder/events

sudo chmod -R g+w /mnt/sdb/zoneminder/events

sudo chown -R www-data:www-data /mnt/sda3/zoneminder/events

sudo chmod -R g+w /mnt/sda3/zoneminder/events

Connecting zoneminder events to dedicated drives 

Create a config file under /etc/zm/conf.d . Name the file anything you want just as long as it ends in “.conf”. Add the following content to the file and save your changes:

(In my case I have used ajp.conf as the file name )

sudo gedit /etc/zm/conf.d/ajp.conf

and pasted following codes and  saved  the file in /etc/zm/conf.d

Screenshot from 2018-10-15 09-34-46

Please refer my earlier post to see about using dedicated drives in zoneminder


 

After installing  get a git-annex you will get a launcher icon on the computer

When you double click on the launcher git-annex dashboard will appear on the web browser.

Adding repository for /mnt/sdb/zoneminder/events (figure 2 to figure 8 )

 

Screenshot from 2018-10-14 15-56-42

Figure :-2 Adding repository for /var/cache/zoneminder/events

 

Screenshot from 2018-10-14 15-56-51

 

Figure :- 3 Adding Box.com for /var/cache/zoneminder/events

Screenshot from 2018-10-14 15-57-31

 

 

Figure :- 4  Adding login details for Box.com

note :- Select encryption  disable

 

Screenshot from 2018-10-14 15-58-12

Figure :- 5 Automatically uploading events to Box.com

Screenshot from 2018-10-14 15-59-11

 

Figure :- 6  Uploaded files on annex folder in Box.com

Screenshot from 2018-10-14 16-00-04

 

Figure :- 7 Uploaded files on annex folder in Box.com

Screenshot from 2018-10-14 16-02-17

Figure :- 8 git-annex folder on git-annex console

 

 

Screenshot from 2018-10-14 16-40-46

 

 

Figure :- 9  Adding repository for /mnt/sda3/zoneminder/events


 

Adding repository for /mnt/sdb/zoneminder/events (Figure 10 to figure 6)

Screenshot from 2018-10-14 16-50-13

 

 Figure :- 10

Screenshot from 2018-10-14 16-50-23

Figure :- 11

Screenshot from 2018-10-14 16-50-34.png

Figure :- 12

Screenshot from 2018-10-14 16-50-43.png

 

Figure :- 13

 

Screenshot from 2018-10-14 16-51-34

Figure :- 14

Screenshot from 2018-10-14 16-51-56

Figure :- 15

Screenshot from 2018-10-14 16-52-06

Figure :- 16

Screenshot from 2018-10-14 16-53-27

Figure :- 16 Uploaded events of 3 storage folders are  underlined in red

Screenshot from 2018-10-14 16-54-32

Figure :- 17

Screenshot from 2018-10-14 16-55-48

Figure :- 18 You can see 3 repositories on git-annex dashboard for 3 zoneminder monitors

Screenshot from 2018-10-15 00-53-17.png

 

Figure :- 19

You can see in Figure :- 19 , the git-annex daemon will start at the boot time to facilitate automatic syncing

How to resolve forgotten device password of Hikvision Q1 NETWORK PT CAMERA

IMG_20180623_213220

Figure1 :- Hikvision Q1 NETWORK PT CAMERA

I wanted to add my Hikvision Q1 NETWORK PT camera to Zoneminder .In Order to get RTSP stream we need the device username and  password of the camera. Therefore I have gone through the user manual of the camera for searching the default device   password .But the device password was not given in the brochure given with the camera.  Then I had to export xml file with the SADP tool and send it to the Hikvision support center in Bangladesh to get the key to reset the password. The Hikvision support center has sent keys several times but failed to reset the device password using the SADP tool.Then I have asked them whether there is a default password of the above camera. But they informed me  that there is no default password.

Then I have searched the internet  for the default password of Hikvision Q1 NETWORK PT CAMERA and finally  found a comment made by a gentleman called marku2 in a blog   ipcamtalk that gave a clue for the  default device password of the camera.

The default username and default password of Hikvision Q1 NETWORK PT CAMERA are as follows.

Default username – admin

Default password – admin(verification code on camera sticker)

Note:- You will have to enter the verification code just after “admin” without ( )

IMG_20180926_111521new.jpg

Figure 2 :- The verification code is circled with red .

The procedure I have used has following steps

1 .  The camera is set to factory reset by pressing  the reset button about 5 seconds .

(When you rotate the camera to the fully upward position , you can see a small door on the front face of the camera . You can open the door with a small pin . After opening the door you will be able to see a small grove for the SD card .To the right of the grove you can see the small reset button.)

Note:- Be careful to insert the SD card facing the metal pins in upward position in to the grove

Once the the camera is set to factory reset, the device username and password automatically set in to default values.

2. Now you will have to use Hikvision ivms4200 software to change the default password.

Figure 3 :-Control Panel of ivms4200

Press the device management button and add the camera.

Screenshot from 2018-09-27 00-03-07

Figure 4 :-entering  the IP address and Default  username and password

Figure 5 :-Changing the default password using user button and modify button

Screenshot from 2018-09-26 22-09-36

Figure 6:- Changing the device password

Changing the default password was successful. Then the camera was added to the Zoneminder monitor using the changed password .

Screenshot from 2018-09-27 00-19-33

 

Figure 7:- Zoneminder view of the camera monitor

Internet Connection to Raspberry pi 3 (Raspbian Stretch) with a 4G Huawei Mobile Broadband LTE USB Stick (HUAWEI E3372) using wvdial

This post describes how to use    the linux package “wvdial”   for configuring the USB dongle to obtain internet access  to pi3 .

First connect the 4G Huawei E3372  dongle is connected to a USB port of  the Raspberry pi 3

Required Linux Software

wvdial

usb-modeswitch

ppp

Install above packages using the terminal

sudo apt install ppp usb-modeswitch wvdial

Plug the USB 4G dongle to the Raspberry pi 3

Open the terminal

lsusb

Screenshot from 2018-09-01 00-00-41

Figure 1:- From the above figure it can be seen that USBMODEM=’12d1:1506′

Now you will be able to see the details of the USB dongle on the terminal

Creating a default wvdial.conf file on /etc

wvdialconf /wvdial.conf

Open wvdial.conf using gedit

sudo gedit /etc/wvdial.conf

Then modify the wvdial.conf file as shown below

Screenshot from 2018-09-04 22-31-58

Figure 2:-wvdial.conf file at /etc

As I have used a sim card of Mobitel Sri Lanka at the end of the line no 5 of above file is written as ‘mobitel’

Line no 10 depends on how the dongle is connected in your system.

ttyUSB* is found and automatically written in generated wvdial.conf when you use

“wvdialconf /wvdial.conf” command on the terminal.

ttyUSB* corresponds to USB dongle can also be found using “ls -l /dev/serial/by-id” on the terminal.

Screenshot from 2018-09-05 11-05-52

Figure 3:-

 

Test the connection

sudo wvdial

Now you can see that internet is activated in Raspberry pi 3

 

Making the internet connection automatic during the boot time.

For this purpose we have to make a script file and add an executing command in /etc/rc.local

sudo gedit 4GModam.sh

write following lines in the file and save

#!/bin/bash

wvdial

sudo chmod +x 4GModam.sh

Screenshot from 2018-09-04 22-32-58

Figure 4:- 4GModam.sh script file at /home/pi

Including executive command in /etc/rc.local to activate 4GModam.sh during the boot time

sudo gedit /etc/rc.local

Add the following command above “ext0” command in /etc/rc.local and save

sh ‘/home/pi/4GModam.sh’

Screenshot from 2018-09-04 22-34-03

Figure 5:- Editing  /etc/rc.local

Reboot the Raspberry pi 3

Now you can observe that the internet connection is activated in Raspberry pi 3


 

Internet Connection to Raspberry pi 3 (Raspbian Stretch) with a 4G Huawei Mobile Broadband LTE USB Stick (HUAWEI E3372) using sakis3g

Getting an internet  connection to Raspberry pi (with Raspbian Stretch)using a USB dongle is not that straightforward .

We know that 4G Huawei E3372  dongle is identified immediately and ready to use once it connected to a  Windows  or Ubuntu PC.

But for Raspberry pi , you will have to do some more work to get internet .

First connect the 4G Huawei E3372  dongle is connected to a USB port of  the Raspberry pi 3.

This post describes how the free software called   “sakis3g”  can be used for configuring the USB dongle to obtain internet access  to pi3 .

To get internet We are going to install following packages.

ppp package

sakis3g

usb-modeswitch

umtskeeper

Open the Terminal

sudo apt-get update
sudo apt-get install ppp
sudo apt-get install ppp usb-modeswitch
cd ~
pwd
mkdir umtskeeper
Download sakis3g.tar.gz file from sourceforge .
cd Downloads
Then copy the downloaded sakis3g.tar.gz file to the folder umtskeeper
cp sakis3g.tar.gz /home/pi/umtskeeper
cd ..
cd umtskeeper/
tar -xzvf sakis3g.tar.gz
chmod +x sakis3g

wget "http://mintakaconciencia.net/squares/umtskeeper/src/umtskeeper.tar.gz"
tar -xzvf umtskeeper.tar.gz
chmod +x umtskeeper


sudo ./sakis3g --interactive
Use 0 for APN username and password
Since my internet service provider  is mobitel Sri Lanka , I have used mobitel in sakis3g menu

 

 

 

 

Figure 1:-Connecting to internet using Sakis3G .You can see from above figures that the USBINTERFACE=’1′

Screenshot from 2018-08-31 19-34-12

Figure 2:- Internet is established using the 4G dongle

On the terminal to get the USBMODAM ID

lsusb

Screenshot from 2018-09-01 00-00-41

Figure 3:- From the above figure it can be seen that USBMODEM=’12d1:1506′

Using the data of Figure 1 and Figure 3 on the terminal
sudo ./sakis3g connect --sudo --console USBINTERFACE='1' OTHER='USBMODEM' USBMODEM='12d1:1506' SIM_PIN='1234' APN='CUSTOM_APN' CUSTOM_APN='mobitel' APN_USER='0' APN_PASS='0'" --sakisswitches "--sudo --console" --devicename 'Huawei' --log --nat 'no'


cat /var/log/umtskeeper.log
Screenshot from 2018-09-01 16-05-02

Figure 5:- Details in the log file


How to make internet connection automatic during the boot time of the PI 3 

sudo gedit /etc/rc.local 

add the following line to rc.local script file and save .This script file activates during the boot time to facilitate automatic internet connection
/home/pi/sakis3g connect --sudo --console USBINTERFACE='1' OTHER='USBMODEM' USBMODEM='12d1:1506' SIM_PIN='1234' APN='CUSTOM_APN' CUSTOM_APN='mobitel' APN_USER='0' APN_PASS='0'" --sakisswitches "--sudo --console" --devicename 'Huawei' --log --nat 'no'

Screenshot from 2018-09-04 17-20-48

  Figure 5:- Codes in file rc.local at /etc ( the codes underlined with green have to be changed to suit your dongle)

reboot pi 
Now you can see that the internet connection is established when the pi 3 is started

Note :- If you install Ubuntu MATE 16.0  , instead of Raspbian  on Raspberry pi 3 , USB internet Dongle can be used to access internet without Sakis3g or wvdial 
IMG_20180907_164742

Reference :-
mintakaconciencia.net

How to use a partition of a disk as a Dedicated Drive for ZoneMinder, v1.31.46. on Ubuntu 18.04 LTS Computer

This post explains how to use a partition of a disk of a  PC to store zoneminder events instead of saving on the computer ( At /var/cache/zoneminder/events).

To enable to write data of zoneminder to the partition of the drive , It is necessary to mount the usb drive  on the file system of the PC .

For the installation details of Zoneminder please refer my earlier post 

For the latest details please refer the following site

How to use a partition of a disk as a Dedicated Drive for ZoneMinder

First make a partition of the disk and formatted it to ext4 .

For partitioning , It is easy to use GParted-LiveCD Ref https://gparted.org/download.php (You will have to download GParted live and write it to a cd )

 

After rebooting you will be able to see the partition using following methods

Open the Ubuntu terminal

ls -l /dev/disk/by-uuid

Screenshot from 2018-08-29 23-33-41

Figure 1 :-Getting details of disk using the Ubuntu terminal ( ls -l /dev/disk/by-uuid )

Screenshot from 2018-08-29 23-32-05

Figure 2:- Getting details of disk  using gnome-disk-utility

 

Screenshot from 2018-08-29 23-31-16

Figure 3:-mounted disks.  The sda3 was named as zmdata during the partitioning

You can see the sda3 is mounted on /media/bkjaya1952/zmdata. But without mounting on the file system of the PC zoneminder  will not be able to write data in to sda3. Therefore you will have to create a Systemd Mount Unit.

Creating Systemd Mount Unit

Open the Ubuntu terminal

sudo mkdir /mnt/sda3

sudo gedit /etc/systemd/system/mnt-sda3.mount

and paste the following codes into mnt-sda3.mount and save
(details of uuid of usb was taken from figure 1 and figure 2)

Screenshot from 2018-08-30 16-29-23

Figure 4:-Codes in mnt-sda3.mount

sudo systemctl enable mnt-sda3.mount

sudo systemctl start mnt-sda3.mount

Then restart the computer

Now if you see the folder /mnt/sda3 ,you can see that the disk partition is mounted on /mnt

Screenshot from 2018-08-30 09-31-46

Figure 5:-The sda3 Partition is now mounted on the file system of the PC

If you compare Figure 2 and Figure 5 You can see the sda3 is mounted on the file system now

Create a folder called “zoneminder” on the mounted sda3. Then create folders “events”  with in the folder “zoneminder”

Open the ubuntu terminal

cd /mnt/sda3

mkdir zoneminder

cd zoneminder

mkdir events

sudo chown -R www-data:www-data /mnt/sda3/zoneminder

sudo chown -R www-data:www-data /mnt/sda3/zoneminder/events

Screenshot from 2018-08-29 23-46-46

Figure 6:-

Create a config file under /etc/zm/conf.d . Name the file anything you want just as long as it ends in “.conf”. Add the following content to the file and save your changes:

(In my case I have used ajp.conf as the file name )

sudo gedit /etc/zm/conf.d/ajp.conf

and pasted following codes and  saved  the file in /etc/zm/conf.d

Screenshot from 2018-08-30 16-42-30

Figure 7:-

 

Open the ZM console and go to Options/Storage and add a NewStorage

added Storage path as /mnt/sda3/zoneminder/events

Please refer the following figure for the details

Figure 8:-Creating  a New Storage for the Monitor

Then enter following command on the Ubuntu terminal to start zoneminder.

sudo systemctl start zoneminder

Screenshot from 2018-08-30 09-37-44

Figure 9:-ZM Console and the monitor

 

Screenshot from 2018-08-30 09-41-26

Figure 10:- Saved ZM events on the mounted disk partition

( At/mnt/sda3/zoneminder/events)

 

Reference :-

Zoneminder Official Installation Guide

Andrew Bauer’s  blog-page