Problems with Razberry board on an Raspberry pi

Hi all,

I’ve tried to read up on the connection problems other people are having with the Razberry Z-wave controller and in a Raspberry Pi mod B+. The log file shows this:

2015-12-15 18:38:38.739 [INFO ] [.z.internal.ZWaveActiveBinding] - Update config, port = /dev/ttyAMA0
2015-12-15 18:38:38.769 [INFO ] [.z.internal.ZWaveActiveBinding] - Update config, healtime = 2
2015-12-15 18:38:38.773 [INFO ] [.service.AbstractActiveService] - ZWave Refresh Service has been started
2015-12-15 18:38:38.869 [INFO ] [b.z.i.protocol.ZWaveController] - Starting Z-Wave controller
2015-12-15 18:38:38.871 [INFO ] [b.z.i.protocol.ZWaveController] - Z-Wave timeout is set to 5000ms. Soft reset is false.
2015-12-15 18:38:38.872 [INFO ] [b.z.i.protocol.ZWaveController] - Connecting to serial port /dev/ttyAMA0
2015-12-15 18:38:38.970 [ERROR] [b.z.i.protocol.ZWaveController] - Serial Error: Port /dev/ttyAMA0 does not exist
2015-12-15 18:38:43.775 [INFO ] [.service.AbstractActiveService] - ZWave Refresh Service has been shut down

Now, this is my device:

$ ls -al /dev/ttyAMA0 
crwxrwxrwx 1 root dialout 204, 64 Dec 15 18:10 /dev/ttyAMA0

and I have added information on the port both in the startup script:

JAVA_ARGS_DEFAULT="-Dosgi.clean=true \
 -Declipse.ignoreApp=true \
 -Dosgi.noShutdown=true \
 -Djetty.port=${HTTP_PORT} \
 -Dopenhab.configfile="${OPENHAB_CONF_DIR}/configurations/openhab.cfg" \
 -Dopenhab.configdir="${OPENHAB_CONF_DIR}/configurations" \
 -Dopenhab.logdir="${OPENHAB_LOG_DIR}" \
 -Dsmarthome.userdata="${OPENHAB_USER_DATA_DIR}"
 -Djetty.home="${OPENHAB_DIR}" \
 -Djetty.port.ssl=${HTTPS_PORT} \
 -Djetty.config="${OPENHAB_CONF_DIR}/jetty" \
 -Djetty.logs="${OPENHAB_LOG_DIR}" \
 -Djetty.rundir="${OPENHAB_DIR}" \
 -Dfelix.fileinstall.dir="${OPENHAB_DIR}/addons" \
 -Dfelix.fileinstall.filter=.*\\.jar \
 -Djava.library.path="${OPENHAB_DIR}/lib" \
 -Djava.security.auth.login.config="${OPENHAB_CONF_DIR}/login.conf" \
 -Dorg.quartz.properties="${OPENHAB_CONF_DIR}/quartz.properties" \
 -Dequinox.ds.block_timeout=240000 \
 -Dequinox.scr.waitTimeOnBlock=60000 \
 -Dfelix.fileinstall.active.level=4 \
 -Djava.awt.headless=true \
 -jar ${LAUNCHER} \
 -configuration ${OPENHAB_WORKSPACE_DIR} \
 -data ${OPENHAB_WORKSPACE_DIR} \
 -Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0 \
 -console ${TELNET_PORT}" 

and in the openhab.cfg file:

################################ Z-Wave  Binding ######################################
zwave:port=/dev/ttyAMA0
zwave:healtime=2

I’m running out of things to try now. Please advice.

Fredrik

Not sure about Razberry, but for z-sticks etc you have to add your openhab user to the dialout group to access the /dev/ttyAMA0 (et al) port.

Hi,

Thank you for all suggestions. It seems that what you need to do is to add the line

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

to not (only) the /etc/init.d/openhab file, but also in the

/usr/share/openhab/bin/openhab.sh

file. When added to both files (so that the relevant part of the file looks like this:

JAVA_ARGS_DEFAULT="-Dosgi.clean=true \
 -Declipse.ignoreApp=true \
 -Dosgi.noShutdown=true \
 -Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0 \
(file continues here of course)

then it works perfectly.

Hope this will help someone else in the future. I’ve now got the port specified both in the openhab.cfg file, the init.d startup script and the file in /usr/share/openhab/bin. Then it works. Perhaps you can remove one or two of these specifikations, but I will keep them all just in case.

Fredrik

2 Likes