ZigBeeForDomoticZ plugin Wiki

Tutorial - Installation with Docker on Synology (DSM 7.x)

This tutorial explains how to install Domoticz with the embedded Docker application on a Synology NAS.

These are the first steps before Installing the plugin on a Synology NAS (Docker)

Foreword

You first need the docker application installed (Application center)

If it’s a migration from another system, first do a backup.

DomoticZ installation

Launch Docker, you should have the Overview. Select Registry : Overview

Look for DomoticZ in the search bar (top right): Registry

Double click on the official image (domoticz/domoticz) and choose for which version you need. Stable or beta allows to be on the last corresponding version. Stable or Beta

Next, wait for the download and go in Image: Image

Double click on the DomoticZ image. A new window open with the necessary parameters for the container creation. First step, network interface, select the default one: Creation

Choose a name and check “Execute container using high privilege” and “Enable auto-restart”, then validate with “Next”. Parameters

You need to choose port numbers and modify the ‘Auto’ by the wanted one, the auto option will generate new port numbers at restart and you’ll need to open docker to take notice. The SSL port 443 is currently used by DSM, you need to choose another one (or let Auto if you don’t plan to use it): Ports

This part is quite important as it allows to keep outside docker the userdatas (database, plugins, scripts…) and gain access with DSM interface (file station). You need to select “Add Folder”: Add Folder

Select docker then “Create folder” and name it domoticz. Add folder docker/domoticz

Once the folder has been created, you must indicate the access path: /opt/domoticz/userdata /opt/domoticz/userdata

And that’s it, the configuration is done, apply and do next. The last screen offers a summary before the container is created: Resume

Go to the Container tab, our new container is created: Conteneur

Double click on it to access the details: Details

DomoticZ is now operational and you can access it. A plugins folder is created in the directory docker/domoticz.

You can continue the installation of the Plugin by following: Installing the plugin on a Synology NAS (Docker)

USB drivers installation

Following the coordinator model, the USB drivers differ:

Automatic loading at startup

This solution uses the task scheduler (Conftrol pannel) by creating a Triggered Task. This task will copy the needed drivers in /lib/modules and load them in the kernel. I advise the copy as the drivers are removed on DSM upgrade.

Planificateur

I choose to let the drivers in my home, replace the directory by yours:

cd /var/services/homes/xxx
cp *.ko /lib/modules/
insmod /lib/modules/usbserial.ko > /dev/null 2>&1
insmod /lib/modules/cp210x.ko > /dev/null 2>&1
insmod /lib/modules/ftdi_sio.ko > /dev/null 2>&1
insmod /lib/modules/cdc-acm.ko > /dev/null 2>&1
insmod /lib/modules/ch341.ko > /dev/null 2>&1

Tache

All that remains is to restart DSM.

Manual load (Advanced user)

To load the drivers, connect to the NAS with ssh and run the following commands, choose only the needed drivers after copy them:

cp *.ko /lib/modules/

sudo insmod /lib/modules/usbserial.ko

sudo insmod /lib/modules/cp210x.ko
OR
sudo insmod /lib/modules/ftdi_sio.ko
OR/AND
sudo insmod /lib/modules/cdc-acm.ko
OR
sudo insmod /lib/modules/ch341.ko

If you want to load them automatically, you can use the Task scheduler (see above) or use a script run at startup:

Add a file start-usb-drivers.sh in the folder /usr/local/etc/rc.d/start-usb-drivers.sh

#!/bin/sh
case $1 in
  start)
    insmod /lib/modules/usbserial.ko > /dev/null 2>&1
    insmod /lib/modules/cp210x.ko > /dev/null 2>&1
    insmod /lib/modules/ftdi_sio.ko > /dev/null 2>&1
    insmod /lib/modules/cdc-acm.ko > /dev/null 2>&1
    insmod /lib/modules/ch341.ko > /dev/null 2>&1
    ;;
  stop)
    exit 0
    ;;
  *)
    exit 1
    ;;
esac

Make it runnable:

chmod +x /usr/local/etc/rc.d/start-usb-drivers.sh