OpenHAB2 + Razberry + Z-Wave Binding

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

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

  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)

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

Yes I got it working.
But I forgot that I had to

  1. install librxtx-java
  2. add /usr/lib/jni als java Library path to the JAVA_OPTS in setenv
  3. add /dev/ttyAMA0 as serial line to JAVA_OPTS as well

I write a better tutorial when I have time and direct access to my raspberry pi.

Good luck,

Frerk

Please do not edit the setenv file. It will be overwritten on upgrades!

As you can find out in the documentation, there is an extra file intended for these changes:
http://docs.openhab.org/installation/linux.html#privileges-for-common-peripherals


Regarding the Razberry and openHABian: There is a menu entry in openhabian-config: openHABian hassle-free openHAB Setup - you do not need to do anything else!


On any other Raspbian system you will have to do the following:

  • Execute adduser openhab dialout and adduser openhab tty
  • Remove the serial console and login shell from /boot/cmdline.txt and /etc/inittab as shown here and here
  • Enable the serial port by adding “enable_uart=1” to /boot/config.txt
  • Disable Bluetooth on the RPi3 by adding “dtoverlay=pi3-miniuart-bt” to /boot/config.txt
  • Add to file /etc/default/openhab2:
EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyAMA0"

Afterwards you just need to add the appropriate serial port to your ZWave binding.

A discussion regarding the details can be found here.

4 Likes

Thank you very much for your support.

It is very clear for me and another Beginners.

Thanks again

1 Like

Hi Thom,

i am here again because of my problem after updating the lastest Openhab 2 on Openhabian.

After updating Openhab2, the Razberry on RPI 3 is offline, it said that the serial port /dev/ttyAMA0 is in used.
i tried to do like you said with using openhabian-config but it is not successful.
i controlled all files (config.txt, cmdline.txt…) again, and they are same like you worte.
i tried many times to restart the system, but not yet succesful.

i don’t know why???

in addition i can not connect to wifi with openhabian? can you give me a tutorial?

Thanks in advance,

QT. Tran