Hi, I have an RFXtrx433E device connected to openHAB2 which used to work fine until my server (Ubuntu 18.04) restarted because of a power outage. Below is the troubleshooting I’ve tried so far. I also have a mysensors gateway connected to same openHAB instance over serial (/dev/ttyACM0, renamed to /dev/ttyMySensors) which continues to work fine.
I get this error message in the Karaf logs
12:05:02.883 [ERROR] [ng.rfxcom.handler.RFXComBridgeHandler] - Connection to RFXCOM transceiver failed
gnu.io.NoSuchPortException: null
at gnu.io.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:273) ~[?:?]
at org.openhab.binding.rfxcom.internal.connector.RFXComSerialConnector.connect(RFXComSerialConnector.java:46) ~[?:?]
at org.openhab.binding.rfxcom.handler.RFXComBridgeHandler.connect(RFXComBridgeHandler.java:175) ~[?:?]
at org.openhab.binding.rfxcom.handler.RFXComBridgeHandler.lambda$0(RFXComBridgeHandler.java:149) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
Troubleshooting so far
Here’s all this things I tried/checked so far
Checked the hardware
- I connected the RFXcom device to my windows PC an checked it with RFXmgr. This work fine.
- Still on the windows PC, checked the output of the device with putty at 38400-8-N-1. I see gibberish on the screen but guess that’s OK because the RFXcom sends out binary codes
On the Ubuntu server
- Verified the tty port with
dmesg | grep tty
to ensure myself of the port name :ttyUSB0
- Used minicom with the 38400-8-N-1 settings on
/dev/ttyUSB0
. I get the same kind of gibberish, so assume the device is sending messages all right. - Went over the openHAB Serial Port Configuration page
- Checked the Java
EXTRA_JAVA_OPTS
in/etc/default/openhab2
. These areEXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyMySensors"
, which should be OK. - Check if the
openhab
user belongs to the dialout group :$ groups openhab
==>openhab : openhab tty dialout
OK - Removed the alias name which I had set up (because it doesn’t solve my problem and the port is always ttyUSB0 after a reboot anyway). Here’s the content of my
/etc/udev/rules.d/10-local.rules
file
- Checked the Java
$ cat /etc/udev/rules.d/10-local.rules
SUBSYSTEM=="tty", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="6949", SYMLINK+="ttyMySensors", GROUP="dialout", MODE="0666"
- Restarted openhab with
sudo systemctl restart openhab2.service
- Checked the output of
udevadm info
(content way below) - Restarted the rfxcom bundle in karaf:
bundle:restart 217
- The content of my
rfxcom.things
file is
Bridge rfxcom:bridge:rfxcom [ serialPort="/dev/ttyUSB0", setMode="0D00000303531C02002400000000" ]
{
temperaturehumidity bureau_temperatuur [ deviceId="5377", subType="TH1"]
temperature buiten_gevelZuid_temperatuur [ deviceId="20225", subType="TEMP2"]
temperaturehumidity buiten_gevelNoord_temperatuur [ deviceId="33796", subType="TH1"]
temperaturehumidity badkamer_temperatuur [ deviceId="62212", subType="TH1"]
temperaturehumidity garage_temperatuur [ deviceId="2049", subType="TH11"]
temperaturehumidity zolder_kamer_temperatuur [ deviceId="24577", subType="TH11"]
temperaturehumidity _china2 [ deviceId="11777", subType="TH13"]
temperaturehumidity slpk_pat [ deviceId="56833", subType="TH13"]
rain regen [ deviceId="16385", subType="RAIN7"]
wind wind [ deviceId="26113", subType="WIND7"]
lighting2 cocoSchakelaar [ deviceId="14830242.10", subType="LIGHTING2"]
lighting2 cocoSlpk3 [ deviceId="26664922.10", subType="LIGHTING2"]
}
Serial drivers in bundle list
Below are the bundles that have ‘serial’ in their name.
openhab> bundle:list | grep -i serial
194 │ Active │ 80 │ 3.14.0 │ nrjavaserial
195 │ Active │ 80 │ 3.15.0.OH2 │ nrjavaserial
202 │ Active │ 80 │ 0.10.0.oh240 │ Eclipse SmartHome Configuration USB-Serial Discovery
203 │ Active │ 80 │ 0.10.0.oh240 │ Eclipse SmartHome Configuration USB-Serial Discovery Linux sysf Scanning
204 │ Active │ 80 │ 0.10.0.oh240 │ Eclipse SmartHome Config Serial
206 │ Active │ 80 │ 0.10.0.oh240 │ Eclipse SmartHome Serial Transport
207 │ Active │ 80 │ 0.10.0.oh240 │ Eclipse SmartHome Serial Transport for RXTX
208 │ Active │ 80 │ 0.10.0.oh240 │ Eclipse SmartHome Serial Transport extension for RXTX RFC2217
Conclusion
Still get the same error message.
Any tips on what I can still check/do ?
$ udevadm info -a -p $(udevadm info -q path -n /dev/ttyUSB0)
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/ttyUSB0/tty/ttyUSB0':
KERNEL=="ttyUSB0"
SUBSYSTEM=="tty"
DRIVER==""
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/ttyUSB0':
KERNELS=="ttyUSB0"
SUBSYSTEMS=="usb-serial"
DRIVERS=="ftdi_sio"
ATTRS{latency_timer}=="16"
ATTRS{port_number}=="0"
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0':
KERNELS=="1-3:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="ftdi_sio"
ATTRS{authorized}=="1"
ATTRS{bAlternateSetting}==" 0"
ATTRS{bInterfaceClass}=="ff"
ATTRS{bInterfaceNumber}=="00"
ATTRS{bInterfaceProtocol}=="ff"
ATTRS{bInterfaceSubClass}=="ff"
ATTRS{bNumEndpoints}=="02"
ATTRS{interface}=="RFXtrx433"
ATTRS{supports_autosuspend}=="1"
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-3':
KERNELS=="1-3"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{authorized}=="1"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{bConfigurationValue}=="1"
ATTRS{bDeviceClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bMaxPacketSize0}=="8"
ATTRS{bMaxPower}=="90mA"
ATTRS{bNumConfigurations}=="1"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bcdDevice}=="0600"
ATTRS{bmAttributes}=="a0"
ATTRS{busnum}=="1"
ATTRS{configuration}==""
ATTRS{devnum}=="11"
ATTRS{devpath}=="3"
ATTRS{idProduct}=="6001"
ATTRS{idVendor}=="0403"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="RFXCOM"
ATTRS{maxchild}=="0"
ATTRS{product}=="RFXtrx433"
ATTRS{quirks}=="0x0"
ATTRS{removable}=="removable"
ATTRS{serial}=="A1BL5PJ"
ATTRS{speed}=="12"
ATTRS{urbnum}=="6430"
ATTRS{version}==" 2.00"
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1':
KERNELS=="usb1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{authorized}=="1"
ATTRS{authorized_default}=="1"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{bConfigurationValue}=="1"
ATTRS{bDeviceClass}=="09"
ATTRS{bDeviceProtocol}=="01"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{bMaxPower}=="0mA"
ATTRS{bNumConfigurations}=="1"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bcdDevice}=="0415"
ATTRS{bmAttributes}=="e0"
ATTRS{busnum}=="1"
ATTRS{configuration}==""
ATTRS{devnum}=="1"
ATTRS{devpath}=="0"
ATTRS{idProduct}=="0002"
ATTRS{idVendor}=="1d6b"
ATTRS{interface_authorized_default}=="1"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="Linux 4.15.0-50-generic xhci-hcd"
ATTRS{maxchild}=="7"
ATTRS{product}=="xHCI Host Controller"
ATTRS{quirks}=="0x0"
ATTRS{removable}=="unknown"
ATTRS{serial}=="0000:00:14.0"
ATTRS{speed}=="480"
ATTRS{urbnum}=="168"
ATTRS{version}==" 2.00"
looking at parent device '/devices/pci0000:00/0000:00:14.0':
KERNELS=="0000:00:14.0"
SUBSYSTEMS=="pci"
DRIVERS=="xhci_hcd"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x0c0330"
ATTRS{consistent_dma_mask_bits}=="64"
ATTRS{d3cold_allowed}=="1"
ATTRS{dbc}=="disabled"
ATTRS{device}=="0x22b5"
ATTRS{dma_mask_bits}=="64"
ATTRS{driver_override}=="(null)"
ATTRS{enable}=="1"
ATTRS{irq}=="115"
ATTRS{local_cpulist}=="0-1"
ATTRS{local_cpus}=="3"
ATTRS{msi_bus}=="1"
ATTRS{numa_node}=="-1"
ATTRS{revision}=="0x21"
ATTRS{subsystem_device}=="0x2060"
ATTRS{subsystem_vendor}=="0x8086"
ATTRS{vendor}=="0x8086"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""