SkyConnect with Home Assistant Docker in Synology (usb drivers)

Everyone with a Synology knows that Synology does not give support for the USB drivers.
Some preinstalled drivers can be loaded with:

/sbin/modprobe usbserial
/sbin/modprobe ftdi_sio
/sbin/modprobe cdc-acm

So this way we can plug the ConbeeII in a Synology and it will be recognized as /dev/ttyACM0.

But with SkyConnect there are no drivers preinstalled to be able to use it with Synology and then pass it to Home Assistant Docker. SkyConnect needs the cp210x driver.

What I did is clone the repo https://github.com/robertklep/dsm7-usb-serial-drivers in /volume1/homes/admin/ and configure two commands in “Task Scheduler” from Synology.

$ git clone https://github.com/robertklep/dsm7-usb-serial-drivers.git /volume1/homes/admin/usb-drivers

Screenshot 2022-12-17 at 11.17.56

The commands configured are:

cp /volume1/homes/admin/usb-drivers/modules/geminilake/dsm-7.1/* /lib/modules/
bash /volume1/homes/admin/usb-drivers/usb-serial-drivers.sh start

My Synology is a DS720+ with DSM7.1 and Gemini Lake processor.
Change the first line and find your processor model and your DSM version.

Now when you connect the SkyConnect it will be recognized as /dev/ttyUSB0 and you can pass the device to Home Assistant Docker to be automatically recognized.

I hope this can help someone else looking for answers.

EDIT:
This is the docker-compose.yaml I use to start the Home Assistant container.
You must use a docker-compose, or run the docker command with all the options, in order to make the /dev/ttyUSB0 device be available for Home Assistant inside the container.
Please bear in mind that this is my configuration and you should change some things like the volumes and the timezone.

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
10 Likes

Thanks for posting your fix.

Can you help me with cloning the repo to my synology 220+, once I entered you command in the terminal , the response I got was -ash: git: command not found.

I logged me into the terminal with ssh username@hostname and then Sudo -i

I think you need the Git extension for Synology to run that command, its not availible by default or in the official Synology Package Center, but you need to install SynoCommunity and then install Get extension from there.

SynoCommunity

3 Likes

Finally got mine aswell and thought i would test it out, plugged in device into the NAS and it detected a “CP210x UART Bridge - Silicon Labs” inside the Synology Information Center. However, it did not detect anything in Home Assistant. Tried adding the ZHA Integration and selected "EZSP = Silicon Labs " but it dousent show up as a selectable device, all I get is the ability to manually enter a path which means it dousent get detected somehow.

Running latest 2022.12.8 and i have tried both USB ports with same result so far.

Anyone had this or got an idea?

image

1 Like

Its the same as I got stuck. You need to pass the device to Home Assistant Docker. Anyone who can give a hint here on how to do that? I can se the device /dev/ttyUSB0 but how to pass it to docker?

You need to add it via docker by editing docker or by recreating it with addion of following line:
--device /dev/ttyUSB1:/dev/ttyUSB1 (or whatever your port is). That will map your Synology internal port with port inside docker.

Is this given you are using docker compose?

I add these lines into docker-compose file and it works:

    volumes:
      - "/dev/ttyUSB0:/dev/ttyUSB0"
    devices:
      - "/dev/ttyUSB0:/dev/ttyUSB0"

But before this I also give permission to RW to /dev/ttyUSB0:

chmod a+rw /dev/ttyUSB0
1 Like

I dont have a docker compose file.
Maybe another way can be found here: Docker - a way to give access to a host USB or serial device? - Stack Overflow

I will check when i get time, or anyone else who find an alternative way in the link please inform.

sudo docker run -id --name=“home-assistant” --restart on-failure -p 8123:8123 -e “TZ=Europe/Brussels” --net=host -v /volume1/docker/home-assistant:/config --device /dev/ttyUSB0 -v /usr/syno/etc/certificate/system/default:/certificate homeassistant/home-assistant

this is what i put in the terminal and it installed the docker container, instantly recognized my skyconnect.

1 Like

Just out of curiosity… for what reasons do you need to link the certificate into Home Assistant…? That has nothing to do with the SkyConnect, right?

1 Like

It is for SSL access to Home Assistant it has nothing with SkyConnect but you should put all parameters for docker on start up command.

1 Like

I saw it on a youtube video :slight_smile:

I can’t get this working either. This is my docker compose:

version: "3.8"
services:
  homeassistant:
    image: linuxserver/homeassistant:latest
    container_name: homeassistant
    restart: unless-stopped
    network_mode: host
    environment:
      - TZ=America/New_York
    volumes:
      - ./config:/config
    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0

My Synology does detect the USB as “CP210x UART Bridge - Silicon Labs” on /dev/ttyUSB0. But it does not show up in Home Assistant on Docker.

FYI I’m also using HA in a docker on a Synology NAS and at first I thought SkyConnect wasn’t working after following the above instructions.

While “SkyConnect” does not appear when clicking Add integration, if I instead add the Zigbee Home Automation (ZHA) then the SkyConnect shows up as a Zigbee controller and setting it up was smooth. :slight_smile:

I would assume we have to wait for 2023.3 to use SkyConnect as a thread border router.

thanks so much for this. I coudln’t get it to work with your method but it sent me in the right direction. but it would have been me doing something wrong.

for others who struggle I followed this video carefully and it worked for me.

The reason we copy per OP steps is at load the file seems to be deleted on synology lib/modules. so it has to be re copied? anyway that is what i found.

SKyconnect is all setup on my system with dsm7.1 and running against zha (I used to use z2m)stable for 12 hours now. watching closely (i h

2 Likes

Don’t forget to use the extension cable. That was the issue for me. Weird but true

I am having trouble at the first step.

“/sbin/modprobe usbserial” and “/sbin/modprobe ftdi_sio” work fine, but when I copy “/sbin/modprobe cdc-acm” I am getting this error: “modprobe: FATAL: Module cdc-acm not found.”

Also when I type in “ls /dev” I get a list with just this:

I am missing “port”, “ppp” and “ptmx” … Any idea why? Greatful for any help!

Update 1: Getting this error message, when I try to run the task: "Current status: 1 (Interrupted)
Standard output/error:
cp: -r not specified; omitting directory ‘/volume1/homes/admin/usbdrivers/modules/@eaDir
The commands are: "cp /volume1/homes/admin/usbdrivers/modules/* /lib/modules/

bash /volume1/homes/admin/usbdrivers/usb-serial-drivers.sh start"

It’s now sorted?

1 Like

@BeardedConti how do you expose the USB drive to homeassistant through the docker container UI ?