Hi @somy,
First of all i think you need RS485 and not RS232 - at least all of us here use RS485 i think. I don’t know if it will work over RS232. See the USB-RS485 controller spiff42 posted at the beginning of the thread. This is the device you need. I also posted another one from Amazon but the one spiff42 gave is better because of the optical isolation. Mine also works fine but carries some extra risk of runaway ground loops - mostly a concern in older buildings.
That being said, how are you with connections? Did you figure out how to wire things? If not let me know i will post a brief description.
Now to your actual question - docker.
You need to pass the entire device to docker - not only the data. On older Linux distros the FDTI driver might not be loaded - this is my case on an old Synology (>10 years). Funny enough the driver is part of the distro but not loaded. If you QNAP is new this should not be an issue.
You can tell if you need extra drivers loaded by checking your dmesg when you plug it in. If you get a new ttyUSBxx then all drivers are in place. Otherwise you need to load them.
If you need to load them insert this in your /etc/rc.local
insmod /lib/modules/usbserial.ko
insmod /lib/modules/ftdi_sio.ko
chmod 777 /lib/modules/usbserial.ko
chmod 777 /lib/modules/ftdi_sio.ko
chmod 777 /dev/ttyUSB0
The order of loading the drivers is important. The permissions are probably too high and some security guru will complain but i can never figure out these things and my NAS is not open to the world so i don’t mind. ttyUSB0 should of course be replaced by whatever dmesg says.
So after installing the device you can start the container and pass the device to openhab, I use this run command:
docker run
–name openhab
–net=host
–tty
-e “EXTRA_JAVA_OPTS=-Dgnu.io.rxtx.SerialPorts=-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyUSB0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA
-v /path/to_local/openhab/conf:/openhab/conf
-v /path/to_local/openhab/userdata:/openhab/userdata
-v /path/to_local/openhab/addons:/openhab/addons
-d
–device=/dev/ttyACM0
–device=/dev/ttyUSB0
–restart=always
openhab/openhab:2.4.0-amd64-debian
The ttyACM0 here is my Zwave stick - nothing to do with the Wavin. The Extra java options i copied from some forum somewhere and i am not sure are really needed. Once it worked (and i don’t think those made it work) i never bothered to investigate further.
Note that the above raising of permissions is needed even if your drivers load by default. The openhab docker container has options to load with certain user name but i never managed to make it work. So now my docker runs with default user (i think that is openhab) but on my NAS this user shows up with id/group 9001:9001. So unless i allow everyone to use the ttyUSB0 openhab will not see it even if you use the run command from above.
There is clearly room for improvement in my set up from permissions point of view. I dont even know how vulnerable things become of you do as I do - just fair warning.
I hope this helps and good luck!
P.S. I did some tinkering with a Synology Surveilance station binding and managed to make it work. I was however doing only minor modifications based on other people’s framework. If you manage to get an open source binding started and can take care of the Java skeleton i can assist with the various feature development. I think forking the MODBUS binding already in Openhab should be a solid base but i doubt i can manage it. A far as i can tell Wavin is a special case of MODBUS.