Get serial devices working on Synology DS216+II DiskStation

serial
synology
Tags: #<Tag:0x00007f014282ecf0> #<Tag:0x00007f014282eb88>

(Jaco van der Linden) #1

Hi all,
Since a few months I’ve bought myself a DS216+II with DSM6.1 installed. I installed the OH2-package on it. I’ve got a few bindings working already but I can’t get any binding getting to work which use a USB port. Too much unanswered question… this really drives me nuts.

For example; I connected a ‘Plugwise stick’ to one of the USB-ports, I see it appears on port 1-2 when I use the ‘lsusb-command’. Which path/port do I have to configure in the bindings?

Most of the examples I’ve Googled, use paths like /dev/ttyACM0, but I can’t find the ttyACM0 on the /dev/-location. I did find USB in the /sys/bus/usb/devices/-location. Which location do I have to use?

Do I have to do something with ‘groups’ or something?

I hope some of you has experience adding serial devices to a DS216+II and can help me on the right track.

Thanks already for your help.

Regards.


Meteostick synology
(Wouter Born) #2

@Jaco What will probably help is to also load the usbserial.ko and ftdi_sio.ko kernel modules. These modules will most likely already be on your NAS in a directory named /lib/modules.

To load these modules issue the following commands:

sudo insmod /lib/modules/usbserial.ko
sudo insmod /lib/modules/ftdi_sio.ko

Now when you insert the Plugwise Stick into your NAS you can check with the dmesg command what path is assigned to it. I just tried this with my Stick on a 415+ NAS with DSM 6.1 and this was the output of dmesg:

[302774.647724] ftdi_sio 1-1.3:1.0: FTDI USB Serial Device converter detected
[302774.655477] usb 1-1.3: Detected FT232RL
[302774.659880] usb 1-1.3: Number of endpoints 2
[302774.664764] usb 1-1.3: Endpoint 1 MaxPacketSize 64
[302774.670235] usb 1-1.3: Endpoint 2 MaxPacketSize 64
[302774.675704] usb 1-1.3: Setting MaxPacketSize 64
[302774.681429] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB0

Without loading the modules my NAS also would not detect the Stick. I haven’t further tested it with openHAB but I guess it should work! Most likely the /dev/ttyUSB0 file also needs to be assigned the right permissions and something needs to be done to also load the modules after the NAS is restarted.

Additional serial driver modules

It seems there was a separate package for adding Serial Driver support to Synology NAS-es by a Domoticz user at http://www.jadahl.com . However it is no longer maintained or available. The site still has complete packages with Domoticz installations that do contain additional Serial Drivers and scripts to load them.

  • To get these additional drivers and startup scripts you can download the appropriate Domoticz SPK from http://www.jadahl.com/domoticz_stable_6.1/ .
  • When you rename the .spk to .tar.gz and extract it you will also have a package.tgz file. The package.tgz file contains additional kernel modules in the /modules directory.
  • The SPK also has a /scripts directory with a file named start-stop-status. The method start_daemon shows how these additional modules are loaded. Normally it is just with insmod, on some older DSM versions the script also executes some additional logic to dynamically create the /dev/ttyXXX files.

(Jaco van der Linden) #3

@wborn I won’t be too happy yet, but it seems that at least one of my questions is answered :smile:

When I use the dmesg-command, I can see the stick is connected to ttyUSB0

I will try to get the device working in openHAB… I will keep you informed.

Many thanks already!

Regards Jaco


(Jaco van der Linden) #4

Thanks again @wborn, your answer solved my problem.

For people who’re having the same problem in the future;

Edit or create the file startup.sh via:

sudo vi /usr/local/etc/rc.d/startup.sh

Put the next text into the file:

sudo insmod /lib/modules/usbserial.ko
sudo insmod /lib/modules/ftdi_sio.ko
sudo chmod 777 /lib/modules/usbserial.ko
sudo chmod 777 /lib/modules/ftdi_sio.ko

Change rights of startup.sh:

chmod 700 /usr/local/etc/rc.d/startup.sh

The next time your NAS reboots, modules will be starten automatically.


(Wouter Born) #5

Thanks for following up on this @Jaco! Now I can also start using my NAS as a hot spare for running openHAB. :slight_smile:


(Antoine Dorcier) #6

Hello

I have also a DS216Play. When I plug my USB-to-Serial adapter based on PL2303 chip, I can see it in the info center of DSM.
If I use the SSH to search the port of it, I see nothing. No ttyUSB0 or ttyACM0.
I didn’t find on google what is going on.

|__usb1 1d6b:0002:0310 09 2.00 480MBit/s 0mA 1IF (ehci_hcd ehci-platform.0) hub
|__usb2 1d6b:0001:0310 09 1.10 12MBit/s 0mA 1IF (Linux 3.10.105 ohci_hcd Generic Platform OHCI Controller ohci-platform.0) hub
|__2-1 067b:2303:0300 00 2.00 12MBit/s 100mA 1IF (Prolific Technology Inc. USB-Serial Controller c6a3cfa3ccbecaa4cb88a8c4a5ccbedb)
|__usb3 1d6b:0002:0310 09 2.00 480MBit/s 0mA 1IF (Linux 3.10.105 xhci-hcd xHCI Host Controller xhci-hcd.0.auto) hub
|__usb4 1d6b:0003:0310 09 3.00 5000MBit/s 0mA 1IF (Linux 3.10.105 xhci-hcd xHCI Host Controller xhci-hcd.0.auto) hub

Any suggestions ?

Tx

Antoine