Razberry Not Working with Openhab

Hey guys, I have a Razberry Zwave module installed on my Rpi b+.

My razberry module installed great and I can access it and various nodes I have installed great when the z-way-server is running.

I am having trouble getting my working openhab to use these zwave nodes though. I have done the following:

downloaded org.openhab.binding.zwave-1.8.0.jar and put that in my addons folder.

in openhab.cfg
changed my zwave port to /dev/ttyAMA0

setup my items file with this line:

Switch ZwaveDevice “Wall” (GF_Study) {zwave=“2:command=SWITCH_BINARY”}

I can control this device in the ui of the zwave server so it definitely is node 2 and fully controllable by my zwave server.

I always make sure my z-way-server is not running while I am trying to control the device in openhab.

thanks for any help

edit: here is a list of other things in my addons folder, maybe one of them is conflicting?

org.openhab.action.mqtt-1.8.0.jar org.openhab.binding.ntp-1.8.0.jar org.openhab.persistence.mqtt-1.8.0.jar
org.openhab.binding.http-1.8.0.jar org.openhab.binding.zwave-1.8.0.jar org.openhab.persistence.rrd4j-1.8.0.jar
org.openhab.binding.mqtt-1.8.0.jar org.openhab.persistence.exec-1.8.0.jar README
org.openhab.binding.mqttitude-1.8.0.jar org.openhab.persistence.logging-1.8.0.jar
pi@raspberrypi /opt/work/addons $ cd …

Did you install openHAB using apt-get? If so it is running as the openhab user and the openhab user is not a member of the dialout group and therefore does not have permission to read/write /dev/ttyAMA0. The simplest fix is to add the openhab user to the dailout group.

Rich, Hello again!

Openhab was installed by just downloading the jar files into /opt/work

I did add the user “pi” to dialout by doing this command anyway.
sudo usermod -a -G dialout pi

to note, in my users.cfg file I have:
admin=password

so maybe my username is admin? but that didn’t work when I tried to add “admin” to dialout.

But yea the installation method was not apt-get.

thanks so much like always Rich

That controls how users log in to your sitemap, not what user OH runs as.

What errors are in the logs?

Yea I was thinking that too about the sitemap login.

In terms of logs I’m not totally sure how to check the logs.

Do you mean the runtime?

When I launch the runtime I don’t see anything when I flip the switches and I thought I should see something.

I’m going to research about the openhab logs and see what I can dig up.

Edit: This is my log file from log folder and file named 2016_01_18.request.log

107.1.136.3 - - [18/Jan/2016:00:45:51 +0000] “GET /rest/bindings HTTP/1.1” 404 0
107.1.136.3 - - [18/Jan/2016:00:45:51 +0000] “GET /rest/sitemaps HTTP/1.1” 200 736
107.1.136.3 - - [18/Jan/2016:00:45:51 +0000] “GET /rest/sitemaps/test/demo HTTP/1.1” 200 1015
107.1.136.3 - - [18/Jan/2016:00:45:52 +0000] “GET /rest/sitemaps/test/demo HTTP/1.1” 200 0
107.1.136.3 - - [18/Jan/2016:00:45:52 +0000] “GET /images/switch-on.png HTTP/1.1” 200 2076
107.1.136.3 - - [18/Jan/2016:00:45:53 +0000] “POST /rest/items/PiLED HTTP/1.1” 201 0
107.1.136.3 - - [18/Jan/2016:00:45:57 +0000] “POST /rest/items/PiLED17 HTTP/1.1” 201 0
107.1.136.3 - - [18/Jan/2016:00:46:11 +0000] “GET /rest/sitemaps HTTP/1.1” 200 736
107.1.136.3 - - [18/Jan/2016:00:46:12 +0000] “GET /rest/sitemaps/test/demo HTTP/1.1” 200 1015
107.1.136.3 - - [18/Jan/2016:00:46:12 +0000] “GET /rest/sitemaps/test/demo HTTP/1.1” 200 0
107.1.136.3 - - [18/Jan/2016:01:12:49 +0000] “GET /rest/bindings HTTP/1.1” 404 0
107.1.136.3 - - [18/Jan/2016:01:12:49 +0000] “GET /rest/sitemaps/test/demo HTTP/1.1” 200 1015
107.1.136.3 - - [18/Jan/2016:01:12:49 +0000] “GET /rest/sitemaps/test/demo HTTP/1.1” 200 0
107.1.136.3 - - [18/Jan/2016:01:12:49 +0000] “GET /rest/sitemaps HTTP/1.1” 200 736
107.1.136.3 - - [18/Jan/2016:01:12:53 +0000] “POST /rest/items/ZwaveDevice HTTP/1.1” 201 0
107.1.136.3 - - [18/Jan/2016:01:13:48 +0000] “POST /rest/items/ZwaveDevice HTTP/1.1” 201 0
107.1.136.3 - - [18/Jan/2016:01:13:52 +0000] “POST /rest/items/ZwaveDevice HTTP/1.1” 201 0
107.1.136.3 - - [18/Jan/2016:01:13:52 +0000] “POST /rest/items/ZwaveDevice HTTP/1.1” 201 0
107.1.136.3 - - [18/Jan/2016:01:13:53 +0000] “POST /rest/items/ZwaveDevice HTTP/1.1” 201 0
107.1.136.3 - - [18/Jan/2016:01:13:54 +0000] “POST /rest/items/ZwaveDevice HTTP/1.1” 201 0
107.1.136.3 - - [18/Jan/2016:01:13:55 +0000] “POST /rest/items/ZwaveDevice HTTP/1.1” 201 0

The PiLEDs work, they are switches turn LED’s on or off on another Rpi client mqtt.

The ZwaveDevice is the one that is not working

Hi Travis,

First: the logfile from openhab ist the openhab.log.

The razberry board is not recognize as a serial device by OH. So you have to add the

-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0

in the java start parameter line (start.sh or start.bat or service openhab). Just after -Dosgi.noShutdown=true otherwize it will not work either. If you have other serial devices to use with OH you can add them with a “:”

e.g.: -Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0:/dev/ttyUSB0

BR
Hubertus

wow thank you so much, that worked!

something of note in my runtime I am seeing this:

2016-01-18 16:39:05.015 [INFO ] [b.z.i.protocol.ZWaveController] - Connecting to serial port /dev/ttyAMA0
RXTX fhs_lock() Error: opening lock file: /var/lock/LCK…ttyAMA0: File exists. ▒d/ttyAMA0 testRead() Lock file failed
RXTX fhs_lock() Error: opening lock file: /var/lock/LCK…ttyAMA0: File exists.
i▒d/ttyAMA0 testRead() Lock file failed
RXTX fhs_lock() Error: opening lock file: /var/lock/LCK…ttyAMA0: File exists.
i▒d/ttyAMA0 testRead() Lock file failed
2016-01-18 16:39:05.109 [ERROR] [b.z.i.protocol.ZWaveController] - Serial Error: Port /dev/ttyAMA0 does not exist

Could this mean there is something wrong (even though adding that line to start.sh solved my problem)?

Thanks so much Hubertus and Rich!

Those errors look like something else is running which has locked that port. I would recommend rebooting and trying again. If it still has the error I would make sure you don’t have any other software running which might be using that socket. It is possible that the z-wave-server software either keeps something running in the background or it does not clean up after itself very well when you shut it down.

Yes, it looks like …

stop z-way-server:

service z-way-server stop

and disable it:

update-rc.d z-way-server disable

then reboot your system

After updating the z-way-server you must disable it again :wink:

My z-way server doesn’t run unless I manually start it, this is because openhab cannot control the z-way devices if the z-way server is running.

In order to start and stop the z-way-server I runt these:
sudo /etc/init.d/z-way-server stop
sudo /etc/init.d/z-way-server start

I did the
update-rc.d z-way-server disable

and got this result:
pi@raspberrypi ~ $ sudo update-rc.d z-way-server disable
update-rc.d: using dependency based boot sequencing
insserv: warning: current start runlevel(s) (empty) of script z-way-server' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of scriptz-way-server’ overrides LSB defaults (0 1 6).

Like I said before, the z-wave device works along with my mosquitto server so everything is working, its just the runtime shows those errors, which maybe are just fine?