Serial port /dev/ttyAMA0 does not exist

What to do when OpenHAB 2 doesn't find the RaZberry right away
September 21, 2016
openhab razberry

Configuring the Z-Wave binding on my Pi for OpenHAB2 gives the annoying error of “Serial Error: Port /dev/ttyAMA0 does not exist” and leaves the Thing in an Uninitialized state.

According to this post the solution is to tell Karaf about the serial port by editing /etc/default/openhab2 as follows:

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

After restarting OpenHAB, it found the controller:

2016-09-21 12:34:20.999 [INFO ] [ing.zwave.handler.ZWaveSerialHandler] - Connecting to serial port '/dev/ttyAMA0'
2016-09-21 12:34:21.095 [INFO ] [ing.zwave.handler.ZWaveSerialHandler] - Serial port is initialized
2016-09-21 12:34:21.112 [INFO ] [mmandclass.ZWaveSecurityCommandClass] - Update networkKey
2016-09-21 12:34:21.163 [INFO ] [ve.internal.protocol.ZWaveController] - Starting ZWave controller
2016-09-21 12:34:21.165 [INFO ] [ve.internal.protocol.ZWaveController] - ZWave timeout is set to 5000ms. Soft reset is false.
2016-09-21 12:34:24.487 [INFO ] [age.SerialApiGetInitDataMessageClass] - NODE 1: Node found
2016-09-21 12:34:24.490 [INFO ] [age.SerialApiGetInitDataMessageClass] - ZWave Controller using Controller API
2016-09-21 12:34:24.492 [INFO ] [age.SerialApiGetInitDataMessageClass] - ZWave Controller is Primary Controller