Usb ports could not be found

Hello all,

I have a problem with serial ports, i have one device already working that is the dsmr bridge for my smartmeter. This device is connected on USB0.
After that i tried installing and running both the RFlink and Mysensors bindings but somehow i cannot get those to work. I did put the extra java opts for these ports but still i get the following error for RFlinkserialconnector
Could not find COM port /dev/ttyUSB1
For the mysensorsserialconnector i get the same error but then on the USB2 port. I also installed nrjavaserial through the console.
I’m running the latest stable version of openhabian.
What am i missing or doing wrong.

It seems unlikely, but do those two new tty files have different permissions from ttyUSB0?

How can i check this?

ls -l

You would be well served to go through one of the many Linux Beginner’s tutorials out there on the web.

Hi,
try lsusb
to found out if your devices are connected

Exampe, this is an enocean USB300,
lBus 001 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC

Regards Basse

If i try dmesg and lsusb i can see that the devices are connected and the portnumber they have been given.

What’s the output of:

ls -l /dev/ttyUSB*

Here’s a site I recently found that has plenty of info regarding linux, several linux OS’s, and other system/network info.
https://www.poftut.com/category/linux/debian/

Hope you find it helpful.

This is some old advice I have found somewhere,

"By default as I recall serial ports on Ubuntu belong to the “dialout” group. You can add yourself to this group by running something like the following:

sudo gpasswd --add jodes dialout

You may need to log out and log back in before this takes effect, but after doing so you should be able to read and write from and to your serial ports including USB to serial converters."

Mine ls -l in /dev is as:
crw-rw---- 1 root dialout 188, 0 mar 7 20:44 ttyUSB0

Then i get the following,
crw-rw---- 1 root dialout 188, 0 Mar 7 19:46 /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 1 Mar 7 19:47 /dev/ttyUSB1
I now have disconnected one device so thats why you only see these two

You said your OH install is running on openhabian. What is the environment variable EXTRA_JAVA_OPTS set to in /etc/default/openhab2?

On my system (also running on openhabian), I have:

EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyACM2:/dev/ttyUSBzigbee:/dev/ttyUSBzwave -Xbootclasspath/a:/etc/openhab2/automation/jython/jython-standalone-2.7.0.jar -Dpython.home=/etc/openhab2/automation/jython -Dpython.path=/etc/openhab2/automation/lib/python"

Because it’s not listed in the available serial ports, I would have the same issue that you are experiencing if I had a USB device needed by a binding at /dev/ttyUSB1.

I wonder if the driver being used for your /dev/ttyUSB? devices could be the problem. You may want to install the usbutitls package to determine what driver(s) are being used.

From my system:

[11:42:01] root@rpi3:~# usb-devices 

T:  Bus=01 Lev=02 Prnt=02 Port=03 Cnt=02 Dev#=  4 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=02(commc) Sub=00 Prot=00 MxPS=32 #Cfgs=  1
P:  Vendor=0451 ProdID=16a8 Rev=00.09
S:  Manufacturer=Texas Instruments
S:  Product=TI CC2531 USB CDC
S:  SerialNumber=__0X00124B0009EB0405
C:  #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=50mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=01 Driver=cdc_acm
I:  If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm

T:  Bus=01 Lev=04 Prnt=06 Port=01 Cnt=01 Dev#=  8 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=02(commc) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0658 ProdID=0200 Rev=00.00
C:  #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=01 Driver=cdc_acm
I:  If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm

T:  Bus=01 Lev=04 Prnt=06 Port=02 Cnt=02 Dev#=  9 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=02(commc) Sub=00 Prot=00 MxPS=64 #Cfgs=  2
P:  Vendor=0803 ProdID=3095 Rev=01.00
S:  Manufacturer=Conexant
S:  Product=USB Modem
S:  SerialNumber=24680246
C:  #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=01 Driver=cdc_acm
I:  If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm

T:  Bus=01 Lev=03 Prnt=05 Port=01 Cnt=02 Dev#=  7 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=02(commc) Sub=00 Prot=00 MxPS=64 #Cfgs=  2
P:  Vendor=0803 ProdID=3095 Rev=01.00
S:  Manufacturer=Conexant
S:  Product=USB Modem
S:  SerialNumber=24680246
C:  #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=01 Driver=cdc_acm
I:  If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm

All of those devices use the cdc_acm driver and appear as /dev/ttyACM? on my system. Since all of your serial USB devices appear at /dev/USB?, I have to think some odd driver is being used for your USB devices. That driver may not be recognized by nrjavaserial as being a serial device.

I do see that you reported that /dev/USB0 is working, if the driver it uses is the same for your other USB serial devices, then I am at a loss to explain what the problem may be.

Make sure the user you’re running OH as is in the dialout group - see the advice from Örjan Backsell just above. Not sure it’s the issue, though.

T:  Bus=01 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#=  5 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=ff(vend.) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=1a86 ProdID=7523 Rev=02.54
S:  Product=USB2.0-Serial
C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=96mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=02 Driver=ch341

T: Bus=01 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 5 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=ff(vend.) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=1a86 ProdID=7523 Rev=02.54
S: Product=USB2.0-Serial
C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=96mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=02 Driver=ch341

This is the output on the device that aint working

Is it a different driver from that used for the /dev/ttyUSB* devices that are working, i.e., not ch341? If so, I think that may be the problem. I had a similar problem on my test system that runs CentOS 7 that hosts a docker OH2 container. I don’t recall the exact kernel module that was loaded for one of the two USB serial devices I have plugged into that system, but the java serial driver did not recognize one of those two devices as a serial device. Unfortunately I don’t recall the exact fix I applied, but I changed the driver used by udev and that fixed the issue for me.

I will try to recover my corrective action and let you know in more detail exactly how I fixed the problem.

i think i have the rflink online now, i started all over again write the image to the sd card and so on.
I think it had to do with adding Root to dialout and tty group. Only thing i have now is that the mysensors gateway doesn’t get an usb port assigned and is getting a printer driver assigned

Everythinh is working good now! Thanks for all your reply’s and assistance