RFXCom symlink doesn't work

Hi all,

I need some help regarding the symlink in combination with the RFXCom binding. Symlinks are needed since I use 3 USB devices at the moment and more could be coming.

I am running openHab 1.8.3 on a raspberry pi with the raspbian distribution.

I followed all the steps pointed out in the wiki instructions:
create a symlink in the /etc/udev/rules.d/ directory:

pi@DomoticServer:/etc/udev/rules.d $ ls -al
totaal 24
drwxr-xr-x 2 root root 4096 dec 19 19:42 .
drwxr-xr-x 4 root root 4096 nov 25 18:21 …
-rw-r–r-- 1 root root 151 dec 19 19:42 50-usb-serial.rules
-rw-r–r-- 1 root root 153 dec 19 19:43 51-usb-serial.rules
-rw-r–r-- 1 root root 153 dec 19 19:43 52-usb-serial.rules
-rw-r–r-- 1 root root 983 mrt 21 2016 99-com.rules

content of the 50-usb-serial.rules:
SUBSYSTEM==“tty”, ATTRS{idVendor}==“0403”, ATTRS{product}==“RFXtrx433”, ATTRS{serial}==“A1Z7F1QV”, SYMLINK+=“USBrfxcom”, GROUP=“dialout”, MODE=“0666”

This creates the symlink in the /dev directory:
pi@DomoticServer:/dev $ ls -al USBrfxcom
lrwxrwxrwx 1 root root 7 dec 19 20:32 USBrfxcom -> ttyUSB1
pi@DomoticServer:/dev $ ls -al ttyUSB1
crw-rw-rw- 1 root dialout 188, 1 dec 19 21:19 ttyUSB1

Then I added the symlink to the openhab file /etc/init.d/openhab


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

Restarting Openhab however results in:

2016-12-21 09:38:00.814 [DEBUG] [o.b.r.internal.RFXComActivator] - RFXCOM binding has been started.
2016-12-21 09:38:00.889 [DEBUG] [.b.r.internal.RFXComConnection] - Activate
2016-12-21 09:38:00.895 [DEBUG] [.b.r.internal.RFXComConnection] - Configuration updated, config true
2016-12-21 09:38:00.901 [INFO ] [.b.r.internal.RFXComConnection] - Connecting to RFXCOM [serialPort=’/dev/serial/by-id/usb-RFXCOM_RFXtrx433_A1Z7F1QV-if00-port0’ ].
2016-12-21 09:38:03.143 [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:115) ~[na:na]
at org.openhab.binding.rfxcom.internal.RFXComConnection.updated(RFXComConnection.java:100) ~[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]

The connection fails (changing to ttyUSB1 does work however).

What could be wrong?

Many thanks for all you suggestions and help.

I see I copied the wrong logging in. The right one is:

2016-12-21 10:08:05.867 [DEBUG] [o.b.r.internal.RFXComActivator] - RFXCOM binding has been started.
2016-12-21 10:08:05.947 [DEBUG] [.b.r.internal.RFXComConnection] - Activate
2016-12-21 10:08:05.953 [DEBUG] [.b.r.internal.RFXComConnection] - Configuration updated, config true
2016-12-21 10:08:05.956 [INFO ] [.b.r.internal.RFXComConnection] - Connecting to RFXCOM [serialPort=’/dev/USBrfxcom’ ].
2016-12-21 10:08:06.038 [DEBUG] [.rfxcom.internal.RFXComBinding] - Activate
2016-12-21 10:08:06.119 [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:115) ~[na:na]
at org.openhab.binding.rfxcom.internal.RFXComConnection.updated(RFXComConnection.java:100) ~[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.v20

What am I missing? Thx for your help.

You might override the property this way, I use : to separate them:

JAVA_ARGS=-Dgnu.io.rxtx.SerialPorts=/dev/USBrfxcom:/dev/ttyACM0:/dev/USBzwave:/dev/ttyUSB1:/dev/USBp1

See also the example at: https://github.com/openhab/openhab/wiki/symlinks

I installed my version via apt-get so I changed it in /etc/default/openhab

Hi, thx for the response. I changed it (also did the apt-get install) and is working right now. Don’t know why, but kept overlooking that 1 line in the instructions.