OpenHAB2 + Razberry + Z-Wave Binding

raspberry
zwave
Tags: #<Tag:0x00007f51dd7eaa28> #<Tag:0x00007f51dd7ea640>

(Bud Ghiss) #5

Ok @chris - again, thanks for the feedback.

I wanted to mention I did get this setup working with OH1. Could there be any conflicts by chance? I did stop services accordingly.


(Chris Jackson) #6

If it worked on OH1, then it should work with the same port etc with OH2. The serial driver, and the ZWave code that deals with this is the same on OH1 and OH2.

I wouldn’t expect any conflicts. If you uninstalled, or even just aren’t running OH1, then it should be ok.

What version of JDK are you running?


(Bud Ghiss) #7

@chris I did a fresh install of Raspian and installed the z-way package and got the Razberry working with that software.

But now after I install OpenHAB2, it hangs at [.dashboard.internal.DashboardService] - Started dashboard at /start.

Any ideas?

JDK 8 is the version.


(Chris Jackson) #8

Does Z-Way leave something running in the background (ie does it have a daemon running)? If it’s using the same port that OH wants to use it might cause this.

It might be worth putting the system into debug mode to see what’s happening.


(Bud Ghiss) #9

Hey Chris,

So I am trying to get DEBUG going - I have visited
http://www.cd-jackson.com/index.php/openhab to try to get it enabled. By
console, do you mean a shell session is where I enter this at the
prompt *log:set
debug org.openhab.binding.zwave? *I am getting an error. I am new to OH2,
so all of this is still foreign.

Thanks for working with me,

Bud


(Bud Ghiss) #10

It looks like I can get some feedback running the start_debug.sh. After doing so, and after editing the
([Solved] How to define a serial port on raspberry for openhab2 for my razberry zwave binding?)

setenv

in file “setenv” at /opt/openhab/runtime/karaf/bin
you need to add the parameter -Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0
just to make sure that karaf is aware on the JVM parameter.

for me those are now:

export JAVA_OPTS="${JAVA_OPTS}
-Dopenhab.home=${OPENHAB_HOME}
-Dopenhab.conf=${OPENHAB_CONF}
-Dopenhab.runtime=${OPENHAB_RUNTIME}
-Dopenhab.userdata=${OPENHAB_USERDATA}
-Dorg.osgi.service.http.port=${HTTP_PORT}
-Dorg.osgi.service.http.port.secure=${HTTPS_PORT}
-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0"

still no dice.

So is there another way to define the serial port in OH2?


(Bud Ghiss) #11

Resolved. It was a syntax error.

For those using the Razberry board, it seems that this line -Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0" needs to be added to /usr/share/openhab2/runtime/karaf/bin/setenv under

export JAVA_OPTS="${JAVA_OPTS}

at the end and the ending quote needs to be removed after -Dorg.osgi.service.http.port.secure=${HTTPS_PORT}".

export JAVA_OPTS="${JAVA_OPTS}
-Dopenhab.home=${OPENHAB_HOME}
-Dopenhab.conf=${OPENHAB_CONF}
-Dopenhab.runtime=${OPENHAB_RUNTIME}
-Dopenhab.userdata=${OPENHAB_USERDATA}
-Dorg.osgi.service.http.port=${HTTP_PORT}
-Dorg.osgi.service.http.port.secure=${HTTPS_PORT}
-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0"

Thanks for the help @chris and @peter_seelinger.

Debugging still seems to be a mystery, but I will keep tinkering.


Z-Wave not working
(Chris Jackson) #12

What is the error?

Note that starting with the debug script still won’t enable debugging until you enable it in the console.


(Bud Ghiss) #13

I am under the impression I can type log:set debug org.openhab.binding.zwave at the SSH shell. When I do that, I receive the error -bash: log:set: command not found.

Thanks @chris


(Chris Jackson) #14

This command should work. Are you logged in to the correct console? What do you see when you log on (do you see the openhab logo), and what do you see when you type ‘help’ (eg lots of OH commands)?


(Bud Ghiss) #15

Got it resolved by launching ./client
Thanks @chris - you’ve been great.


(Connor Bredin) #16

I seem to be struggling with OpenHab 2 connecting to the Razberry board. I had it working a few months ago with a manual installation of the beta, but due to a corrupted SD card I lost that work.

The difference this time is that I installed OpenHAB2 as a service.

The z-wave network was setup using the Z-way software, as I did last time. I then stopped the z-way-server service before starting the OpenHab2 service.

I added the line to the setenv file under /usr/share/… , making sure the ’ " ’ was in the right place. Still no dice, however. Upon start up OpenHab2 does not recognize ttyAMA0.


(Seaside) #17

Hi I’ve also experienced issues with this.
See: /dev/ttyAMA0 does not exist on RasPi2 & OH2

Basically for me it works when using /dev/ttyUSB30 in the configuration of the Z-wave controller:

root@firefly:/dev# ls -l tty*USB*
lrwxrwxrwx 1 root root 7 Sep  5 20:38 ttyUSB30 -> ttyAMA0
root@firefly:/dev# ls -la *ttyAMA0*
crw-rw---- 1 root dialout 204, 64 Sep  9 09:49 ttyAMA0

Where ttyUSB30 is a symbolic link.


(Connor Bredin) #18

Hi @Seaside, thank for your response.

I created the symbolic link as per that thread, and changed the setenv file and the openhab config to reflect that change.

I rebooted the OpenHab2 service, but now it just says /dev/ttyUSB30 does not exist.

pi@raspberrypi ~ $ ls -l /dev/tty* crw-rw---- 1 root tty 204, 64 Dec 31 1969 /dev/ttyAMA0 lrwxrwxrwx 1 root root 12 Sept 9 06:57 /dev/ttyUSB30 -> /dev/ttyAMA0

Do I need to restart the pi for these changes to work?

Edit: Just tried rebooting, and adding user pi and openhab to group tty. Still no change.

Edit2: I was finally able connect. The answer was staring me in the face. Adding user pi to group tty was what I needed, combined with @budghiss 's solution.


(Bud Ghiss) #19

Hi Connor,

I have not been using OH2 lately, I reverted back to OH1 for the time being.

I as well believe I used z-way before launching OH2 - this may not be
mandatory though.

To get z-way working properly, I had to use:

echo 900 >
/opt/z-way-server/automation/storage/8084AccessTimeout-6b497208061ec7faae003cdd7f9a035e.json

As for OH2, I made a short script to try to step through the install.

Also, this script has the offline version - you should now be able to use
apt-get.

Let me know if this helps.

#!/bin/bash

sudo apt-get install apt-transport-https

sudo echo deb
https://openhab.ci.cloudbees.com/job/openHAB-Distribution/ws/distributions/openhab-offline/target/apt-repo/
/ >> /etc/apt/sources.list
sudo apt-get install openhab2-offline

sudo chown -hR openhab:openhab /etc/openhab2
sudo chown -hR openhab:openhab /usr/share/openhab2

sudo apt-get install samba samba-common-bin

sudo cp -v smb.conf /etc/samba/

#verify /etc/samba/smb.conf -> wins support = yes and openhab parameters
are set at bof

sudo smbpasswd -a openhab

sudo update-rc.d smbd enable
sudo update-rc.d nmbd enable
sudo service smbd restart

sudo usermod -a -G dialout openhab
sudo usermod -a -G dialout pi
sudo usermod -a -G dialout root
sudo usermod -G tty openhab

#edit  /usr/share/openhab2/runtime/karaf/bin/setenv to
#export JAVA_OPTS="${JAVA_OPTS}
#-Dopenhab.home=${OPENHAB_HOME}
#-Dopenhab.conf=${OPENHAB_CONF}
#-Dopenhab.runtime=${OPENHAB_RUNTIME}
#-Dopenhab.userdata=${OPENHAB_USERDATA}
#-Dorg.osgi.service.http.port=${HTTP_PORT}
#-Dorg.osgi.service.http.port.secure=${HTTPS_PORT}
#-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0"

Rob


(Connor Bredin) #20

Hi Rob,

Thanks for taking the time to send me that info.

I had previously added openhab and pi users to dialout, but I hadn’t to
tty. Once I did that I was able to connect to AMA0.

Thanks again,

Connor


(Quang Tuyen Tran) #21

Hi,

i have the same problem after updating to openhab2, i did not find the folder /openhab2/runtime/karaf/bin/setenv.

maybe it is wrong by me?

can you give me some advices?

thanks alot


(Frerk Meyer) #22

I found it (in OpenHABian) under
/usr/share/openhab2/runtime/bin/setenv


(Frerk Meyer) #23
  1. disable the tty an the GPIO UART with raspi-config, reboot
  2. set “enable-uart=1” in /boot/config.txt, reboot
  3. /dev/ttyAMA0 should be accessable again (check group of device versus groups of openhab user)

(Quang Tuyen Tran) #24

Thanks Frerk, i found it and try to connect to my razberry v.2. Do you have any problems after changing the file setenv? Can you connect with your Razberry?

Quang-Tuyen Tran
quangtuyen.tran@gmx.de
(+49) 015237376688


Zigbee binding