Serial Error: Port /dev/ttyUSB0 does not exist (COMMUNICATION ERROR)

  • Platform information:

    • Hardware: CPUArchitecture/RAM/storage: Intel Core i7 - 8550U/ 8GB RAM/ 1 TB Storage
    • OS: what OS is used and which version: Ubuntu Linux
    • openHAB version: openHAB 2
  • Issue of the topic: I am trying to connect a Philips Hue Motion Sensor to openHAB 2 using Z-Wave stick by Nortek Security but when I add a new Thing in openHAB inbox and use serial port /dev/ttyUSB0 for Z-Wave it gives me a does not exist error.

    I have already tried adding openhab to usergroup dialout and tty as per some similar threads as well as checked permissions given to openhab. Nothing has worked so far. Any help would be greatly appreciated.

    Thank you

Welcome to the OpenHAB community!
What is your controller stick? Bad news is Hue stuff runs on zigbee not zwave, I’m almost certain. I have one. Good news is, if this is your stick, it does zigbee as well as zwave!

One additional setting you should check are the java extra options. just open /etc/default/openhab2 and check if there is a line like:

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

Yeah, I have this one. I tried alot of things to make Z-Wave work but no luck

Hey yea I already have this line in the file. Any other suggestions?

Hi,

Try this command on command line…

dmesg | grep tty

this is my output
[ 0.000297] console [tty1] enabled
[ 0.732564] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 81, base_baud = 0) is a PL011 rev2
[ 0.734040] 3f215040.serial: ttyS0 at MMIO 0x0 (irq = 53, base_baud = 31250000) is a 16550
[ 7.213299] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 7.217588] cdc_acm 1-1.4:1.0: ttyACM1: USB ACM device

It will show all ports which has a serial connection…might help you find the port

  1. cd /dev/serial/by-id
  2. ls -l

Shows where your USB device is

This is my output for

cd /dev/serial/by-id
ls -l
                                OUTPUT
total 0
lrwxrwxrwx 1 root root 13 Jun 29 14:34 usb-Silicon_Labs_HubZ_Smart_Home_Controller_612016C0-if00-port0 -> ../../ttyUSB0
lrwxrwxrwx 1 root root 13 Jun 29 14:34 usb-Silicon_Labs_HubZ_Smart_Home_Controller_612016C0-if01-port0 -> ../../ttyUSB1

I think the problem might be here since when I ran dmesg | grep tty, I got this

[    0.148871] printk: console [tty0] enabled
[   14.800724] audit: type=1400 audit(1561818300.427:54): apparmor="DENIED" operation="open" profile="snap.openhab.openhab" name="/dev/ttyS31" pid=1282 comm="java" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[   14.800730] audit: type=1400 audit(1561818300.427:55): apparmor="DENIED" operation="open" profile="snap.openhab.openhab" name="/dev/ttyS30" pid=1282 comm="java" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[   14.800761] audit: type=1400 audit(1561818300.427:56): apparmor="DENIED" operation="open" profile="snap.openhab.openhab" name="/dev/ttyS29" pid=1282 comm="java" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[   14.800781] audit: type=1400 audit(1561818300.427:57): apparmor="DENIED" operation="open" profile="snap.openhab.openhab" name="/dev/ttyS28" pid=1282 comm="java" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[   14.800802] audit: type=1400 audit(1561818300.427:58): apparmor="DENIED" operation="open" profile="snap.openhab.openhab" name="/dev/ttyS27" pid=1282 comm="java" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[   14.800824] audit: type=1400 audit(1561818300.427:59): apparmor="DENIED" operation="open" profile="snap.openhab.openhab" name="/dev/ttyS26" pid=1282 comm="java" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[   14.800842] audit: type=1400 audit(1561818300.427:60): apparmor="DENIED" operation="open" profile="snap.openhab.openhab" name="/dev/ttyS25" pid=1282 comm="java" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[   14.800862] audit: type=1400 audit(1561818300.427:61): apparmor="DENIED" operation="open" profile="snap.openhab.openhab" name="/dev/ttyS24" pid=1282 comm="java" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[   14.800883] audit: type=1400 audit(1561818300.427:62): apparmor="DENIED" operation="open" profile="snap.openhab.openhab" name="/dev/ttyS23" pid=1282 comm="java" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[   14.800904] audit: type=1400 audit(1561818300.427:63): apparmor="DENIED" operation="open" profile="snap.openhab.openhab" name="/dev/ttyS22" pid=1282 comm="java" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[  562.124057] usb 1-1.1: cp210x converter now attached to ttyUSB0
[  562.125859] usb 1-1.1: cp210x converter now attached to ttyUSB1

Please check this article

Hey Dileepa, thank you for your reply but unfortunately that did not work either. Any other suggestion?

Wow, can’t believe you are still not getting it working. One word of caution, I have Hue motion sensor and the same USBZ dongle as you but I also have a Hue hub and use the Hue binding to make the Hue motion sensor work with OpenHAB. With that said, the error you are reporting makes it seem that this is not part of the problem
So I have to start asking questions. Great job listing your hardware and OS in first post. It would be great if you could tell us which version of OpenHAB2 you are using. Stable, snapshot ect and also what version of the zigbee binding would help.
How long has this system been up? In other words, is this a new set up that you are trying to set up for the first time or is this an instance that has been running well for some time and you just wanted to add the Hue motion sensor and USBZ dongle. How long have you been using OpenHAB, you seem to know your way around the software pretty well.
I’m guessing you have restarted the box and OpenHAB a couple times already.

Hey Andrew,

  1. I’m using stable version of openhab2. I’m trying to use Z-Wave add on rather than Zigbee
  2. It’s a new setup and this is the first Thing that I am trying to add. I am really new at this actually. Barely been a month or two on openHab.
  3. Yeah I have already tried that.

Which one? 2.4 2.5?
I guess 2.5 because you just got started and probably used the latest but I’m guessing???
And zwave binding is the one in OpenHAB not a development version I’m again guessing

yes, sorry, got my threads mixed up

OK again, real basic question, do you have the serial binding loaded?
I think it is supposed to install when you install the zwave binding but I think it was a little flakey about it recently. If you are unsure, there is a way to run a command on the OpenHAB console to check which bindings are running… search if you have to

I’m running the 2.4 version. I installed Z-Wave Binding add on through openHab’s online GUI. I’m unsure whether my serial bindings are loaded or not

ok perfect because 2.4 is really stable. If you are unsure, go back to the GUI where you installed thee Zwave binding from and look for serial binding in the list and install it if it not installed. fingers crossed

Yeah actually I have it installed. Version 1.9.0.

Darn, ok… this seems more of a serial problem then a zwave problem. I’m not sure, because the serial binding had some issues loading but I think it only came about in version 2.5. Not sure what to suggest next. Is there another USB port in your NUC that you could switch the dongle to?
the error log snippet you posted with a bunch of apparmor messages I know nothing about and not sure is apparmor installed in Ubuntu right out of the box? How did you install OpenHAB? With apt-get?
Can apparmor be turned off for a test? Maybe post a question in Ubuntu message board. Is there another USB device you can get to test work in Ubuntu?

I’ve only ran Ubuntu a few times and never for to long. In CentOS/Fedora/RedHat they had a thing called SELinux which seems very similar to apparmor could be blocking the connection if not configured. Getting things working with SELinux was always fun but being internet facing servers it was worth it because it was secure. But testing usually involved turning it off to get something to work then once working, figure out how to get working with SELinux running
Again, I may have no clue as to what I am talking about, consider it advise worth what you paid for it
How much Linux experience do you have?

Yeah I have other ports as well but I already tried plugging dongles in all of them, didnt work. I also tried disabling Apparmor but it prevented openHab from starting somehow. Yeah I installed openHab through apt-get