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.
@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:
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.
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.
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.
Thanks for the guidance on this one!
I can confirm this method works also on old Synology NAS as well - I have DS1010+ that cannot upgrade beyond DSM5.
To make this work on boot for my NAS i had to add the commands to /etc/rc.local --> the one in /usr/local/etc/rc.d/ did not execute on boot.
I used FTDI based USB to RS485 and had to load both usbserial and only then ftdi.
Hi, thanks for this artikel.
I executed also
insmod /lib/modules/cdc-acm.ko
now I can use the cdc-standard usb-serial converters. My LCD, which supports this protocol works now on the Synology NAS!
You need to check “Execute container using high privilege” in the tab General settings in the UI of Docker?
and from the Documentation:
USB sticks
If you want use an USB stick (for example for Z-Wave network), then it will be not available for the dockerized system by default. In Docker openHAB is running in name of openhab, a restricted user. The stick will work if you run the following command right after docker image is started.