SYMLINK serial port, not visible for Openhab2

Hi,
I don’t know if this question belongs in the Runtime or bindings section
So correct me if I’m wrong

I know there are already a lot of topics about this but none are clear to me

i’m in the process off installing openhab2 the proper way according to Manual installation

Openhab2 automatically starts when my system boot’s (Ubuntu 16.04)

I made my USB-serial devices persistent with a udev rules

SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="tty100", GROUP="dialout", MODE="0666"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0658", ATTRS{idProduct}=="0200", SYMLINK+="tty150", GROUP="dialout", MODE="0666"

I now have /dev/tty100 and tty150 available

but these are not recognized within openhab2/karaf ( “Status: OFFLINE - COMMUNICATION_ERROR Serial Error: Port /dev/tty150/ does not exist” in paper UI - Z-Wave Serial Controller)

I have read a lot of topics about “export EXTRA_JAVA_OPTS=-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0”
( i.e. https://github.com/openhab/openhab-distro/pull/111/commits/585d62ff4366e258c63f7b3494f9f54291b2ec30 )

If I understand it correctly, this has to make to make my NONE default serial port known in java/karaf!?
I’m not sure where to place this export code/rule in openhab2 (i.e. start.sh). There is so many different information about this subject.

Some work only when openhab2 is started manually, according to what I read.

I hope someone here has experience with this and can point me in the right direction.
Perhaps this has been clearly documented! but I have not found it yet

Thank you in advance,
Michiel

I’ve installed openhab2 from the package-repository. There’s a file called /etc/default/openhab2 in which you can add EXTRA_JAVA_OPTS=""

I don’t have access to my openhab server atm, but I think when doing manual installation you could put it in the setenv file in openhab/runtime/karaf/bin/setenv.

Thanks for your replay Fredrik,
That is an option and works for now :slight_smile: (me Happy)

Kai mentioned in one post that it’s not good idea to change files in the “runtime” folder, because it will be overwritten by an upgrade of openhab2.

Thx for you solution it works

Wat I did , for anybody interested:
I added EXTRA_JAVA_OPTS=-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0” to /opt/openhab2/runtime/bin/setenv
Of course replacing /dev/ttyxxx with my own port

I hope some has a solution outside the “runtime” folder on a manual installation.
So I can update without worrying about losing my settings

1 Like