Serial Bridge Gateway(/dev/ttyUSB0) Error

Hello

I have followed all the procedure to run an openHAB version 2.5(stable runtime) server in ubuntu(manual installation), its working fine in ubuntu 16.04.

I am using xbee binding to communicate with hardware through “/dev/ttyUSB0” port, it’s working fine in ubuntu 16.04.

Note: As suggested by Kai Kruzer I have removed RXTX JAR from classpath its working fine in ubuntu 16.04.

Now I am trying to run same server in ubuntu 18.04 I am getting error like below

java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver
com.digi.xbee.api.exceptions.InvalidInterfaceException: No such port: /dev/ttyUSB0
at com.digi.xbee.api.connection.serial.SerialPortRxTx.open(SerialPortRxTx.java:166)
at com.digi.xbee.api.XBeeDevice.open(XBeeDevice.java:199)
at org.openhab.binding.snavxbee2.handler.SNAVXbee2BridgeHandler.initialize(SNAVXbee2BridgeHandler.java:490)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152)
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: gnu.io.NoSuchPortException…

note: As suggest I have installed "RXTX Libray" using below command

      sudo apt-get install librxtx.java

Then I have added RXTXComm.jar and rxtx-2.2.2.jar to classpath in MANIFEST.MF, still no use.

Also I have copy/paste RXTXComm.jar and rxtx-2.2.2.jar into addons folder then also I am getting the same error.

Note: Also I have tried all versions of "RXTX" jar still getting same error.


Please help me out to resolve this issue.

Thank you

dose openhab user have permission to use port?

does the device /dev/ttyUSB0 exist ?

When I was running a native install of OH in 18.04 and up, serial stick were assigned to dev locations of /dev/ttyACM*.

that’s also the case for 16.04 for me.

@Wolfgang_S thanks for the reply,

Yes, port/dev/ttyUSB0 exists.

Hi denominator, thanks for reply

yes openhab have the permission to use USB port, it’s working fine in ubuntu 16.04

Have you added openHAB to the dialout and tty group?

id -Gn openhab

Hi @denominator thanks for the reply yes it is added to dialout group.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.