Serial binding - Could not open serial port

Just upgraded from snapshot to beta/RC. [Edit: the same in Release]
The port in question still present in /etc/default/openhab2
openhab is a member of dialout group
port is present:
root@zbox:~# ll /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Jan 19 22:15 /dev/ttyUSB0

and here is the error:

[ERROR] [el.item.internal.GenericItemProvider] - Binding configuration of type ‘serial’ of item ‘RFLinkRaw’ could not be parsed correctly.
org.eclipse.smarthome.model.item.BindingConfigParseException: Could not open serial port /dev/ttyUSB0: Serial port ‘/dev/ttyUSB0’ could not be found. Available ports are:
/dev/ttyACM0

The same USB port still works with modbus binding, so there is no problem with the port itself or with the access rights. When USB0 is occupied by modbus, serial binding is configured with USB1 and the same kind of error is generated.

So it may be a problem with your serial binding configuration string. That is the first part of the error. Look at the serial binding docs and compare to what you have and look for typos.

I had to do it like below to get my ttyUSB0 to work,
#cd /opt/openhab2/runtime/bin
Edit setenv and insert, -Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0 as the very last line under the JAVA_OPTS="${JAVA_OPTS} block, !! be aware of "

as simple as it could be:

String RFLinkRaw “RFLink raw data [%s]” { serial="/dev/ttyUSB1@57600" }

Removing speed does not help.
I believe it fits to the requirements in the doc.

As far as I know the right way is to edit /etc/default/openhab2
Anyway, I’m checking what was passed to java and and see the right port list:

root@zbox:~# ps ax | grep ttyUSB
13078 ? Sl 1:32 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/openhab2 -Dfelix.cm.dir=/var/lib/openhab2/config -Dorg.osgi.service.http.port=8080 -Dorg.osgi.service.http.port.secure=8443 -Djava.awt.headless=true -XX:+UseG1GC -Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyACM0:/dev/ttyUSB1 -Djava.endorsed.dirs=/usr/lib/jvm/java-8-oracle/jre/jre/lib/endorsed:/usr/lib/jvm/java-8-oracle/jre/lib/endorsed:/usr/share/openhab2/runtime/lib/endorsed -Djava.ext.dirs=/usr/lib/jvm/java-8-oracle/jre/jre/lib/ext:/usr/lib/jvm/java-8-oracle/jre/lib/ext:/usr/share/openhab2/runtime/lib/ext -Dkaraf.instances=/usr/share/openhab2/runtime/instances -Dkaraf.home=/usr/share/openhab2/runtime -Dkaraf.base=/var/lib/openhab2 -Dkaraf.data=/var/lib/openhab2 -Dkaraf.etc=/var/lib/openhab2/etc -Dkaraf.restart.jvm.supported=true -Djava.io.tmpdir=/var/lib/openhab2/tmp -Djava.util.logging.config.file=/var/lib/openhab2/etc/java.util.logging.properties -Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true -classpath /usr/share/openhab2/runtime/lib/boot/org.apache.karaf.diagnostic.boot-4.0.8.jar:/usr/share/openhab2/runtime/lib/boot/org.apache.karaf.jaas.boot-4.0.8.jar:/usr/share/openhab2/runtime/lib/boot/org.apache.karaf.main-4.0.8.jar:/usr/share/openhab2/runtime/lib/boot/org.osgi.core-6.0.0.jar org.apache.karaf.main.Main
13282 pts/1 S+ 0:00 grep --color=auto ttyUSB

Thanks, right.
Just found these differences, don’t know If that can make any sense.

-Djava.endorsed.dirs=/usr/lib/jvm/java-8-oracle/jre/jre/lib/endorsed:/usr/lib/jvm/java-8-oracle/jre/lib/endorsed:/usr/share/openhab2/runtime/lib/endorsed

-Djava.endorsed.dirs=/usr/lib/jvm/java-8-openjdk-amd64/jre/jre/lib/endorsed:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/endorsed:/usr/share/openhab2/runtime/lib/endorsed

you seems to be on the different java version
I’m using oracle-java8 as described in the docs

Ooops! Just noticed in the docs as well:

Also make sure to use the 32-bit version of the JVM, even on 64-bit operating systems. Serial connections won’t work with a 64-bit JVM, so bindings like Z-Wave won’t be working with it.

Is this still true? I’m not on ARM, just in case.

java -version says
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2ubuntu0.16.04.2-b14)
OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)

I’m using an enocean USB300 and the enocean-binding like below ,I have no Z-Wave equipment, so I don’t know, maybe you have to swap jvm

185 | Active | 80 | 1.9.0.b5 | openHAB enocean Binding

OH is known to not work well with OpenJDK.

Ok, Thanks. I will then consider to swap.

//Örjan

Den 2017-01-23 kl. 23:14, skrev Rich Koshak:

I’ve came across the discussion regarding nrjavaserial bugs and fixes by @cvanorman - is this somehow related to what I’m facing?

No change with Zulu Java platform :frowning:

Andrew,

Your RFLinkRaw item is set up to use /dev/ttyUSB1, not /dev/ttyUSB0. In your first post you verified permissions and existence of /dev/ttyUSB0. Does /dev/ttyUSB1 exist? If so, what are its permissions?

Scott, they are the same.

$ ll /dev/ttyUSB*
crw-rw---- 1 root dialout 188, 0 Feb 26 20:32 /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 1 Feb 26 20:32 /dev/ttyUSB1

$ ll /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 Feb 26 20:49 /dev/ttyACM0