Cant get RFXCom to work?

Hi im having problems getting my RFXCom to work with OpenHAB, i know it works as i managed to detect a few signals while using it on windows.
My current setup is Windows 10 -> VirtualBox -> Debian8
OpenHAB is upp and running and i have installed the RFXCom binding, i have also manually added a RFXCom as a Thing with /dev/ttyUSB0 as serial number but its offline no matter what i do.

I have also verified that /dev/ttyUSB0 exists on the system with ls -l /dev/ttyUSB0
I have also run usermod -a -G dialout but this gives no output so i have no idea if it made any changes or not.
And i have run chmod 777 /dev/ttyUSB0.

Does any one know whats wrong?

Here is the log when im doing the scan:

19:31:39.267 [DEBUG] [rnal.discovery.RFXComBridgeDiscovery] - Start discovery scan for RFXCOM transceivers
19:31:39.269 [DEBUG] [rnal.discovery.RFXComBridgeDiscovery] - Discovering RFXCOM transceiver devices by JD2XX version 65810
19:31:39.290 [ERROR] [rnal.discovery.RFXComBridgeDiscovery] - Error occurred during discovery
java.io.IOException: device not found (2)
at jd2xx.JD2XX.listDevices(Native Method)
at jd2xx.JD2XX.listDevicesByDescription(JD2XX.java:826)
at org.openhab.binding.rfxcom.internal.discovery.RFXComBridgeDiscovery.discoverRfxcom(RFXComBridgeDiscovery.java:90)
at org.openhab.binding.rfxcom.internal.discovery.RFXComBridgeDiscovery.startScan(RFXComBridgeDiscovery.java:67)
at org.eclipse.smarthome.config.discovery.AbstractDiscoveryService.startScan(AbstractDiscoveryService.java:199)
at org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl.startScan(DiscoveryServiceRegistryImpl.java:382)
at org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl.startScans(DiscoveryServiceRegistryImpl.java:358)
at org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl.startScan(DiscoveryServiceRegistryImpl.java:216)
at org.eclipse.smarthome.io.rest.core.discovery.DiscoveryResource.scan(DiscoveryResource.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_121]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_121]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_121]
at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_121]
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)[157:org.glassfish.jersey.core.jersey-common:2.22.2]
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)[158:org.glassfish.jersey.core.jersey-server:2.22.2]
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)[155:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service(ServletContainerBridge.java:76)[10:com.eclipsesource.jaxrs.publisher:5.3.1.201602281253]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[81:org.eclipse.jetty.servlet:9.2.19.v20160908]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)[81:org.eclipse.jetty.servlet:9.2.19.v20160908]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)[172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[79:org.eclipse.jetty.security:9.2.19.v20160908]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)[172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[81:org.eclipse.jetty.servlet:9.2.19.v20160908]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.Server.handle(Server.java:499)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)[72:org.eclipse.jetty.io:9.2.19.v20160908]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[83:org.eclipse.jetty.util:9.2.19.v20160908]
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[83:org.eclipse.jetty.util:9.2.19.v20160908]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
19:31:40.627 [DEBUG] [g.rfxcom.handler.RFXComBridgeHandler] - Checking RFXCOM transceiver connection, thing status = OFFLINE
19:31:40.628 [DEBUG] [g.rfxcom.handler.RFXComBridgeHandler] - Connecting to RFXCOM transceiver
19:31:40.628 [DEBUG] [ernal.connector.RFXComJD2XXConnector] - Disconnecting
19:31:40.628 [DEBUG] [ernal.connector.RFXComJD2XXConnector] - Close serial port
19:31:40.628 [DEBUG] [ernal.connector.RFXComJD2XXConnector] - Closed
19:31:40.629 [INFO ] [ernal.connector.RFXComJD2XXConnector] - Connecting to RFXCOM device '/dev/ttyUSB0' using JD2XX.
19:31:40.638 [ERROR] [g.rfxcom.handler.RFXComBridgeHandler] - Connection to RFXCOM transceiver failed, reason: device not found (2)

Try editing /etc/default/openhab2 and set the following:
EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyAMA0"

Then restart OH2…

1 Like

Had the same problem. Added the bridge in a things-file instead (with port defined instead of serial nr). Worked out well.

Same errors in the log file even with those changes.

Could you give me some pointers what i need to add to get it working?

I placed a rfxtrx.things file in /etc/openhab2/things/ and the content:

Bridge rfxcom:bridge:usb0 [ serialPort="/dev/ttyUSB0" ]

Thanks i think that did it, its online now at least!!

Sorry for jumping in.
I’m still stuck with the RFXtrx433E…

I added the openhab user into the dialout group (and rebooted the RPi).
I edited the /etc/default/openhab2 file to add the EXTRA_JAVA_OPTS configuration (and rebooted the RPi).
I created the rfxtrx.things file as described 2 comments ago (and rebooted the RPi).
During the boot process I see the RFXtrx433E flashing both leds, so some initialising is happening.
Anyway, I still get the famous two log lines every minute:

2017-02-25 16:34:04.822 [INFO ] [ernal.connector.RFXComJD2XXConnector] - Connecting to RFXCOM device ‘/dev/ttyUSB0’ using JD2XX.
2017-02-25 16:34:04.830 [ERROR] [g.rfxcom.handler.RFXComBridgeHandler] - Connection to RFXCOM transceiver failed, reason: device not found (2)

I’m still fairly new to openHAB, so I’m severely struggling here…
What am I missing?
Any guidance is welcome! :slight_smile:

Cheers,
Robert.

update
Finally success!
After the above changes, and running the next command I have a new Thing in the Paper UI Inbox:
sudo chmod 660 /dev/ttyUSB0

I’m having the same problem.
I tried all of the above, but still the same problem

Connection to RFXCOM transceiver failed gnu.io.NoSuchPortException: null

It used to work but was pretty unstable, have to restart the rfxcom binding sometimes. Now it stoped working alltogether.
Any idea’s how to troubleshoot futher ?

Hi Stefaan,

Recently I replaced by old OH2.x RPi (Jessie) with a new RPi (Stretch), so that I had to follow my old notes again. Hmm, wasn’t easy (e.g. OH problems with audio out via OH internal commands, and Linux problems after router restart, which worked fine with Jessie). But the RFX bit worked, so here are the instructions that I saved in a text file:

  1. Run the following command:
    sudo gpasswd -a openhab dialout
  2. Run the following command:
    sudo chmod 660 /dev/ttyUSB0
  3. Edit /etc/default/openhab2 and set the following, then restart OH2:
    EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyAMA0"
  4. Place a rfxtrx.things file in /etc/openhab2/things/ with the following content:
    Bridge rfxcom:bridge:usb0 [ serialPort="/dev/ttyUSB0" ]
  5. Wait one minute, a new Thing should be discovered.
  6. E.g. for KlikaanKlikuit: Start pressing on the KAKU remote control to individually discover each lamp. If you have an Internet Control Station: toggle your lamp via the remote app on your phone, so that these codes are also known in OH.

I hope this helps! :grinning:

Regards,
Robert.

2 Likes

Oops I tried this with OH3, because my rfxcom discovered one item and not more.
But now I messed it up. Can I undo the chmod action to revert everything back again?

EDIT
I changed the settings of the bindings RFXcom and Smartmeter Usb0 and Usb1. Now all is back online

Thx

Hi Koen,

Yeah, that’s a bit of guess work.
After I replaced my RPi 3B by an RPi 4 I made very sure that I used the same ports. :wink:

Regards,
Robert.