Skip to content

Instantly share code, notes, and snippets.

@scrapix
Last active April 3, 2024 20:55
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scrapix/2f9ad27459c3646732f510f50ead3410 to your computer and use it in GitHub Desktop.
Save scrapix/2f9ad27459c3646732f510f50ead3410 to your computer and use it in GitHub Desktop.
Synology DSM 7.2 - Adding USB Devices / Dongles (SkyConnect / Z-Wave)

Adding SkyConnect Dongle according to Blog Post or better Youtube

image

Summary

Synology has disabled USB drivers. Additionally one important driver is not available on Synology DSM 7+. Thus we need to enable some USB drivers plus download one driver and enable this on the system. For future DSM updates we need to add a Scheduled Task, so that the drivers will be loaded.

This Tutorial works fine for DS920+, in case your NAS has another process, change "geminilake" within the commands to your processors architecture name according to https://kb.synology.com/en-global/DSM/tutorial/What_kind_of_CPU_does_my_NAS_have!

Download usb drivers from Github

git clone https://github.com/robertklep/dsm7-usb-serial-drivers.git ~/DSM-USB-DRIVER/

Review available USB Devices

ls /dev/ttyU*

Copy necessary driver to lib/modules

sudo cp ~/DSM-USB-DRIVER/dsm7-usb-serial-drivers/modules/geminilake/dsm-7.2/cp210x.ko /lib/modules

Adjust access rights of new ko module

sudo chmod 644 /lib/modules/cp210x.ko

Initiate usb-serial-drivers.sh

sudo chmod +x ~/DSM-USB-DRIVER/dsm7-usb-serial-drivers/usb-serial-drivers.sh
sudo sh ~/DSM-USB-DRIVER/dsm7-usb-serial-drivers/usb-serial-drivers.sh start

sudo sh /usr/local/etc/rc.d/usb-serial-drivers.sh start

Check all devices connected to NAS

ls /dev/ttyU*

Add following startup script to NAS through Task Manager

cp ~/DSM-USB-DRIVER/dsm7-usb-serial-drivers/modules/geminilake/dsm-7.2/cp210x.ko /lib/modules
bash ~/DSM-USB-DRIVER/dsm7-usb-serial-drivers/usb-serial-drivers.sh start
@Dekadinious
Copy link

For anyone having issues here, remove "/dsm7-usb-serial-drivers" from the commands

@ggenot
Copy link

ggenot commented Oct 31, 2023

I will add that if you use HA in Container manager you will need to run the container with "High privilege" (in Capabilities) section of container configuration.

BEWARE it is considered as UNSAFE as the container can have access to Syno Filesystem.

Another solution is to launch the container via docker compose and pass the device (customize to your needs):

version: "2"
services:
  homeassistant:
    image: homeassistant/home-assistant:stable
    container_name: homeassistant
    network_mode: host
    restart: always
    volumes:
      - /volume1/docker/homeassistant/config:/config
    devices:
      - /dev/ttyUSB0
    environment:
      - TZ=Europe/Madrid

You should be able to use docker-compose file in Container Manager via "Project" (untested)

@jfredsilva
Copy link

The script on the Task Manager isn't working, the output is:
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required

At every NAS restart I have to run all commands again

@scrapix
Copy link
Author

scrapix commented Jan 10, 2024

The script on the Task Manager isn't working, the output is: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper sudo: a password is required

At every NAS restart I have to run all commands again

Did you select root as task executer?

@jfredsilva
Copy link

Did you select root as task executer?

Thanks, it works now.
I switched to root and I had to change the script, since the files are located inside a user folder.
It had to be something like:

sudo cp /var/services/homes/USER/Downloads/DSM-USB-DRIVER/modules/geminilake/dsm-7.2/cp210x.ko /lib/modules
bash /var/services/homes/USER/Downloads/DSM-USB-DRIVER/usb-serial-drivers.sh start

@rossco555
Copy link

When I run sudo sh /usr/local/etc/rc.d/usb-serial-drivers.sh start, I get:

sh: /usr/local/etc/rc.d/usb-serial-drivers.sh: No such file or directory

@jaroshimo
Copy link

When I run sudo sh /usr/local/etc/rc.d/usb-serial-drivers.sh start, I get:

sh: /usr/local/etc/rc.d/usb-serial-drivers.sh: No such file or directory

What is the output of:

sudo ls -la /usr/local/etc/rc.d/ | grep "usb"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment