Unable to connect to RFXCOM

Unfortunately I had to re-install my openHAB machine (the SD-card of the RPi got corrupted).
Using Raspbian Jessie and OH 1.7.1 through apt-get

I have added the SYMLINK to be able to use /dev/USBrfxcom and have tested the device with rfxcmd.

$ ls -l /dev/*USB*
crw-rw-rw- 1 root dialout 188, 0 Oct 11 07:26 /dev/ttyUSB0
lrwxrwxrwx 1 root root         7 Oct 10 20:39 /dev/USBrfxcom -> ttyUSB0

I have already added the openhab user to the dial out group:

$ sudo usermod -a -G dialout openhab

I also changed ownership of the symlink:

$ sudo chown root:dialout /dev/USBrfxcom

This is an excerpt from the /etc/init.d/openhab file:

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 \
 -Dgnu.io.rxtx.SerialPorts=/dev/USBrfxcom \
 -Djava.awt.headless=true \
 -jar ${LAUNCHER} \
 -configuration ${OPENHAB_WORKSPACE_DIR} \
 -data ${OPENHAB_WORKSPACE_DIR} \
 -console ${TELNET_PORT}"

This is my openhab.cfg

################################ RFXCOM Binding #######################################
#
# Serial port of RFXCOM interface
# Valid values are e.g. COM1 for Windows and /dev/ttyS0 or /dev/ttyUSB0 for Linux
rfxcom:serialPort=/dev/USBrfxcom

However, I am unable to connect to the device. See excerpt from the logs below.

2015-10-11 07:29:22.709 [INFO ] [.b.r.internal.RFXComConnection] - Connecting to RFXCOM [serialPort='/dev/USBrfxcom' ].
2015-10-11 07:29:22.846 [ERROR] [.b.r.internal.RFXComConnection] - Connection to RFXCOM controller failed.
gnu.io.NoSuchPortException: null
	at gnu.io.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:273) ~[na:na]
	at org.openhab.binding.rfxcom.internal.connector.RFXComSerialConnector.connect(RFXComSerialConnector.java:60) ~[na:na]
	at org.openhab.binding.rfxcom.internal.RFXComConnection.connect(RFXComConnection.java:118) ~[na:na]
	at org.openhab.binding.rfxcom.internal.RFXComConnection.updated(RFXComConnection.java:103) ~[na:na]
	at org.eclipse.equinox.internal.cm.ManagedServiceTracker$1.run(ManagedServiceTracker.java:183) [org.eclipse.equinox.cm_1.0.400.v20120522-1841.jar:na]
	at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36) [org.eclipse.equinox.cm_1.0.400.v20120522-1841.jar:na]

I assume this has something to do with permissions, but I’m not sure why, where and how.

Could anyone help out?

Thanks in advance.

In a fit of madness, I tried to access the port /dev/ttyUSB0 directly, and that succeeded.

This is weird, since RFXCMD does work with the symlink.

My hunch that it is related to permissions still stands. I will continue investigating, but appreciate any help.

Did you manage to solve this?
I had the same problem and I believe it is due to the instructions in the wiki not working well on Debian/Rasbian Jessie.
You need to put your JAVA_ARGS in the file /etc/default/openhab
Like this:
JAVA_ARGS="-Dgnu.io.rxtx.SerialPorts=/dev/USBrfxcom"

At least that is what made it work for me.
Hope this helps.

If you can confirm this someone need to clarify this on the wiki pages:


and

1 Like

I have the same issue after upgrading to 1.8, it was working in 1.7.1. Just using ttyUSB0 now but it doesn’t feel like a permanent solution.