[SOLVED] Zwave and JEELink Issue since Milestone 3.2.0.M4 - USB Port not found?

Since I upgraded to Milestone 3.2.0.M4 today neither Zwave nor the JEELink Binding works anymore.

Checking the USB-Ports the command line shows:

/dev/ttyACM1 - dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2425646
/dev/ttyUSB0 - SHK_JeeLink_LaCrosse
/dev/ttyACM0 - 0658_0200

(the last one being the ZWave)

As the JEELink Binding that also uses a USB Port directly shows it is missing the USB-Port I checked the startup parameters in etc/default/openhab and noticed that they had gone. I added them via

EXTRA_JAVA_OPTS="-Xms192m -Xmx500m -Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0"

I restart openhab and they do appear in the startup

/usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.userdata=/var/lib/openhab -Dopenhab.logdir=/var/log/openhab -Dfelix.cm.dir=/var/lib/openhab/config -Djava.library.path=/var/lib/openhab/tmp/lib -Djetty.host= -Djetty.http.compliance=RFC2616 -Dnashorn.args=--no-deprecation-warning -Dorg.apache.cxf.osgi.http.transport.disable=true -Dorg.ops4j.pax.web.listening.addresses= -Dorg.osgi.service.http.port=8080 -Dorg.osgi.service.http.port.secure=8443 -Djava.awt.headless=true -Xms192m -Xmx500m 
--add-reads=java.xml=java.logging --add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED --patch-module java.base=/usr/share/openhab/runtime/lib/endorsed/org.apache.karaf.specs.locator-4.3.3.jar --patch-module java.xml=/usr/share/openhab/runtime/lib/endorsed/org.apache.karaf.specs.java.xml-4.3.3.jar --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.naming/javax.naming.spi=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.file=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.ftp=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED --add-exports=java.base/sun.net.www.content.text=ALL-UNNAMED --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED --add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED --add-exports=java.rmi/sun.rmi.registry=ALL-UNNAMED --add-exports=java.security.sasl/com.sun.security.sasl=ALL-UNNAMED -Dkaraf.instances=/var/lib/openhab/tmp/instances -Dkaraf.home=/usr/share/openhab/runtime -Dkaraf.base=/var/lib/openhab -Dkaraf.data=/var/lib/openhab -Dkaraf.etc=/var/lib/openhab/etc -Dkaraf.log=/var/log/openhab -Dkaraf.restart.jvm.supported=true -Djava.io.tmpdir=/var/lib/openhab/tmp -Djava.util.logging.config.file=/var/lib/openhab/etc/java.util.logging.properties -Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true -classpath /usr/share/openhab/runtime/lib/boot/org.apache.karaf.diagnostic.boot-4.3.3.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.jaas.boot-4.3.3.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.main-4.3.3.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.specs.activator-4.3.3.jar:/usr/share/openhab/runtime/lib/boot/osgi.core-7.0.0.jar:/usr/share/openhab/runtime/lib/jdk9plus/istack-commons-runtime-3.0.10.jar:/usr/share/openhab/runtime/lib/jdk9plus/jakarta.xml.bind-api-2.3.3.jar:/usr/share/openhab/runtime/lib/jdk9plus/javax.activation-1.2.0.jar:/usr/share/openhab/runtime/lib/jdk9plus/javax.annotation-api-1.3.1.jar:/usr/share/openhab/runtime/lib/jdk9plus/jaxb-runtime-2.3.3.jar:/usr/share/openhab/runtime/lib/jdk9plus/txw2-2.3.3.jar org.apache.karaf.main.Main

First of the question is why it went away?

When I try to configure a new JEELink-USB Port only the “ttyAMA0” is shown:

However, even adding those will still result into the same issue



ZWave: 326 │ Resolved │ 80 │ 3.2.0.M4 │ openHAB Add-ons :: Bundles :: ZWave Binding

Here are the zwave settings which I haven’t changed and worked before

UID: zwave:serial_zstick:7175b6a970
label: Z-Wave Serial Controller
thingTypeUID: zwave:serial_zstick
  controller_softreset: false
  security_networkkey: FF.....FF (masked)#
  security_inclusionmode: 0
  controller_sisnode: 1
  controller_sync: false
  controller_master: true
  inclusion_mode: 2
  port: /dev/ttyACM0
  controller_wakeupperiod: 3600
  controller_exclude: false
  heal_time: 2
  controller_inclusiontimeout: 30
  controller_hardreset: false

I have attached the debug log of the ZWave Initialization but I my guess there is a USB-Port Problem for both.

So how can I further track down the issue?

zwave initialization debug.txt (76.8 KB)

openhab-transport-serial is installed

openhab> feature:list | grep serial
openhab-core-io-transport-serial-javacomm         │ 3.2.0.M4         │          │ Uninstalled │ distro-3.2.0.M4          │
openhab-transport-serial                          │ 3.2.0.M4         │          │ Started     │ distro-3.2.0.M4          │ Serial Transport
openhab.tp-serial-javacomm                        │ 3.2.0.M4         │          │ Uninstalled │ distro-3.2.0.M4          │
openhab.tp-serial-rxtx                            │ 3.2.0.M4         │          │ Started     │ distro-3.2.0.M4          │
openhab-binding-lgtvserial                        │ 3.2.0.M4         │          │ Uninstalled │ openhab-addons-3.2.0.M4  │ LG TV Serial Binding
openhab-binding-serial                            │ 3.2.0.M4         │ x        │ Started     │ openhab-addons-3.2.0.M4  │ Serial Binding
openhab-binding-serialbutton                      │ 3.2.0.M4         │          │ Uninstalled │ openhab-addons-3.2.0.M4  │ Serial Button Binding

@wborn Since you implemented/changed SerialPortUtil-Class, do you maybe know what could cause this issue that the ports are not found? Or give an idea how I can debug that?

I am in the midst of remote debugging

getPortIdentifiersUsingScan() {
String value = System.getProperty(GNU_IO_RXTX_SERIAL_PORTS);
-> contains /dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0

However when I am in SerialConfigOptionProvider() and the uri=“thing-type:jeelink:lgwUsb” and the context = “serial-port”

it only returns
ParameterOption [value="/dev/ttyAMA0", label="/dev/ttyAMA0"]

Note that the following method does have all different ports available as provided via startup


The problem I see is as follows: The following method has all the defined serial ports

doesn’t return all five. So, what does the ComportIdentifier.getPortIdentifiers() has todo with the content of the variable “value”?

Even in that class there is only one comport:

and I have no clue, why?

/etc/default/openhab is a configuration file. It is part of the debian package in the conffiles file.

This means that during an upgrade you should be asked what to do in case it is detected that you locally modified the distributions configuration file. In that case you will be asked if it should be overwritten with the distributions file or if your file should be kept.
I did not investigate how openhabian-config behaves in case updates are done non interactively.

I took me actually many days and even more hours to find out the root cause of the problem. Even though the solution is simple and I think I have read a hint into that direction once, it seems when I read so at least the location was different there.

So, the problem was that indeed that the ports were locked and unfortunately it took me ages to understand and finally fix that. So in case Openhab cannot access your ports then check the location :/var/lock

-rw-r--r-- 1 root       root    22 Nov 12 20:42 asound.state.lock
-rw-r--r-- 1 openhabian openhab 89 Nov 12 20:42 LCK..serial_by-id_usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2425646-if00
-rw-r--r-- 1 root       root    11 Nov  8 08:59 LCK..ttyACM0
-rw-r--r-- 1 root       root    11 Nov  8 08:59 LCK..ttyUSB0

It seems that for some reason the USB port have been locked under the user root and could not be unlocked anymore by openhab itself.

The way I found out was by chance while I was starting / stopping open via “systemctl” and say the following notice

Nov 14 16:35:34 ourhome karaf[20584]: check_lock_status: device is locked by another application
Nov 14 16:35:34 ourhome karaf[20584]:  FAILED TO OPEN: Permission denied

I wonder if there is any way to make this error more prominent by logging it into openhab.log as it does not appear there and therefore there is no hint what is happening?

After knowing what the issue is I actually found it in daemon.log - if I only had known that before. So whenever you have an issue, you should also log into daemon.log.

1 Like