Raspberry Pi

4 min

Domotz Agent Installation on Raspberry Pi

This section contains a few tips and tricks on how to get started with the Domotz Agent on your Raspberry Pi.

Installing the Domotz Agent

Option A: Installing the Domotz Agent on Raspbian

If you have a brand new Raspberry PI with no OS, here a useful article explaining how to install Raspian.

Once Raspbian is installed you can proceed with the following steps.

Step 1
Make sure your Raspberry Pi is connected to the internet. We recommend using a network cable and connect your Raspberry Pi directly to your router.

Step 2
Download the latest Domotz Agent for Raspberry Pi.

If you use the built-in web browser in Raspbian, go to the Domotz Community to download the latest Domotz Agent. The file should automatically end up in the /usr/home/Downloads

Note: If you have a headless setup (no screen, keyboard or mouse connected), you can login to your Raspberry Pi via SSH using a terminal software such as PuTTY or Tera Term in Windows, or the built in options in OS X or Linux. The default user name is pi and the password is raspberry. Then simply type the following commands to start the download:

cd Downloads

wget <file-path-as-specified-on-the-domotz-portal>

Step 3
Click on Menu, Accessories, Terminal. A command line window with some green and blue text should appear on the screen. In case of headless installation, just login to your Raspberry Pi via a terminal. Go to the download directory (if you’re not already there) by typing cd Downloads and hitting enter.

Type the following command to install the Domotz Agent. Note that in place of you need to type the name of the file you downloaded. As Raspbian is a Linux based OS, you can simply type the first couple of letters of the file name and then hit the tab key on your keyboard and the rest of the text will be automatically filled in for you.

sudo dpkg -i <package name>

Note: To list files in Linux, type ls and hit enter and you’ll see the files in the current directory.

The installer for the Domotz Agent should now be running. The installation will take anything between five and 15 minutes, as the installer is downloading parts of the software and installing it onto your memory card.

Once the installation has finished, the Agent will be automatically started and you’ll see a link that you can either double click to open in a browser, or copy and paste into your browser to continue the setup.

Note: If you want to check that everything is working properly from the command line, you can run
sudo /etc/init.d/domotz status
to get a status message.

Note: If you want to uninstall your Domotz Agent, simply type:
sudo dpkg --purge domotz
and hit enter in the terminal.

Option B: Installing the Domotz Agent from the Snap Store

A more powerful method to install Domotz PRO on your Raspberry is to install it from the Snap store. The Snap package ensures automatic updates, so your agent package stays current without manual intervention.

1. If you don’t have it already, you need to install the Snapcraft store first:

sudo apt-get update
sudo apt-get install snapd

2. Install the Domotz PRO Agent from the Snapcraft store and assign its permissions as follows:

sudo snap install domotzpro-agent-publicstore
sudo snap connect domotzpro-agent-publicstore:firewall-control
sudo snap connect domotzpro-agent-publicstore:network-observe
sudo snap connect domotzpro-agent-publicstore:raw-usb
sudo snap connect domotzpro-agent-publicstore:shutdown
sudo snap connect domotzpro-agent-publicstore:system-observe

3. Load the tun module needed for the VPN on Demand feature:

sudo sh -c 'echo tun >> /etc/modules'
sudo modprobe tun

4. Comment one line in this file /etc/ld.so.preload to disable a module that conflicts with the snap package:

sudo nano /etc/ld.so.preload

Before:

/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so

After:

#/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so

*Just add a # at the beginning of the line.

5. Restart the Domotz Pro agent service:

sudo snap restart domotzpro-agent-publicstore

This preloaded module conflicts with the snap package causing VPN on Demand not to work.

6. Last step is commenting the line 19 of the file /etc/ssh/ssh_config:

sudo nano /etc/ssh/ssh_config

Before:

Include /etc/ssh/ssh_config.d/*.conf

After:

#Include /etc/ssh/ssh_config.d/*.conf

*Just add a # at the beginning of the line.

This setting conflicts with the snap package environment preventing remote sessions.

First time setup

The next step is to configure your Domotz Agent. To do so, make sure you’ve downloaded and installed the Domotz App on your mobile device. Then simply tap on the drawer menu button and tap on “Find New Agents” towards the bottom of the menu. This will automatically detect any new Domotz Agents on your network, as long as your mobile device is connected to the same network as your Domotz Agent. You can then proceed to configure your Domotz Agent following the steps below on your mobile device without having to know the IP address of your Domotz Agent.

Alternatively, you can type in the IP address and port shown in the Domotz App in a web browser on your PC. For example, if the IP address was 192.168.1.39 you type 192.168.1.39:3000 and then hit enter. You should now see the Domotz Agent webpage.

At this point, you’ll be asked to create an account if you don’t already have one. Please follow the on-screen instructions.

Note: If you’re running any other web service on your Raspberry Pi that uses port 3000, the Domotz Agent will automatically use the next available port, i.e. 3001.

Important Note: The setup of the Domotz Agent will fail if the time and date isn’t set correctly on your Raspberry Pi. To fix this, simply update the time and date on your Raspberry Pi and you’ll be able to proceed with the setup.

If you already have a Domotz account, you can login straight away. Otherwise, you can create a domotz account signing up from here (please make sure you specify the right Country):

Domotz Agent Installation on RASPBERRY PI screenshot 1
Domotz Agent Installation on RASPBERRY PI screenshot 2

Once logged in you can finally activate your agent, with the following steps:

  1. Assign a name to the Agent
  2. Specify whether you run the agent at home or office
  3. Press the “Activate your agent” button
Domotz Agent Installation on RASPBERRY PI screenshot 3

Once this has been done, the Domotz Agent will proceed to scan your network for devices. This will take anything from a few minutes up to 15 minutes depending on how many devices you have on your network.

Domotz Agent Installation on RASPBERRY PI screenshot 4

Note:
By pressing “Done” you will enter the local Domotz Agent Web UI.

This is not the main Domotz app, that is accessible from mobile apps and our website. The local Agent Web UI is only meant to provide a small subset of the Domotz features (Agent info, Network Info, Route Analysis, Speed Test).

Share via Social Networks

You might also like…

Read more top posts in this category

Want more tips on Network Monitoring?

Ready to get started with Domotz?

  • Powerful
  • Automated
  • Simple
  • Affordable
Start Your Free Trial Contact Sales