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 - #576 by ThomDietrich - you do not need to do anything else!
On any other Raspbian system you will have to do the following:
- Execute
adduser openhab dialoutandadduser openhab tty - Remove the serial console and login shell from
/boot/cmdline.txtand/etc/inittabas 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.