Because I did not find a fully working tutorial myself. I am writing this tutorial how I succeeded.
SSH in to openHABian.
Unplug all usb devices.
And run the command.
sudo lsusb -v | grep 'idVendor\|idProduct\|iProduct\|iSerial'
[17:27:23] openhabian@openhabian-server:~$ sudo lsusb -v | grep 'idVendor\|idProduct\|iProduct\|iSerial'
[sudo] password for openhabian:
idVendor 0x1d6b Linux Foundation
idProduct 0x0003 3.0 root hub
iProduct 2 xHCI Host Controller
iSerial 1 0000:00:15.0
idVendor 0x0403 Future Technology Devices International, Ltd
idProduct 0x6001 FT232 USB-Serial (UART) IC
iProduct 2 RFXtrx433
iSerial 3 A11HEJ4V
idVendor 0x0403 Future Technology Devices International, Ltd
idProduct 0x6001 FT232 USB-Serial (UART) IC
iProduct 2 FT232R USB UART
iSerial 3 AK061I02
idVendor 0x0bda Realtek Semiconductor Corp.
idProduct 0x0129 RTS5129 Card Reader Controller
iProduct 2 USB2.0-CRW
iSerial 3 20100201396000000
idVendor 0x1d6b Linux Foundation
idProduct 0x0002 2.0 root hub
iProduct 2 xHCI Host Controller
iSerial 1 0000:00:15.0
Plug in 1 usb devices and run the command again
sudo lsusb -v | grep 'idVendor\|idProduct\|iProduct\|iSerial'
See which device was added and take a note of idVendor,idProduct,iSerial
With idVendor and idProduct only take a note of the numbers after the x.
Do so with all your usb devices.
Create a UDEV Rule with the command.
sudo nano /etc/udev/rules.d/99-usb-serial.rules
Change the idVendor,idProduct,iSerial to your configuration and put a unique symlink name.
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="AK061I02", SYMLINK+="ttyUSB-RS485"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A11HEJ4V", SYMLINK+="ttyUSB-RFXcom"
Run the command to add EXTRA_JAVA_OPTS
sudo nano /etc/default/openhab2
With openHAB3 use
sudo nano /etc/default/openhab
Add te next rule and change the config with your unique symlink name.
EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB-RS485:/dev/ttyUSB-RFXcom"
## JAVA OPTIONS
## Additional options for the JAVA_OPTS environment variable.
## These will be appended to the execution of the openHAB Java runtime in front of all other options.
##
## A couple of independent examples:
## EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0"
## EXTRA_JAVA_OPTS="-Djna.library.path=/lib/arm-linux-gnueabihf/ -Duser.timezone=Europe/Berlin -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0"
EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB-RS485:/dev/ttyUSB-RFXcom"
Add openhab user to the right groups with the following commands
sudo adduser openhab dialout
sudo adduser openhab tty
Reboot and look if the symlinks are created with te following command.
ls /dev/tty*
In the output your unique symlink name should be visible.
[18:54:59] openhabian@openhabian-server:~$ ls /dev/tty*
/dev/tty /dev/tty17 /dev/tty26 /dev/tty35 /dev/tty44 /dev/tty53 /dev/tty62 /dev/ttyS12 /dev/ttyS21 /dev/ttyS30 /dev/ttyUSB-RFXcom
/dev/tty0 /dev/tty18 /dev/tty27 /dev/tty36 /dev/tty45 /dev/tty54 /dev/tty63 /dev/ttyS13 /dev/ttyS22 /dev/ttyS31 /dev/ttyUSB-RS485
/dev/tty1 /dev/tty19 /dev/tty28 /dev/tty37 /dev/tty46 /dev/tty55 /dev/tty7 /dev/ttyS14 /dev/ttyS23 /dev/ttyS4
/dev/tty10 /dev/tty2 /dev/tty29 /dev/tty38 /dev/tty47 /dev/tty56 /dev/tty8 /dev/ttyS15 /dev/ttyS24 /dev/ttyS5
/dev/tty11 /dev/tty20 /dev/tty3 /dev/tty39 /dev/tty48 /dev/tty57 /dev/tty9 /dev/ttyS16 /dev/ttyS25 /dev/ttyS6
/dev/tty12 /dev/tty21 /dev/tty30 /dev/tty4 /dev/tty49 /dev/tty58 /dev/ttyprintk /dev/ttyS17 /dev/ttyS26 /dev/ttyS7
/dev/tty13 /dev/tty22 /dev/tty31 /dev/tty40 /dev/tty5 /dev/tty59 /dev/ttyS0 /dev/ttyS18 /dev/ttyS27 /dev/ttyS8
/dev/tty14 /dev/tty23 /dev/tty32 /dev/tty41 /dev/tty50 /dev/tty6 /dev/ttyS1 /dev/ttyS19 /dev/ttyS28 /dev/ttyS9
/dev/tty15 /dev/tty24 /dev/tty33 /dev/tty42 /dev/tty51 /dev/tty60 /dev/ttyS10 /dev/ttyS2 /dev/ttyS29 /dev/ttyUSB0
/dev/tty16 /dev/tty25 /dev/tty34 /dev/tty43 /dev/tty52 /dev/tty61 /dev/ttyS11 /dev/ttyS20 /dev/ttyS3 /dev/ttyUSB1
[18:55:03] openhabian@openhabian-server:~$
Now change your usb devices existing configuration to your new unique symlink name and reboot.