Successfully Configuring RFXCOM with OpenHAB 2.1

After several days of troubleshooting, I finally managed to resolve the issue with RFXCOM crashing OpenHAB 2.1 when reading the .things file. Here’s my journey and the solution that worked for me, in case anyone else is facing a similar challenge.

The Problem

I installed OpenHAB 2.1 on my Raspberry Pi and configured RFXCOM as per the official documentation. However, whenever OpenHAB attempted to read the .things file, it would crash immediately. The logs indicated that the issue was happening right at the point of loading the RFXCOM configuration.

What I Tried

  1. Checked System Compatibility: My system was running Raspbian GNU/Linux 7 (wheezy), and I ensured that all dependencies were up-to-date.
  2. Verified UDEV Rules: The udev rules for the RFXCOM transceiver were correctly set up, and the device was recognized as /dev/USBrfxcom.
  3. Reviewed Configuration Files: I triple-checked the rfxcom.cfg, rfxcom.things, and openhab.log files for any syntax errors or misconfigurations.
  4. Tried Different Bindings: I experimented with both the OH1 and OH2 bindings for RFXCOM, but the issue persisted.

The Solution

The breakthrough came when I realized that the problem might be related to the specific version of Java being used. After some research, I found that OpenHAB 2.1 requires a specific Java version to function correctly with certain bindings. Here’s what I did:

  1. Updated Java: I installed the latest compatible version of Java for OpenHAB 2.1.
  2. Adjusted Java_opts: I modified the EXTRA_JAVA_OPTS in /etc/default/openhab2 to ensure proper communication with the RFXCOM device.
  3. Rebooted System: After making these changes, I rebooted the system to apply the new settings.

Success!

Upon rebooting, OpenHAB loaded the RFXCOM configuration without any issues. The devices were recognized, and I was able to control my lights and dimmers seamlessly. The logs now showed clean startup messages without any errors related to RFXCOM.

Sharing the Fix

For anyone else facing this issue, here are the key steps that resolved the problem for me:

  1. Ensure your Java version is compatible with OpenHAB 2.1.
  2. Check and adjust the EXTRA_JAVA_OPTS in your OpenHAB configuration.
  3. Verify that your udev rules and device permissions are correctly set up.
  4. Reboot your system after making these changes.

It’s a relief to finally have my RFXCOM devices working as intended. This experience taught me the importance of checking Java compatibility and configuration settings when dealing with hardware integrations in OpenHAB.