How to Install ZoneMinder-Master latest ,on UBUNTU 20.10 ( groovy )

Since there is a Dependency wait on lgw01-amd64-002 , the zoneminder ( groovy) can’t be installed directly.

Therefore until the official lgw01-amd64-002 is released ,as an alternative method we can install Zoneminder master -focal on UBUNTU 20.10 ( groovy )

When we try to install Zoneminder master -focal on UBUNTU 20.10 ( groovy ) , we have to face dependency problems where we can overcome such problems by installing following software by the following order.

  1. libmp4v2-2_2.0.0~dfsg0-focal1_amd64.deb (Download the deb file and install using GDebi installer )
  2. libx264-155_0.155.2917+git0a84d98-2_amd64.deb (Download the deb file and install using GDebi installer )
  3. mysql-server ( apt install mysql-server )
  4. apache2 ( apt install apache2 )
  5. zoneminder master latest focal ( Download the deb file and install using GDebi installer )
Figure:-1 Dependency wait on lgw01-amd64-002 , -zoneminder ( groovy)

Figure:-2 The web site to download libmp4v2-2_2.0.0~dfsg0-focal1_amd64.deb

Figure:-3 The web site to download libx264-155_0.155.2917+git0a84d98-2_amd64.deb

First using GDebi package installer install libmp4v2-2_2.0.0~dfsg0-focal1_amd64.deb and libx264-155_0.155.2917+git0a84d98-2_amd64.deb

Then open the ubuntu terminal and install mysql-server and apache2 as follows

sudo apt install mysql-server
sudo apt install apache2

Figure:-4 The web site to download zoneminder_1.35.16~20201227195743-focal_amd64.deb

Then Install the downloaded zoneminder_1.35.16~20201227195743-focal_amd64.deb using GDebi package installer

Configuring Mysql and alter mysql root password 

sudo su

mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'yourpassword';" 


(replace yourpassword with the new password) 
rm /etc/mysql/my.cnf  

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

/etc/init.d/mysql start 

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




(Enter your mysql root password when ask for password)

( If you get an error "ERROR 1050 (42S01) at line 1034: Table 'Sessions' already exists" due to existence of zm database ,when creating zm sql database , you will have to drop the existing zm database as follows on the Ubuntu terminal and retry above command again

mysql -e "drop database zm;"  )
 
mysql -e "CREATE USER 'zmuser'@localhost IDENTIFIED BY 'zmpass';"


( If CREATE does not work try with ALTER ) 
 
mysql -e "GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION;"
 
mysql -e "FLUSH PRIVILEGES ;"

mysqladmin -uroot -p reload

(Enter your mysql root password when ask for password)


Configuring Zoneminder

chmod 740 /etc/zm/zm.conf 

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

adduser www-data video 

a2enmod cgi  

a2enconf zoneminder 

a2enmod rewrite  

a2enmod headers  

a2enmod expires 

Starting Zoneminder and apache

systemctl enable zoneminder 

service zoneminder start  

service apache2 reload   

Open zoneminder web console (http://localhost/zm/)




Figure:-5 Zoneminder master 1.35.16~20201227195743-focal running on Ubuntu 20.10 ( groove)

			

How to install the Zoneminder master latest on Ubuntu 20.04 using a docker image

Zoneminder-master , latest. docker image with Mysql 8 & MSMTP

Based on Isaac Connor’s ZoneMinder Master Snapshots at https://launchpad.net/~iconnor/+archive/ubuntu/zoneminder-master

This image has been created on ubuntu:focal with zoneminder-master/ubuntu focal main To pull the Repository from the dockerhub please refer the following link

https://hub.docker.com/r/bkjaya1952/zoneminder-master-docker-latest

Usage :

To create a Zonminder-master docker container (name zm)with mysql 8 & msmtp

On the Ubuntu terminal enter the following commands

sudo docker create -t -p 8080:80 --shm-size=4096m --name zm --privileged=true -e TZ=Asia/Colombo bkjaya1952/zoneminder-master-docker-latest

Note:- Replace Asia/Colombo with your Time Zone

sudo docker start zm

(You will have to configure the running zm container for mysql 8 ,zm data base during the first run .)

sudo docker exec -t -i zm /bin/bash

(Now you will be with in the zm container.

Make changes as follows)

(Configuring Mysql )

firstrun.sh

exit

sudo docker restart zm

http://localhost:8080/zm/

To use msmtp for emailing

The msmtp is already installed within the zm docker container . You will have to configure the file msmtprc with your email address etc . and copy it to the zm container. For creating the file you can use a text editor or gedit .

The codes of the msmtprc file are as follows.

# Set default values for all following accounts.
 defaults
 auth on
 tls on
 tls_trust_file /etc/ssl/certs/ca-certificates.crt
 logfile ~/.msmtp.log
 Gmail
 account gmail
 host smtp.gmail.com
 port 587
 from cheguevara@gmail.com
 user cheguevara@gmail.com
 password xxrt1234
 Set a default account
 account default : gmail

You will have to replace "cheguevara@gmail.com" with your own email address

Replace xxrt1234 with your email password 

Then copy msmtprc file from host to zm container 

sudo docker restart zm

sudo docker exec -t -i zm /bin/bash

sudo docker cp msmtprc zm:/etc/

Then fill the cages in menu of Options>Email of the Zoneminder panel & create the necessary filter to trigger e mailing process .





Figure:-1 ZM panel
Figure:- 2 Configuring Emal in Zm panel

Figure:-3 Creating Filter to trigger Emailing when there is motion detection
Figure:-4 Motion detection alert in the receiving email

Note:- If you want your docker container zm to detect ip camera automatically, you will have to use following command when creating the container .

sudo docker create -t -p 80:80 --shm-size=4096m --name zm --network=host --privileged=true -e TZ=Asia/Colombo bkjaya1952/zoneminder-master-docker-latest

In this case you will have to restrain in using the port 80 in your host for any other purpose when running the zm container.

Then the Zoneminder web panel will be at http://localhost/zm/

Note:- The above docker image is based on Zoneminder master .
For the stable release of Zoneminder 1.34,  docker image please refer the following link
https://hub.docker.com/r/bkjaya1952/docker-zoneminder-php7.4-mysql8

How to Install ZoneMinder-Master ,latest on UBUNTU 20.04 LTS ( Focal Fossa)

Installation of Zoneminder To install Zoneminder-Master , Please refer Connor’s web site Open the terminal and run following commands.

sudo su 

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

sudo apt update 

apt install zoneminder 

Configuring Mysql and alter mysql root password 

mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'yourpassword';" 

(replace yourpassword with the new password) 

rm /etc/mysql/my.cnf  

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

/etc/init.d/mysql start 

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

(Enter your mysql root password when ask for password)

( If you get an error "ERROR 1050 (42S01) at line 1034: Table 'Sessions' already exists" due to existence of zm database ,when creating zm sql database , you will have to drop the existing zm database as follows on the Ubuntu terminal and retry above command again

mysql -e "drop database zm;"  )
 
mysql -e "CREATE USER 'zmuser'@localhost IDENTIFIED BY 'zmpass';"

( If CREATE does not work try with ALTER ) 
 
mysql -e "GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION;"
 
mysql -e "FLUSH PRIVILEGES ;"

mysqladmin -uroot -p reload

(Enter your mysql root password when ask for password)

Configuring Zoneminder
chmod 740 /etc/zm/zm.conf 

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

adduser www-data video 

a2enmod cgi  

a2enconf zoneminder 

a2enmod rewrite  

a2enmod headers  

a2enmod expires 
Starting Zoneminder and apache

systemctl enable zoneminder 

service zoneminder start  

service apache2 reload   

Open zoneminder web console (http://localhost/zm/)

How to make Zoneminder to trigger an Audible Alarm when detects a motion

In old Zoneminder versions there was a provision to triggering an audible alarm under Options>Web>

WEB_POPUP_ON_ALARM,

WEB_SOUND_ON_ALARM

WEB_ALARM_SOUND

But it has been observed that the alarm triggering doesn’t work by this method in latest versions of Zoneminder.

Figure:- Alarm sound setup under Options>Web>

Therefore , as an alternative , the following method has been tested and the results were found successful

In this method Zoneminder filter is used to match the motion detection events to trigger a alarm sound clip stored at the folder /usr/share/zoneminder/www/sounds/ .

To play the sound file software mpg123 is used

Open the Ubuntu terminal and run

sudo apt install mpg123
sudo mkdir /usr/share/zoneminder/www/sounds

Then copy the alarm sound clip to the folder /usr/share/zoneminder/www/sounds/

sudo cp alarm.mp3 /usr/share/zoneminder/www/sounds/

Then make a filter as shown in the figure below and save then execute

Figure:- 2 Making a zm filter

In the cage “Execute command on all matches” enter the following command to enable to play the sound file when the stipulated conditions are satisfied

mpg123 /usr/share/zoneminder/www/sounds/alarm.mp3

Make sure to tick the box at “Run filter in background”

You can see the audible alarm is working in this link below

https://www.dropbox.com/s/aodfhyzf5x8n7ue/vokoscreen-2020-11-08_10-15-31.mkv?dl=0

How to install Docker Water issue Scheduling software for Paddy based on rotational water issue (with fixed time table and variable discharge) on Ubuntu 20.04

DOSBox from https://www.dosbox.com/

Lotus123/Dos from https://vetusware.com/manufacturer/Lotus%20Software/?author=86

A docker image with pre-installed Lotus123 & Water Scheduling Software for Paddy on DOSBox

The docker repository bkjaya1952/q4wine-x11vnc-novnc-docker has been used as the base image

Introduction:-

The water issue scheduling software incorporated in this docker repository has been used in preparation and monitoring of water issue schedules for Paddy cultivation in Krindi Oya Irrigation Project Sri Lanka successfully in the year 1988 .The water issue schedules were prepared based on field>distributor>branch>main canal level rotation. The scheduling software package has been created using Lotus123 with macro programs. In this software the water issue schedules are prepared with definite opening and closing time table of the field canal off take gates such that the farmers can easily adhere in to it . It is based on fixed water issue duration and variable discharge depending on the stage of crop . The rotational time table can not be adopted during the land preparation period as the water requirement is high . Therefore continuous discharge is issued for land preparation.Although this software was designed for In Kirindi Oaya Irrigation project , it can be adopted to any other project of similar nature , with minor adjustments.

You can get more details on the software from the following document presented in 1988 for the annual sessions in the Institution of Engineers , Sri Lanka by the author.

For more details please see this video – https://youtu.be/PZWxk-WLDR0

Usage :-

To create Water Scheduling Software for Paddy using bkjaya1952/docker-water-schedule4paddy-novnc-dosbox-lotus123 Refer:-

https://hub.docker.com/r/bkjaya1952/docker-water-schedule4paddy-novnc-dosbox-lotus123

On the Ubuntu terminal

sudo docker create -t -p 8008:8080 --name lotus --privileged=true bkjaya1952/docker-water-schedule4paddy-novnc-dosbox-lotus123

sudo docker start lotus

xdg-open http://localhost:8008/vnc_lite.html

Figure:- 1
Flow Chart of the Program

Water issue scheduling computer program package consists of 3 inter connected main spread sheets with with macro programing namely FARM.WK1, CORE.WK1 and CHITRA.WK1.

FARM.WK1- unit water requirement calculations . When you input data to the menu at FARM.WK1 and select the O & M week for scheduling is necessary by pressing Auto button in the menu , the maximum water requirements and irrigation factors are automatically saved in OM.WK1 and retrieve the CORE.WK1 file

OM.WK1 is the work sheet with the details of maximum water requirements for upland and low land paddy and irrigation factors pertaining to the O&M week that has been selected for preparation of schedules using the CORE.WK1.

CORE.WK1- main water issue scheduling program which computes field canal , d canal , branch canal discharges with time tables up to tract level. For the calculation of schedules CORE.WK1 uses the data at OM.WK1 ,DAT(L or R) (Tract No) and A(L or R)T (Tract No).WK1 . When the water scheduling is finished tract wise and press the SLUICE button is pressed program automatically save the data necessary to compute sluice issues in C(L or R) T (Tract No).WK1 files and automatically retrieve the CHITRA.WK1

DAT(L or R) (Tract No) .WK1 files are data files with the acreage data with soil classifications .

A(L or R)T (Tract No).WK1 . files have the necessary structures with cell formula to aggregate field canal level discharges to compute the discharges at d canals, branch canals tract wise once these files are merged with CORE.WK1

CHITRA.WK1 – computes discharge schedule at the sluice gate level

DAT(L or R) (Tract No) .WK1 files are data files with the acreage data with soil classifications .

Figure:- 2 FARM.WK1 , spread sheet with macro for crop water requirement calculations( Alt m)

This menu comes automatically . But it can also be retrieved by pressing Alt M keys

CORE.WK1 – The two menu come automatically during the execution of program . But those two menus can be retrieved by pressing Alt A and Alt m keys respectively .

Figure:-4 CHITRA.WK1 , for the calculation of water discharge at the main sluice gate of the reservoir (Alt m)

CHITRA.WK1 – The menu comes automatically during the execution of program . But it can also be retrieved by pressing Alt m keys

How to install the latest Zoneminder master on Ubuntu 20.04 using a docker image

Zoneminder-master , latest. docker image with Mysql 8 & MSMTP

Based on Isaac Connor’s ZoneMinder Master Snapshots at https://launchpad.net/~iconnor/+archive/ubuntu/zoneminder-master

This image has been created on ubuntu:focal with zoneminder-master/ubuntu focal main To pull the Repository from the dockerhub please refer the following link

https://hub.docker.com/r/bkjaya1952/zoneminder-master-docker-latest

Usage :

To create a Zonminder-master docker container (name zm)with mysql 8 & msmtp

On the Ubuntu terminal enter the following commands

sudo docker create -t -p 8080:80 --shm-size=4096m --name zm --privileged=true bkjaya1952/zoneminder-master-docker-latest

sudo docker start zm

(You will have to configure the running zm container for mysql 8 ,zm data base and edit the timezone during the first run .)

sudo docker exec -t -i zm /bin/bash

(Now you will be with in the zm container.

Make changes as follows)

(Configuring Mysql and Changing root password)

mysql

ALTER USER 'root'@'localhost' IDENTIFIED BY 'yourpassword';

FLUSH PRIVILEGES ;

quit

(Creating zm sql data base)

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

mysql

CREATE USER 'zmuser'@localhost IDENTIFIED BY 'zmpass';

(If CREATE does not work try with ALTER )

GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION;

FLUSH PRIVILEGES ;

quit

mysqladmin -uroot -p reload

(Note:- Here use the ‘yourpassword’ created for ‘root’@’localhost’ earlier )

dpkg-reconfigure tzdata

Then edit your timezone

exit

sudo docker restart zm

http://localhost:8080/zm/

(To use msmtp for emailing please refer https://hub.docker.com/repository/docker/bkjaya1952/docker-zoneminder-master)

( The procedure of composing an image can be obtained from the following links

https://bkjaya.wordpress.com/2020/01/15/how-to-build-a-zoneminder-master-docker-image-with-mysql-8-msmtp/ )

Note:- If you want your docker container zm to detect ip camera automatically, you will have to use following command when creating the container .

sudo docker create -t -p 80:80 --shm-size=4096m --name zm --network=host --privileged=true bkjaya1952/zoneminder-master-docker-latest

In this case you will have to restrain in using the port 80 in your host for any other purpose when running the zm container.

Then the zoneminder web panel will be at http://localhost/zm/

Refer the following link for an alternative method

https://bkjaya.wordpress.com/2020/12/24/how-to-install-the-latest-zoneminder-master-latest-on-ubuntu-20-04-using-a-docker-image/

How to install bkjaya1952/docker-novnc-guvcview on Ubuntu 20.04

A docker image pre-installed guvcview-inux based on guvcview and bkjaya1952/q4wine-x11vnc-novnc-docker

Refer:- http://guvcview.sourceforge.net/

Usage :-

To create a guvcview (name gvw) using bkjaya1952/docker-novnc-guvcview

Refer:- https://hub.docker.com/r/bkjaya1952/docker-novnc-guvcview

On the Ubuntu terminal

sudo docker create -t -p 8008:8080 --name gvw --privileged=true bkjaya1952/docker-novnc-guvcview
sudo docker start gvw
xdg-open http://localhost:8008/vnc_lite.html

Then the novnc desktop with q4wine will appear on the web browser at the startup.

At the first run of the docker container , you will have to run the first startup wizard to configure the q4wine as follows.

The it will automatically download wine and install.

For configuring q4wine please refer the following link

https://hub.docker.com/r/bkjaya1952/q4wine-x11vnc-novnc-docker

Figure:- 1 Press autodetect button to include drive Z: during configuring q4winehttps://raw.githubusercontent.com/bkjaya2020/bkjaya1952-docker-novnc-guvcview/master/Screenshot%20from%202020-09-09%2017-06-08.png

Figure:- 2 Right click on wine desktop to add new icon for guvcview https://raw.githubusercontent.com/bkjaya2020/bkjaya1952-docker-novnc-guvcview/master/Screenshot%20from%202020-09-09%2017-09-11.png

Figure:- 3 Fill the box as shown in the figure to connect guvcview starter at /usr/bin/guvcview in the drive Z:https://raw.githubusercontent.com/bkjaya2020/bkjaya1952-docker-novnc-guvcview/master/Screenshot%20from%202020-09-09%2017-10-46.png

Figure :- 4 guvcview USB camera stream at http://localhost:8008/vnc_lite.html

How to change the timezone

After quitting the noVNC

On the terminal enter

vim /etc/timezone

Then the timezone file is opened

Go to the top line of the file , press insert key on your key board and enter your timezone ( ie Asia/Colombo)

Then press the Esc key and Shift : x to save & quit the file

https://youtu.be/b-gl_9BAMPo

Note:- For an improved & lighter docker guvcview image please refer the following link.

https://hub.docker.com/r/bkjaya1952/novnc-guvcview-new

How to solve the problem of inability in creating a USB Camera moitor in Zoneminder v 1.34.17 to v 1.34.19

In the Zoneminder v1.34.17 to v1.34.19 issued up to now, can’t add USB camera monitors using the menu.

Figure:1 USB Camera monitor can’t be added

Zoneminder master versions do not have this problem.

But , USB camera can be added to Zoneminder 1.34.19 ,when you copy the codes of device format and capture pallet from Zoneminder 1,34.16 to Zoneminder 1.34.19 ,( using the Inspect Element (Q) in the web browser).

Figure:-2 After coping the codes of device format and capture pallet from Zoneminder 1,34.16 to Zoneminder 1.34.19 , USB Camera monitor can be added.

But the above solution is not a complete one as every time you add or edit the monitors , you will have to do coping the codes.

I could not find a solution from the zonminder forum .

Then I contacted Mr knight-of-ni and requested him to solve the matter . Mr knight-of-ni responded promptly and informed me that Mr Isaac Connor has already found a solution . Then he gave me the following link where the necessary codes are available , in order to correct the problem. He also informed me that , Isaac Connor will issue release 1.34.20 soon with necessary corrections . Until then we can try Isaac Connor’s codes to solve the problem as follows.

https://github.com/ZoneMinder/zoneminder/commit/c87886f5a5c0e0d2791d8f765686f0f7e64d76ab

Figure:-3 Isaac Connor’s solution to USB Camera monitor problem

How to solve the problem.

Open the Ubuntu terminal and then run

sudo gedit /usr/share/zoneminder/www/skins/classic/views/monitor.php

############################################################
Then delete the line 778 to 780
############################################################

<tr><td><?php echo translate('DeviceChannel') ?></td><td><select name="newMonitor[Channel]"><?php foreach ( $v4l2DeviceChannels as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $monitor->Channel()) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>

<tr><td><?php echo translate('DeviceFormat') ?></td><td><select name="newMonitor[Format]"><?php foreach ( $v4l2DeviceFormats as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $monitor->Format()) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>

<tr><td><?php echo translate('CapturePalette') ?></td><td><select name="newMonitor[Palette]"><?php foreach ( $v4l2LocalPalettes as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $monitor->Palette()) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>


############################################################
Then copy and paste the codes marked in green in the file at the above link (line 778 to 779)
############################################################
<tr>

<td><?php echo translate('DeviceChannel') ?></td>

<td><?php echo htmlSelect('newMonitor[Channel]', $v4l2DeviceChannels, $monitor->Channel()); ?></td>

</tr>

<tr>

<td><?php echo translate('DeviceFormat') ?></td>

<td><?php echo htmlSelect('newMonitor[Format]', $v4l2DeviceFormats, $monitor->Format()); ?></td>

</tr>

<tr>

<td><?php echo translate('CapturePalette') ?></td>

<td><?php echo htmlSelect('newMonitor[Palette]', $v4l2LocalPalettes, $monitor->Palette()); ?></td>

</tr>

############################################################

Then save the edited monitor.php file at /usr/share/zoneminder/www/skins/classic/views/

Restart the Zoneminder.

Now the USB monitors can be added to Zoneminder 1.34.19 as usual .

Figure:-4 After making corrections using Isaac Connor’s solution to USB Camera monitor problem
Acknowledgements:-
Thanks to Mr knight-of-ni for informing me about Mr Isaac Connor's solution on USB Camera monitor problem.

How to use a mobile phone connected to Linux PC via USB cable as a web camera

We are going to use droidcam app to convert a smart mobile phone to an USB-Camera of a PC with Ubuntu 20.4.

In order to make the mobile phone as the usb-camera , following steps have to be followed.

  1. Install droidcam in the mobile phone using the Google app store .

2. Install following programmes on the PC

Install droidcam linux on the PC

sudo apt install adb

Install droidcam linux on the PC

Open the Ubuntu terminal and run follwing commands

cd /tmp/

wget https://files.dev47apps.net/linux/droidcam_latest.zip

echo "73db3a4c0f52a285b6ac1f8c43d5b4c7 droidcam_latest.zip" | md5sum -c --

If every thing is correct you will get this prompt " # OK? "

unzip droidcam_latest.zip -d droidcam && cd droidcam

sudo ./install

To start droidcam run on the Ubuntu terminal

droidcam

Please refer the following link for more details on installation.

 https://www.dev47apps.com/droidcam/linux/
Figure:-1 After installing droidcam android app on the mobile phone

Then you will have to edit DroidCam port . In this example we have changed the port to 8085

Figure:-2 Changing the DroidCam port top 8085

To change the DroidCam port you will have to open the droidcam app in the mobile phone and go to menu.

To connect the phone to the PC under the Developer options> USB debugging mode, You will have to activate the camera in to USB debugging mode .

My Phone is HWAWEI TIT-AL00

First connect the phone to the PC using the USB cable

How to get Developer options

On the phone ,Go to Settings>About phone>Build number

Tap on the Build number as per the instructions appear on the screen

Then go back to settings and see the “Developer options” appears on the settings menu

Now go to Developer options and activate USB debugging

Then allow to connect the phone to connect the PC

How to use droidcam in PC to connect the phone

In the PC , open the Ubuntu terminal and run

droidcam


Then the DroidCam client  menu will appear .
Then tick USB(Android) box and hit the start button to activate the connection  of  phone and PC through USB cable.
 
Figure:-4 Installing DroidCam on PC & Running

From the Figure:-4 you cane see the Device /dev/video is ‘Droidam’

Open the web browser and go to the following link to see the camera .

http://127.0.0.1:8085

Figure:-5 USB camera view of PC

Figure:-6 The screen of the phone when connected to PC

Note:- Other than USB cable connection ,the camera phone can be connected to PC using the wifi

How to use Serveo to view Zoneminder Console & Motion Detection events remotely – Ubuntu 20.04

Installation procedure of Docker Zoneminder Master on Ubuntu 20.04 is described in the following post.

How to install ZoneMinder Master, v1.35.4 on UBUNTU 20.04 LTS ( Focal Fossa) Using a Docker image

After the installation , the Zoneminder Console can be obtained from the following link.

http://localhost:8080/zm/

The next task is to view the Zoneminder remotely using Serveo

The Serveo is a software that can expose a local server to the internet.

There is no installation or signup required.

Serveo is an SSH server just for remote port forwarding. When a user connects to Serveo, they get a public URL that anybody can use to connect to their localhost server.

Open the Ubuntu terminal in the local computer where the Zoneminder is installed.

Let us select the name of the public url as abcd2020

sudo start zm

ssh -R abcd2020:80:localhost:8080 serveo.net

Then you get the following public url of the port forwarded (from 8080 to 80) localhost of the local pc

Forwarding HTTP traffic from https://abcd2020.serveousercontent.com
Figure:-2 Using Serveo to get the public url of the localhost:8080

Now if you copy above url to a remote computer or smart phone , you can access the localhost:8080 on the screen.

If you add /zm to the above link , you will be able to access the Zoneminder Console on the remote computer of smart phone

Figure:-3 localhost:8080 on smart phone
Figure:-4 Zoneminder Console on the smart phone

For the additional safety , It is advisable to have a password protection to the local host and the zoneminder.

——————————————————————————————————————–

How to add password protection to the localhost

It is necessary to copy the index.html file from the docker container zm to the host and edit with password protection commands and copy back to the zm container

Coping /var/www/html/index.html file from zm container to ~/Documents directory of the host pc

sudo docker cp zm:/var/www/html/index.html ~/Documents

sudo chmod 777 ~/Documents/index.html

Now edit the copied file by adding the following html scripts highlighted in red in the figure below for password protection as follows.

Figure:-5 Editing index.html for password protection
<html>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Password Protected page</title>
<script type="text/javascript">
var s ="";


while (s!= "yourpassword")
{
s=prompt("please enter your password");
if (s!= "yourpassword!")


{
alert("Incorrect password-Try again");


}
}
</script>
</head>


<body>
</body>
</html>
You can use gedit to edit the index.html file . The two empty white boxes at line no 16 and 19 are for your password for the localhost. You will have to fill the space with  your password and save.And then copy back to the original place in the zm container as follows
sudo docker cp ~/Documents/index.html zm:/var/www/html/index.html

Now the localhost is password protected

How to make Zoneminder password protected

Go to Options>system of the Zoneminder Console and tick the boxes as shown in the follwing figure.

Figure:-6 Zoneminder with password protection

Then go to Options>Users>admin and enter your password for Zoneminder and save. Restart Zoneminder .

Now the zoneminder is password protected.

Following are the outcome at remote smart phone when accessing Zoneminder Console after the two protections above for the localhost and the Zoneminder .

Zoneminder Console is obtained by adding /zm to the port forwarded serveo url of localhost:8080 ( In our case https://abcd2020.serveousercontent.com/zm ).

You can replace the name abcd2020 to suit your requirement.

Figure:- 9 Zoneminder Console at the remote smart phone.

You can control your Zoneminder at PC from the remote smart phone . The motion detection events can also be viewed using the smart phone.