Here are some ideas when using openHAB 2.5.0-SNAPSHOT:
Properly configure the serial port
Make sure you have sufficient permissions to access the serial port. On Linux you need to be in the right group (usually dialout).
See also: Serial Port Configuration.
If you’re using udev rules to create (non-standard) aliases for serial ports you need to add these to the
-Dgnu.io.rxtx.SerialPorts= list. That’s because the serial library (nrjavaserial) cannot assume each and every file in
/dev/ is a serial port.
It’s depending on the OS/distribution which files are considered for serial ports. You can find this logic in RXTXCommDriver.java.
Make sure the serial transport is installed
If you’re adding your binding JAR to an existing openHAB instance, make sure the serial transport is installed.
You can check if it is installed on the Karaf Console as follows:
openhab> bundle:list -s | grep serial
209 │ Active │ 80 │ 3.15.0.OH2 │ com.neuronrobotics.nrjavaserial
211 │ Active │ 80 │ 184.108.40.206906040317 │ org.openhab.core.io.transport.serial
212 │ Active │ 80 │ 220.127.116.11906040321 │ org.openhab.core.io.transport.serial.rxtx
If these are not there, install them using:
You can also install them by installing an existing binding with these dependencies.
E.g. on 2.5.0-SNAPSHOT:
DSMR, EnOcean, PowerMax, RFXCom, Serial Button, Smartmeter, Plugwise, ZWave
Make sure the serial transports are part of the “Run Requirements” when debugging with Eclipse
Besides adding your binding bundle, the
org.openhab.core.io.transport.serial.rxtx bundles need to be added to the “Run Requirements” of app.bndrun:
Then click “Resolve”, save the file and “Debug OSGi”.
If you’re using a non-standard serial port name (udev rules) you’ll probably need to setup the environment variable for these in the app.bndrun "Run Configuration ", e.g. right click app.bndrun and select “Debug As” -> “Debug Configurations…”: