You are on page 1of 33

How to control a motionEye CCTV system remotely

over the internet using free balenaCloud


Suppose our operating system is Ubuntu 20.10
Our task in this tutorial is to make a CCTV system of motionEye that can be control remotely using
balenaCloud.
The belenaCloud can connect with devices like Rasberi pi , banana pi , qemu vm etc. The
balenaCloud is free for your first 10 devices
Since the normal desktop pc is not considered as a compatible device with belenaCloud , first We
will have to install QEMU on Ubuntu 20.10 . Please refer How to install QEMU on UBUNTU
20.04 LTS ( Focal Fossa)
Then, we can login to balena using the Ubuntu terminal and get a compatible QEMU X86 64bit
(NEW) disk image downloaded in to the computer .This image contains balena os.
We are going to interact with the device qemu_zm using the balena cli
First download balena-cli-v11.36.0-linux-x64-standalone zip file from the following site.
https://github.com/balena-io/balena-cli/release
Then extract the file to your Documents folder of the PC
Installation of balena cli
Open the Ubuntu terminal and change the directory to ~/Documents/balena-cli-v11.36.0-linux-x64-
standalone/balena-cli where the installation files are stored in the downloaded balena cli file
Open the Ubuntu terminal and run
sudo su

docker login

apt install npm

npm install -g npm npm

install balena-cli -g --production --unsafe-perm

balena login

( Note : For login you need a docker account . you can signup to docker hub to make a docker
account.In order to login to balena ,you will have to use the username and paassword of the
docker account . After you get the balenaCloud web page using the link created in the balena
login process on the Ubuntu terminal , you will have to press authorization button on the web
page . If you don't have a balena cloud account , you will have to sign up and get an account .
After signup , You will have to crate a new application and add a device QEMU X86 64bit
(NEW) and get the disk image downloaded )
The capacity of the downloaded image is not sufficient to install motionEye . Therefore we will
have to increase the disk size.
Then you will have to create a virtual machine on QEMU using the downloaded QEMU X86 64bit
(NEW) disk image
Then extract the downloaded QEMU X86 64bit(NEW) disk image to a folder
~/Documents/motionEye/
( you have to create this sub folder motinEye in the Documents directory of your computer )
Open the Ubuntu terminal and run
cd ~/Documents/motionEye/

sudo chmod 777 balena-cloud-motionEye-qemux86-64-2.38.0+rev1-v9.15.7.img

sudo qemu-img resize balena-cloud-motionEye-qemux86-64-2.38.0+rev1-v9.15.7.img


+5G

( Here we are increasing the image size by 5G , Be careful to use the correct
name of your img file in the above codes )

Now using the above disk image of increased size , you will have to create a new Virtual Machine
in QEMU , using Virtual Machine manager.
After booting the newly created virtual machine , go to the balenaCloud and add the above device
Then open the motinEye device in the balenaCloud and go to summary sub menu and open the
balena terminal and run to install docker motionEye ( ccrisan/motioneye )
balena login

( Note:- Here use your username and password of your docker account)

balena create -t -p 80:8765 -p 8081:8081 --shm-size=1500m --name motioneye --


privileged=true -e TZ=Asia/Colombo --restart="always" ccrisan/motioneye:master-
amd64

( Note:- Replace Asia/Colombo with your timezone )


balena start motioneye

( Be careful to keep running your newly created virtual machine on QEMU )


Now the docker motionEye is running on the device motinEye. The next step is to get the public url
and access the cctv system for configuration.
See the PUBLIC DEVICE URL button in first frame of the above Figure 8. You will have to toggle
the switch to on position to enable to access the device remotely. Then seen the second frame of
above figure 8 . When you click on the public device url , you will get the login panel of
motionEye.
The default root Username is dmin
Password is blank
After login , change the password
Then select the usb camera for redirection in the Virtual Machine Manager and reboot the virtual
machine to register the usb camera
For further details on configuring motionEye please refer the post at the following link.
How to install motionEye cctv software on Ubuntu 20.10 ( groovy )
Using the PUBLIC DEVICE URL you can access the device on a smart phone .
Since the PUBLIC DEVISE URL does not change , It is convenient to use
For further clarifications please see the following video
Security - motionEye CCTV system on balenaCloud
The motionEye CCTV setup is protected with Login credentials.
You will have to use strong Passwords in the motionEye setup

There are two setups of Login credentials namely Admin and Surveillance .
If you use Admin Username & Password , you can enter in to motionEye CCTV system and make
changes in configurations.
f you use Surveillance Username & Password , you can view camera streaming & saved photos an
videos , but can't make changes in configuration .
When the PUBLIC DEVICE URL is loaded on a web browser , you will get the login screen. You
will not be able to enter in to motinEye CCTV system if you don't know the Username and
Password .
The balenaCloud is using an excellent security setup to protect your devices. Please see the link
below for more details
https://www.balena.io/docs/learn/welcome/security/
Note:-
For further details please see this video https://youtu.be/2_EllBKHIjo

You might also like