[SOLVED] Problems getting: OH 2.2, Pi3, Jessy, Razberry & Z-Wave to work together

Tags: #<Tag:0x00007efed8595988> #<Tag:0x00007efed8594f38> #<Tag:0x00007efed85948d0>

I’m having great difficulty trying to get my Razberry to work with the Z-Wave Binding. I have searched and searched the forum and pieced together information from about 5 topics but cannot get it to work. I suspect this is due to me trying a more recent Pi with more recent software.

In an effort to fix this issue for myself and to help others I’ve created a detailed list of what I have done in the hope that we have some up-to-date instructions.

Hardware/Software

Assumptions

  • I just plug the Razberry into the Pi. I don’t have to install the z-way program and software
  • The serial port is /dev/ttyAMA0 (this is what is used when used with z-way)

Steps I’ve taken

Add openhab user to required groups

sudo adduser openhab dialout
sudo adduser openhab tty

Open config file

sudo vi /boot/config.txt

Add the following to disable Bluetooth

dtoverlay=pi3-disable-bt
enable_uart=1

Before disabling BT as above I also tried adding the following dtoverlay=pi3-miniuart-bt to the file but it caused the field in the z-wave binding options to become a drop-down where I could not enter my serial port plus it did not work.(see below this is all I could set it to)

2018-02-09 09_44_00-Paper UI

Open
sudo vi /boot/cmdline.txt

Remove
console=serial0,115200

In another post I saw that this info should also be deleted from /etc/inittab but on my Pi3 Jessie the directory does not exist

Open
sudo vi /etc/default/openhab2

Un-comment or add
EXTRA_JAVA_OPTS=”-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0″

I also tried adding the following but it did not work either
EXTRA_JAVA_OPTS=”-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyAMA0″

Paper UI

  • Addons / Bindings / Install Z-Wave binding
  • Inbox/ +/ Z-Wave Binding / Z-Wave Serial Controller /
  • Enter /dev/ttyAMA0 in the Serial Port box and click the blue tick

Anyone have any ideas where I could be going wrong or how to fix?

What specifically is the problem? The Serial Controller is showing as offline?

Do you see errors in the logs?

Have you verified that the serial port is /dev/ttyAMA0?

The screen shot from PaperUI seems to imply that it is not on /dev/ttyAMA0.

:grin: Sorry I was too focused on explaining what I did rather than saying what was wrong and me saying it is not working is obviously not good enough.

I have had many errors but following my method above exactly it states that it is offline because the port does not exist.

17:59:30.638 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link 'zwave_serial_zstick_b9d74e20_serial_oof-zwave:serial_zstick:b9d74e20:serial_oof' has been added.
17:59:30.791 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'zwave:serial_zstick:b9d74e20' changed from UNINITIALIZED to INITIALIZING
17:59:30.831 [INFO ] [ding.zwave.handler.ZWaveSerialHandler] - Connecting to serial port '/dev/ttyAMA0'
17:59:30.833 [INFO ] [smarthome.event.ThingUpdatedEvent    ] - Thing 'zwave:serial_zstick:b9d74e20' has been updated.
17:59:30.843 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'zwave:serial_zstick:b9d74e20' changed from INITIALIZING to OFFLINE (BRIDGE_OFFLINE): Controller is offline
17:59:30.850 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'zwave:serial_zstick:b9d74e20' changed from OFFLINE (BRIDGE_OFFLINE): Controller is offline to OFFLINE (COMMUNICATION_ERROR): Serial Error: Port /dev/ttyAMA0 does not exist

I don’t know how to verify the port which is why I assumed it was the same as the one on my other Pi with Razberry and z-way installed. I have also tried ttyS0

This was to show that when I added dtoverlay=pi3-miniuart-bt to /boot/config.txt that in the Paper UI the input field could not be edited and was automatically populated with dev/ttyS0

So this error can indicate either that the device doesn’t exist (e.g. isn’t successfully plugged in), is at a different location (e.g. /dev/ttyS0 rather than /dev/ttyAMA0), or the openhab user does not have permission to read and write to the device.

ls -l /dev/tty*

That will list all the serial devices and their permissions. You should see a /dev/ttyAMA0. If you do not you know that your device is showing up as something else (/dev/ttyUSB0 is common). If you see more than one, it is possible that the controller is located at the other one (e.g. /dev/ttyAMA1).

I don’t know how easy this is to do with the Razberry, but with a USB controller one can see what device the controller is showing up as by stopping OH, unplugging the controller, running the ls command from above, plugging the controller back in, running the ls command again and look for the new item in the listing. That new item will be your controller.

I’m using the same hardware.
You should be able to choose /dev/ttyAMA0 when properly installed.

does “dmesg” shows some serial devices (I have other usb - serial devices connected)

> bhe@PI-Garage:~ $ dmesg | grep tty
> [    0.000000] Kernel command line: 8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
> [    0.001219] console [tty1] enabled
> [    0.896119] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
> [    3.226545] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
> [    3.239522] cdc_acm 1-1.5:1.0: ttyACM1: USB ACM device

I have tried this but nothing new shows and nothing has USB0

crw-rw---- 1 root dialout 204, 64 Feb  9 18:35 /dev/ttyAMA0
crw------- 1 root root      5,  3 Feb  9 18:35 /dev/ttyprintk
crw-rw---- 1 root dialout   4, 64 Feb  9 19:19 /dev/ttyS0

I get this output both when the Razberry is in or out

[    0.000000] Kernel command line: 8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbdepth=16 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ea00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=tty1 root=PARTUUID=a88fbca1-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
[    0.001234] console [tty1] enabled
[    0.831012] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2

Devices eeems ok.

my /etc/defaults/openhab contains also :
EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0"

cmdline.txt
console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

config.txt
dtoverlay=pi3-disable-bt

are you sure the z-wave sever is disabled and doesn’t uses the serial /dev/ttyAMA0 port ?

mine is a bit different

dwc_otg.lpm_enable=0 console=tty1 root=PARTUUID=a88fbca1-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

How can I be sure?

I’m testing on a fresh install of OH with only the z-wave binding installed and no things added

I meant the zway server. But if it is a clean install then it won’t be installed and running.

Chek /etc/defaults/openhab2 doesn’t has multiple extra_java_opts uncommented

Well… you cracked it, there was another uncommented that had nothing in " ", once I deleted it, it worked!

Thanks to you both I’ve learnt a bit more and fixed my problem. :beers:

1 Like