RFXcom on OH2

Hi

I am trying to install the rfxtrx433e on openhab2
I plug in the USB in my RPI3, and waited 5min, but I cant see the rfx in the inbox.
do i need to install som driver?

Can someone help install the rfxcom on OH2,

I’m using the CUL-stick, however it should be the same for your RFXcom. This device will not get autodetected by OpenHAB, it should however be already detected by your system. You need to find the device-address of it (in my case its under /dev/ttyACMO, y.our migth be different). The config of your binding needs this adress.

This is related to the serial drivers. Openhab uses some default java ones. Rfxcom has already been bound to the fsb drivers. Search the forum for more info.

If you define the device as a bridge in a things file and not use auto discovery it should work. The connected devices can be auto discovers through the inbox in paper UI.

So do i need to use the binding from 1.x and type in the USB port? Or is there a way to tell the OH2 bindings what port name to look for the rfxcom

How do I find out the USB port name the rfxcom is connected to?

You can use the 2.0 binding without issues.

If you are on Linux use

ls -la /dev/*USB*

It probably is something like /dev/ttyUSB0

More info in the docs

http://docs.openhab.org/addons/bindings/rfxcom/readme.html

Do I need to use th bridge function?
Then a connect the rfxcom to my USB on my rpi, nothing happens, should it pop up in inbox and say I found a Rfxcom?

As said. After you connect the rfxcom to your RPi you should define a bridge thing in OH2 using the devices serial port. If you do this properly the rf devices will automatically pop up in the inbox. Or you can define those manually as well.

I tryed to go to inbox, and it finds the RFXcom,with this serialport A1R3ODL
but it is offline in things

I then tryed to change the port to /dev/ttyUSB0 but with the same issue

i tryed to add it in .things with this line:
Bridge rfxcom:bridge:usb0 [ serialPort="/dev/ttyUSB0" ]

(I found the USB port with command ls -la /dev/USB )

It shows in things in the PapirUI but still as offline

in the OH2 Log it shows this:

13:21:47.407 [INFO ] [smarthome.event.InboxRemovedEvent ] - Discovery Result with UID ‘rfxcom:RFXtrx433:A1R3ODL’ has been removed.

13:21:47.423 [INFO ] [smarthome.event.ThingAddedEvent ] - Thing ‘rfxcom:RFXtrx433:A1R3ODL’ has been added.

13:21:47.453 [INFO ] [me.event.ThingStatusInfoChangedEvent] - ‘rfxcom:RFXtrx433:A1R3ODL’ changed from UNINITIALIZED to INITIALIZING

13:21:47.460 [INFO ] [me.event.ThingStatusInfoChangedEvent] - ‘rfxcom:RFXtrx433:A1R3ODL’ changed from INITIALIZING to OFFLINE

13:21:47.460 [INFO ] [ernal.connector.RFXComJD2XXConnector] - Connecting to RFXCOM device ‘A1R3ODL’ using JD2XX.

13:21:47.470 [ERROR] [g.rfxcom.handler.RFXComBridgeHandler] - Connection to RFXCOM transceiver failed, reason: device not opened (3)

13:21:47.471 [INFO ] [g.rfxcom.handler.RFXComBridgeHandler] - Automatically Discovered RFXCOM bridges use FTDI chip driver (D2XX). Reason for this error normally is related to operating system native FTDI drivers, which prevent D2XX driver to open device. To solve this problem, uninstall OS FTDI native drivers or add manually universal bridge ‘RFXCOM USB Transceiver’, which use normal serial port driver rather than D2XX.

Have you deleted the auto discovered bridge from paper UI?

Yes,
When a tried .thinks a delete the auto discovered device

And when a tried the discover funktion nothing was typed in the .thinges file.

It is saying:
Connection to RFXCOM transceiver failed, reason: device not opened (3),
I don’t know why the device won’t open?

I know the USB cable on the RFXcom can be a bit dodgy, is it definitely seated? Also I think on a Raspberry Pi the USB port gets called AMC or something. Run this to get the exact name:

dmesg | grep -i ftdi

i get this return

[ 5.735306] usbcore: registered new interface driver ftdi_sio
[ 5.737134] usbserial: USB Serial support registered for FTDI USB Serial Device
[ 5.738093] ftdi_sio 1-1.2:1.0: FTDI USB Serial Device converter detected
[ 5.739770] usb 1-1.2: FTDI USB Serial Device converter now attached to ttyUSB0

So I think it is port ttyUSB0 ?

It stills saying:
Connection to RFXCOM transceiver failed, reason: device not opened (3)

As long as you now know the USB port for certain, and you don’t see it connecting and disconnecting in your dmesg (not in openhab), can you type :

sudo -u <name of user openhab is running under> groups

and then:

ls -al /dev/ttyUSB0

you should have the same group listed in both outputs (on ubuntu it’s dialout), if not, you need to add the group that own the ttyUSB0 to the openhab user like so:

sudo usermod -aG <name of group that owns /dev/ttyUSB0>  <name of user openhab is running under>

Then restart the openhab service:

sudo service openhab restart

See what that does.

you can also test the ttyUSB0 connection by stopping openhab and typing:

sudo cat /dev/ttyUSB0

and pressing some buttons on RFX devices and seeing if there is any output

I Get this out:

root@raspberrypi:~# sudo -u root groups
root tty dialout

root@raspberrypi:~# ls -al /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Jan 16 20:05 /dev/ttyUSB0

Nothing happens when a run this command:
sudo cat /dev/ttyUSB0
and when I press some buttons on RFX devices nothing is displayed

How to i see the user OH is running under? is it the user i am login as when OH starts?
I am logging in as root

How do i see who owns the ttyUSB0?

I have tested the RFXcom in a windows pc with rfxmngr and it works fine!

i Have tryed to install OH1.8, here I get something in the debug log:

21:05:18.214 [DEBUG] [.b.r.internal.RFXComConnection:146 ] - Data received:
Raw data = 091300174CD55C020E70

  • Packet type = LIGHTING4
  • Seq number = 23
  • Sub type = PT2262
  • Id = 5035269
  • Command = UNKNOWN
  • Pulse = 526

I run the OH1 on the same RPI under user root, (like OH2).
I can not get it working on this ether, do you know why my command is UNKNOWN ??

Yes because it’s not completely correctly implemented in openHAB 1 and there is some uncertainty about what is correct implementation for OH2 should be, see

https://community.openhab.org/t/rfxcom-cheap-pir-sensor-binding-in-openhab2/