Continuous repeating Warnings /sys/class/tty/ttyUSB0

I’m getting these errors every minute or less. Openhabian is new to me, although been an OH user for quite a few years now. i’m running openHAB 2.5.11-1 (Release Build)

2020-12-20 18:20:08.961 [WARN ] [sysfs.internal.SysfsUsbSerialScanner] - Could not find the device path for /sys/class/tty/ttyUSB1 in the sysfs: /sys/class/tty/ttyUSB1
2020-12-20 18:20:08.972 [WARN ] [sysfs.internal.SysfsUsbSerialScanner] - Could not find the device path for /sys/class/tty/ttyACM0 in the sysfs: /sys/class/tty/ttyACM0
2020-12-20 18:20:08.979 [WARN ] [sysfs.internal.SysfsUsbSerialScanner] - Could not find the device path for /sys/class/tty/ttyUSB0 in the sysfs: /sys/class/tty/ttyUSB0
2020-12-20 18:20:23.991 [WARN ] [sysfs.internal.SysfsUsbSerialScanner] - Could not find the device path for /sys/class/tty/ttyUSB1 in the sysfs: /sys/class/tty/ttyUSB1
2020-12-20 18:20:24.001 [WARN ] [sysfs.internal.SysfsUsbSerialScanner] - Could not find the device path for /sys/class/tty/ttyACM0 in the sysfs: /sys/class/tty/ttyACM0
2020-12-20 18:20:24.006 [WARN ] [sysfs.internal.SysfsUsbSerialScanner] - Could not find the device path for /sys/class/tty/ttyUSB0 in the sysfs: /sys/class/tty/ttyUSB0

Same problem here after upgrading to OH3.

How to solve this?

There also is a report that a user has this with 2.5.7 - no solution so far in that thread.
My I ask which bindings are used ? z-wave and enocean ?

Btw. the title says “repeating errors” but they these messages are “warnings” - there are messages in the log but everything else works.

What settings to you have in /etc/default/openhab resp. in /etc/default/openhab2 for variable EXTRA_JAVA_OPTS ?

Bindings are:
binding = zwave,rfxcom,powermax,hue,astro,mqtt,mihome,tplinksmarthome, network, mihome, ipcamera

Any setting for EXTRA_JAVA_OPTS?

Openhab file - none
openhab2 file - EXTRA_JAVA_OPTS="-Xms192m -Xmx320m"
I have no idea what this means though.
Colin

Could you login to the karaf console ( command is openhab-cli ) and enter:

log:get

This will show the logging settings.

Besides that what does:

ls -lH /sys/class/tty/ttyUSB0   /sys/class/tty/ttyUSB1  /sys/class/tty/ttyACM0

return ?

This should show the content of the directories that are behind the links.
I would expect to see errors or empty directories here as the code that raises the warnings explains:

    /**
     * In the sysfs, the directory 'class/tty' contains a symbolic link for every serial port style device, i.e., also
     * for serial devices. This symbolic link points to the directory for that device within the sysfs device tree. This
     * method returns the directory to which this symbolic link points for a given serial port.
     * <p/>
     * If the symbolic link cannot be converted to the real path, null is returned and a warning is logged.
     */
[14:36:12] openhabian@OH3PI:~$ log:get
-bash: log:get: command not found


[14:42:40] openhabian@OH3PI:~$ ls -lH /sys/class/tty/ttyUSB0   /sys/class/tty/ttyUSB1  /sys/class/tty/ttyACM0
ls: cannot access '/sys/class/tty/ttyUSB0': Permission denied
ls: cannot access '/sys/class/tty/ttyUSB1': Permission denied
ls: cannot access '/sys/class/tty/ttyACM0': Permission denied
[14:42:48] openhabian@OH3PI:~$ cd /sys
[14:43:25] openhabian@OH3PI:/sys$ cd class
[14:43:37] openhabian@OH3PI:/sys/class$
[14:43:37] openhabian@OH3PI:/sys/class$ cd tty
[14:43:45] openhabian@OH3PI:/sys/class/tty$ ls
console  tty13  tty20  tty28  tty35  tty42  tty5   tty57  tty7       ttyUSB1
ptmx     tty14  tty21  tty29  tty36  tty43  tty50  tty58  tty8
tty      tty15  tty22  tty3   tty37  tty44  tty51  tty59  tty9
tty0     tty16  tty23  tty30  tty38  tty45  tty52  tty6   ttyACM0
tty1     tty17  tty24  tty31  tty39  tty46  tty53  tty60  ttyAMA0
tty10    tty18  tty25  tty32  tty4   tty47  tty54  tty61  ttyprintk
tty11    tty19  tty26  tty33  tty40  tty48  tty55  tty62  ttyS0
tty12    tty2   tty27  tty34  tty41  tty49  tty56  tty63  ttyUSB0

the three files names (USB0, USB1, ACM0) are showing in red which google tells me means they are ‘archive’ files?

Thanks for the feedback.
With regard to log:get : this command needs to be executed in the karaf console. First run command ‘openhab-cli console’ to login to the karaf console.
Could you do

sudo  ls -lH /sys/class/tty/ttyUSB0   /sys/class/tty/ttyUSB1  /sys/class/tty/ttyACM0

instead of the previous ls command. It looks like it could be a permission item.

First of all, massive thank you for your help and support :slight_smile:

re log:get…


/usr/bin/openhab-cli: 107: /usr/bin/openhab-cli: /usr/share/openhab/runtime/bin/client: not found

Then…

[15:51:41] openhabian@OH3PI:~$ sudo  ls -lH /sys/class/tty/ttyUSB0   /sys/class/tty/ttyUSB1  /sys/class/tty/ttyACM0
/sys/class/tty/ttyACM0:
total 0
-r--r--r-- 1 root root 4096 Dec 23 15:51 dev
lrwxrwxrwx 1 root root    0 Dec 19 12:54 device -> ../../../1-1.3.3:1.0
drwxr-xr-x 2 root root    0 Dec 23 15:51 power
lrwxrwxrwx 1 root root    0 Dec 23 15:51 subsystem -> ../../../../../../../../../../../../../../class/tty
-rw-r--r-- 1 root root 4096 Dec 19 12:54 uevent

/sys/class/tty/ttyUSB0:
total 0
-rwxrwxrwx 1 root root 4096 Dec 23 14:42 dev
lrwxrwxrwx 1 root root    0 Dec 19 12:54 device -> ../../../ttyUSB0
drwxrwxrwx 2 root root    0 Dec 23 14:42 power
lrwxrwxrwx 1 root root    0 Dec 23 14:42 subsystem -> ../../../../../../../../../../../../../../../../class/tty
-rwxrwxrwx 1 root root 4096 Dec 23 14:42 uevent

/sys/class/tty/ttyUSB1:
total 0
-r--r--r-- 1 root root 4096 Dec 23 15:51 dev
lrwxrwxrwx 1 root root    0 Dec 19 12:44 device -> ../../../ttyUSB1
drwxr-xr-x 2 root root    0 Dec 23 15:51 power
lrwxrwxrwx 1 root root    0 Dec 23 15:51 subsystem -> ../../../../../../../../../../../../../../class/tty
-rw-r--r-- 1 root root 4096 Dec 19 12:44 uevent

Colin

Hi!

I have only homematic,openweather and tplink binding installed.
What i did is creating symlinks for my usb devices with udev rules.

The result of the ls command is the same as Colin has.

br

@s4ndst0rm, @BigCol as far as I can see that should be ok.
One more question:

ls -l /dev/ttyACM* /dev/ttyUSB0   /dev/ttyUSB1
ls -ld /sys/class/tty/ttyUSB0   /sys/class/tty/ttyUSB1  /sys/class/tty/ttyACM0

Apologies only just seen your message. Distracted after finding out I’ve tested positive for the lovely virus that half the country thinks doesn’t exist, or is caused by 5G. I’ll reply in the morning with what you’ve asked for.
Thanks for the support though.
Colin

No need to excuse. Take your time. I wish you and your family all the best.

crw-rw---- 1 root dialout 166, 0 Dec 24 12:24 /dev/ttyACM0
crw-rw---- 1 root dialout 188, 0 Dec 23 16:55 /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 1 Dec 24 12:26 /dev/ttyUSB1

lrwxrwxrwx 1 root root 0 Dec 19 12:54 /sys/class/tty/ttyACM0 -> ../../devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3.3/1-1.3.3:1.0/tty/ttyACM0
lrwxrwxrwx 1 root root 0 Dec 19 12:54 /sys/class/tty/ttyUSB0 -> ../../devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4.1/1-1.3.4.1:1.0/ttyUSB0/tty/ttyUSB0
lrwxrwxrwx 1 root root 0 Dec 19 12:44 /sys/class/tty/ttyUSB1 -> ../../devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2:1.0/ttyUSB1/tty/ttyUSB1

..and still getting this error  
/usr/bin/openhab-cli: 107: /usr/bin/openhab-cli: /usr/share/openhab/runtime/bin/client: not found```

I have four USB devices connected. ttyUSB3 - ttyUSB6. I changed your command to fit these devices.

result:

[13:38:28] openhabian@smarthome:~$ sudo ls -l /dev/ttyUSB3 /dev/ttyUSB4 /dev/ttyUSB5 /dev/ttyUSB6
crw-rw---- 1 root dialout 188, 3 Dec 22 22:27 /dev/ttyUSB3
crw-rw---- 1 root dialout 188, 4 Dec 22 22:27 /dev/ttyUSB4
crw-rw---- 1 root dialout 188, 5 Dec 22 22:27 /dev/ttyUSB5
crw-rw---- 1 root dialout 188, 6 Dec 22 22:27 /dev/ttyUSB6

[13:40:13] openhabian@smarthome:~$ sudo ls -ld /sys/class/tty/ttyUSB3 /sys/class/tty/ttyUSB4 /sys/class/tty/ttyUSB5 /sys/class/tty/ttyUSB6
lrwxrwxrwx 1 root root 0 Dec 22 22:27 /sys/class/tty/ttyUSB3 -> ../../devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.1/1-1.1.2/1-1.1.2:1.0/ttyUSB3/tty/ttyUSB3
lrwxrwxrwx 1 root root 0 Dec 22 22:27 /sys/class/tty/ttyUSB4 -> ../../devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.1/1-1.1.1/1-1.1.1.4/1-1.1.1.4:1.0/ttyUSB4/tty/ttyUSB4
lrwxrwxrwx 1 root root 0 Dec 22 22:27 /sys/class/tty/ttyUSB5 -> ../../devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/ttyUSB5/tty/ttyUSB5
lrwxrwxrwx 1 root root 0 Dec 22 22:27 /sys/class/tty/ttyUSB6 -> ../../devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.1/1-1.1.4/1-1.1.4:1.0/ttyUSB6/tty/ttyUSB6

@s4ndst0rm, @BigCol
that looks all good so far.
What I am wondering at the moment is why

ls -lH /sys/class/tty/ttyUSB0   /sys/class/tty/ttyUSB1  /sys/class/tty/ttyACM0

( without sudo gives back an error ). Is this still the case ?

An other way to get access to the karaf console is:

ssh  -p 8101 openhab@localhost

Please run the

log:get

command in that console/shell.

openhab> log:get
Logger                                             │ Level
───────────────────────────────────────────────────┼──────
ROOT                                               │ WARN
javax.jmdns                                        │ ERROR
javax.mail                                         │ ERROR
openhab.event                                      │ INFO
openhab.event.AddonEvent                           │ ERROR
openhab.event.InboxUpdatedEvent                    │ ERROR
openhab.event.ItemAddedEvent                       │ ERROR
openhab.event.ItemChannelLinkAddedEvent            │ ERROR
openhab.event.ItemChannelLinkRemovedEvent          │ ERROR
openhab.event.ItemRemovedEvent                     │ ERROR
openhab.event.ItemStateEvent                       │ ERROR
openhab.event.RuleAddedEvent                       │ ERROR
openhab.event.RuleRemovedEvent                     │ ERROR
openhab.event.RuleStatusInfoEvent                  │ ERROR
openhab.event.StartlevelEvent                      │ ERROR
openhab.event.ThingAddedEvent                      │ ERROR
openhab.event.ThingRemovedEvent                    │ ERROR
openhab.event.ThingStatusInfoEvent                 │ ERROR
openhab.event.ThingUpdatedEvent                    │ ERROR
org.apache.cxf.jaxrs.sse.SseEventSinkImpl          │ ERROR
org.apache.karaf.jaas.modules.audit                │ INFO
org.apache.karaf.kar.internal.KarServiceImpl       │ ERROR
org.apache.karaf.shell.ssh.SshUtils                │ ERROR
org.apache.karaf.shell.support                     │ OFF
org.apache.sshd                                    │ WARN
org.eclipse.lsp4j                                  │ OFF
org.jupnp                                          │ ERROR
org.openhab                                        │ INFO
org.ops4j.pax.url.mvn.internal.AetherBasedResolver │ ERROR
org.ops4j.pax.web.pax-web-runtime                  │ OFF

Yes, i had to use “sudo”. After your post i checked the permissions of /dev/ttyUSB4. Others didnt had access. I changed the permission to 666 but this did not solve the problem but now the ls command works without sudo.

Logger                                             │ Level
──────────────────────────────────────────────────────────
ROOT                                               │ WARN
javax.jmdns                                        │ ERROR
javax.mail                                         │ ERROR
org.apache.karaf.jaas.modules.audit                │ INFO
org.apache.karaf.kar.internal.KarServiceImpl       │ ERROR
org.apache.karaf.shell.ssh.SshUtils                │ ERROR
org.apache.karaf.shell.support                     │ OFF
org.eclipse.lsp4j                                  │ OFF
org.eclipse.smarthome                              │ INFO
org.jupnp                                          │ ERROR
org.openhab                                        │ INFO
org.openhab.ui.paper                               │ WARN
org.openhab.ui.paper.internal                      │ INFO
org.ops4j.pax.url.mvn.internal.AetherBasedResolver │ ERROR
org.ops4j.pax.web.pax-web-runtime                  │ OFF
smarthome.event                                    │ INFO
smarthome.event.InboxUpdatedEvent                  │ ERROR
smarthome.event.ItemAddedEvent                     │ ERROR
smarthome.event.ItemRemovedEvent                   │ ERROR
smarthome.event.ItemStateEvent                     │ ERROR
smarthome.event.ThingAddedEvent                    │ ERROR
smarthome.event.ThingRemovedEvent                  │ ERROR
smarthome.event.ThingStatusInfoEvent               │ ERROR

@s4ndst0rm, @BigCol as far as I can see the settings are ok.
At the moment I do not have further ideas.
The only option that is left and may help is try to change the log level for this kind of message from WARN to ERROR:

log:set  ERROR sysfs.internal.SysfsUsbSerialScanner

assumed that sysfs.internal.SysfsUsbSerialScanner is the full name of the log level and nothing before sysfs is stripped of by logger formatting/restrictions.