No such device /dev/ttyUSB0 after migrating to OH3

Hi, I’ve run out of ideas. I have OH 2.5 running using the powermax alarm binding connecting to my alarm over serial port working perfectly…

I’ve made an implace upgrade to OH3 and everything is working but the powemax keeps yielding the “No such device /dev/ttyUSB0” error after upgrade.

I’ve double checked all info related to this problem I’ve found in the forums, but to no avail.

I have de gnu.io.rxtx.SerialPort option properly set (here is my ps output of openhab comand)

openhab  2487223       1  7 23:13 ?        00:01:19 /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=192.168.4.248 
-Djetty.http.compliance=RFC2616 
-Dnashorn.args=--no-deprecation-warning 
-Dorg.apache.cxf.osgi.http.transport.disable=true 
-Dorg.ops4j.pax.web.listening.addresses=192.168.4.248 
-Dorg.osgi.service.http.port=8090 
-Dorg.osgi.service.http.port.secure=8444 
-Djava.awt.headless=true 
-Dfile.encoding=UTF-8 
-XX:+UseG1GC 
**-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0** 
--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.7.jar --patch-module java.xml=/usr/share/openhab/runtime/lib/endorsed/org.apache.karaf.specs.java.xml-4.3.7.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.7.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.jaas.boot-4.3.7.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.main-4.3.7.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.specs.activator-4.3.7.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.annotation-api-1.3.2.jar:/usr/share/openhab/runtime/lib/jdk9plus/jaxb-runtime-2.3.3.jar:/usr/share/openhab/runtime/lib/jdk9plus/org.apache.servicemix.specs.activation-api-1.2.1-1.2.1_3.jar:/usr/share/openhab/runtime/lib/jdk9plus/txw2-2.3.3.jar org.apache.karaf.main.Main

openhab user is in my dialout group and in my tty group
(sorry, command output in spanish but translated means User openhab already member of …)

root@Molinos4:/home/chano# adduser openhab dialout
El usuario `openhab' ya es un miembro de `dialout'.
root@Molinos4:/home/chano# adduser openhab tty
El usuario `openhab' ya es un miembro de `tty'.

I’m running openhab native (no docker) on debian 11

Any idea??

Thx in advance

what is the output of

ls -l /dev/serial/by-id/

Thx for your interest
is

root@Molinos4:/home/chano# ls -l /dev/serial/by-id/
total 0
lrwxrwxrwx 1 root root 13 ene 10 14:30 usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0 -> ../../ttyUSB0
root@Molinos4:/home/chano#

By the way, the Pc where its running also has “native” serial ports and it didn’t work either.

I’ve tried the pyhton pyvisonic module executing it as user openhab (su openhab) and it works. So it seems like is something related to java and serial ports.

I’m going to try some simpler java app to open the port to see if I can get more info.

No further ideas??? I’m stuck with this (and is my alarm system!)

Thx!

What is the output of:

ls -l /dev/ttyUSB0

Hi, thx for your help

this is the output of ls -l /dev/ttyUSB0

crw-rw---- 1 root nut 188, 0 ene 11 17:23 /dev/ttyUSB0

Why group nut ?

If the openhab user is not part of the nut group it cannot access the port. So either add openhab to that group or change the group of the port to one that openhab is part of.

Thank You!!! that was the problem!!

A few month ago I installed a UPS with a USB to serial port connection and also installed Network UPS Tools (nut) to integrate its info in openhab. Later, I installed the USB to Serial connection to my powermax alarm and a few days after I removed the ups. Probably, when I rebooted my system after upgrading to OH3, my USB to Serial adapter changed the device name and the ols ttyUSB0 belongs to the nut group.

Thank you once again SOLVED!!

2 Likes