Z-stick + Zwave Binding + MySensors Gateway: USB and Serial woes

  • Platform information:
    • Hardware: Raspberry Pi 3
    • OS: Raspbian 9 (stretch)
    • Java Runtime Environment: openjdk, JRE v.1.8.0
    • openHAB version: 2.4.0

I have a peculiar problem and my largest blocker is determining how to articulate the issue.

I have Openhab 2.4.0 running on a headless Rpi with no GUI: all CLI with a MySensors Serial Gateway installed directly onto the Pi’s serial/UART pins. When I did the setup/config, I believe I did some kind of symlinking to ttyUSB0, but more on this in a second.

I have a Gen 3 or 4 Aeon Labs USB Z-Stick and I want to use the Z-Wave binding to control some Zwave devices. When I plug-in the Z-stick to any USB port, dmesg | grep tty* shows:

$ dmesg | grep tty* [ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 bcm2708_fb.fbwidth=1600 bcm2708_fb.fbheight=900 bcm2708_fb.fbdepth=16 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3f000000 vc_mem.mem_size=0x3f600000 dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait [ 0.000910] console [tty1] enabled [ 0.003486] Setting up static identity map for 0x100000 - 0x10003c [ 0.090115] raspberrypi-firmware soc:firmware: Attached to firmware from 2019-03-27 15:46, variant start_cd [ 0.523539] Setting default values for core params [ 0.523651] Finished setting default values for core params [ 0.916015] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 81, base_baud = 0) is a PL011 rev2 [ 0.921489] 3f215040.serial: ttyS0 at MMIO 0x0 (irq = 53, base_baud = 31250000) is a 16550 [ 3.417939] lan78xx 1-1.1.1:1.0 (unnamed net_device) (uninitialized): No External EEPROM. Setting MAC Speed [ 4.494578] usb 1-1.1.2: cp210x converter now attached to ttyUSB0 [ 3082.021009] cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0 [ 3092.701902] usb 1-1.1.2: cp210x converter now attached to ttyUSB0 [27405.093074] cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0 [27414.636730] usb 1-1.3: cp210x converter now attached to ttyUSB0 [29943.731085] cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0 [29950.175860] usb 1-1.1.3: cp210x converter now attached to ttyUSB0 [62049.828744] cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0 [62146.408538] usb 1-1.2: cp210x converter now attached to ttyUSB0 [62535.346760] cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0 [62641.770291] usb 1-1.3: cp210x converter now attached to ttyUSB0 [62699.698755] cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0 [62701.529576] usb 1-1.1.3: cp210x converter now attached to ttyUSB0

In my PaperUI config, I have 3 options to assign a port to the Z-wave Serial Controller Thing:
/dev/ttyUSB0
/dev/ttyAMA0
and
/dev/ttyS0

The MySensors Serial gateway is set to use /dev/ttyUSB0, but I can’t recall precisely WHY I did that and didn’t use the non-bluetooth serial port available (presumably /dev/ttyAMA0). I’m pretty green to OpenHab2 and I used a tutorial for the setup back in May 2019, so I’m sure the tutorial told me to do it that way.

When I plug in the Z-stick into any USB port, the RPi logs a cp210x converter now attached to ttyUSB0 event (as shown above).

The openhab logs aren’t very helpful, it’s just MySensors traffic:
2020-01-05 14:07:28.579 [INFO ] [ing.zwave.handler.ZWaveSerialHandler] - Stopped ZWave serial handler 2020-01-05 14:07:28.610 [INFO ] [ing.zwave.handler.ZWaveSerialHandler] - Connecting to serial port '/dev/ttyUSB0'

Inside PaperUI, I get the following:
image

The above makes sense because MySensors Serial Gateway is using that port:
Imgur

Can I use both the onboard serial pins for my NRF24L01 MySensors Gateway while also using a Z-Stick for Zwave control? Is there some way to assign the Z-Stick to another tty port?

I have read that a port called ttyAMC0 should be initiated when the z-stick is attached, but after several reboots, unplugs and re-plugs, hard resetting the z-stick, etc…nothing shows up.

Here’s the output from lsusb:
Bus 001 Device 013: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light Bus 001 Device 006: ID 0424:7800 Standard Microsystems Corp. Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Any guidance or information is greatly appreciated. Thank you!

If it is connected to the serial pins, you should have not chosen a device normally used by the OS for USB serial devices. As OH says, you have an OS level device conflict unrelated to openHAB.

I do not have a z-stick but both of my other z-wave sticks are assigned /dev/ttyUSB0 by the OS.

Thanks for your reply Bruce. Yes, I know that the MySensors Gateway uses the serial port via some configuration through the /dev/ttyUSB0 interface, but that can’t be the only method of using a Z-stick AND a MySensors Serial gateway in conjunction.

That becomes a Debian or Raspbian OS question then, not openHAB. There are few Debian Linux experts here.

Here’s a tutorial you may find helpful.

1 Like

Nearly two years late, but thank you for the response. This is the solution I needed.