Serial Binding: Port could not be found


I’m trying to connect an arduino via Serial Protocol(Serialbinding 1.7.1) to openhab 1.7.1, running on raspberry pi (Linux raspberrypi 4.1.6+ #810 PREEMPT Tue Aug 18 15:19:58 BST 2015 armv6l GNU/Linux). But the connection fails with following exception:

Binding configuration of type ‘serial’ of item ‘Arduino‘ could not be parsed correctly.
org.openhab.model.item.binding.BindingConfigParseException: Could not open serial port /dev/ttyUSB0: Serial port ‘/dev/ttyUSB0’ could not be found. Available ports are:

    at org.openhab.binding.serial.internal.SerialBinding.processBindingConfiguration( ~[na:na]
    at org.openhab.model.item.internal.GenericItemProvider.internalDispatchBindings( [org.openhab.model.item_1.7.1.jar:na]
    at org.openhab.model.item.internal.GenericItemProvider.dispatchBindingsPerType( [org.openhab.model.item_1.7.1.jar:na]
    at org.openhab.model.item.internal.GenericItemProvider.addBindingConfigReader( [org.openhab.model.item_1.7.1.jar:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0]
    at sun.reflect.NativeMethodAccessorImpl.invoke( ~[na:1.8.0]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke( ~[na:1.8.0]
    at java.lang.reflect.Method.invoke( ~[na:1.8.0]
    at org.eclipse.equinox.internal.ds.model.ComponentReference.bind( [org.eclipse.equinox.ds_1.4.1.v20120926-201320.jar:na]
    at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bindReference( [org.eclipse.equinox.ds_1.4.1.v20120926-201320.jar:na]
    at org.eclipse.equinox.internal.ds.InstanceProcess.dynamicBind( [org.eclipse.equinox.ds_1.4.1.v20120926-201320.jar:na]
    at org.eclipse.equinox.internal.ds.Resolver.getEligible( [org.eclipse.equinox.ds_1.4.1.v20120926-201320.jar:na]
    at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged( [org.eclipse.equinox.ds_1.4.1.v20120926-201320.jar:na]
    at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged( [org.eclipse.osgi_3.8.2.v20130124-134944.jar:na]
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent( [org.eclipse.osgi_3.8.2.v20130124-134944.jar:na]
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent( [org.eclipse.osgi_3.8.2.v20130124-134944.jar:na]
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous( [org.eclipse.osgi_3.8.2.v20130124-134944.jar:na]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged( [org.eclipse.osgi_3.8.2.v20130124-134944.jar:na]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent( [org.eclipse.osgi_3.8.2.v20130124-134944.jar:na]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register( [org.eclipse.osgi_3.8.2.v20130124-134944.jar:na]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService( [org.eclipse.osgi_3.8.2.v20130124-134944.jar:na]
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService( [org.eclipse.osgi_3.8.2.v20130124-134944.jar:na]
    at org.eclipse.equinox.internal.ds.InstanceProcess.registerService( [org.eclipse.equinox.ds_1.4.1.v20120926-201320.jar:na]
    at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents( [org.eclipse.equinox.ds_1.4.1.v20120926-201320.jar:na]
    at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied( [org.eclipse.equinox.ds_1.4.1.v20120926-201320.jar:na]
    at org.eclipse.equinox.internal.ds.Resolver.enableComponents( [org.eclipse.equinox.ds_1.4.1.v20120926-201320.jar:na]
    at org.eclipse.equinox.internal.ds.SCRManager.performWork( [org.eclipse.equinox.ds_1.4.1.v20120926-201320.jar:na]
    at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch( [org.eclipse.equinox.ds_1.4.1.v20120926-201320.jar:na]
    at [org.eclipse.equinox.ds_1.4.1.v20120926-201320.jar:na]
    at [org.eclipse.equinox.util_1.0.400.v20120917-192807.jar:na]

I already added the java argument to the openhab start script in init.d and openhab/bin/ folder like so:

  # Load the VERBOSE setting and other rcS variables
. /lib/init/

DEBUG_ARGS="-Xdebug \
  -Xnoagent \
  -Djava.compiler=NONE \
  -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=n \

JAVA_ARGS_DEFAULT="-Dosgi.clean=true \
 -Declipse.ignoreApp=true \
 -Dosgi.noShutdown=true \
 -Djetty.port=${HTTP_PORT} \
 -Dopenhab.configfile="${OPENHAB_CONF_DIR}/configurations/openhab.cfg" \
 -Dopenhab.configdir="${OPENHAB_CONF_DIR}/configurations" \
 -Dopenhab.logdir="${OPENHAB_LOG_DIR}" \
 -Djetty.home="${OPENHAB_DIR}" \
 -Djetty.port.ssl=${HTTPS_PORT} \
 -Djetty.config="${OPENHAB_CONF_DIR}/jetty" \
 -Djetty.logs="${OPENHAB_LOG_DIR}" \
 -Djetty.rundir="${OPENHAB_DIR}" \
 -Dfelix.fileinstall.dir="${OPENHAB_DIR}/addons" \
 -Dfelix.fileinstall.filter=.*\\.jar \
 -Djava.library.path="${OPENHAB_DIR}/lib" \"${OPENHAB_CONF_DIR}/login.conf" \"${OPENHAB_CONF_DIR}/" \
 -Dequinox.ds.block_timeout=240000 \
 -Dequinox.scr.waitTimeOnBlock=60000 \\ \
 -Djava.awt.headless=true \
 -jar ${LAUNCHER} \
 -configuration ${OPENHAB_WORKSPACE_DIR} \
 -console ${TELNET_PORT}"

if [ x"${JAVA_ARGS}" != x ]; then

if [ x"${OPENHAB_ARGS}" != x ]; then

if echo ${DEBUG} | grep -qi "^yes$"; then
	JAVA_ARGS_DEFAULT="-Dlogback.configurationFile=${OPENHAB_CONF_DIR}/logback.xml ${JAVA_ARGS_DEFAULT}"

case "$1" in
        log_daemon_msg "Starting $DESC" "$NAME"
		${OPENHAB_INST_DIR}/bin/ > /dev/null
		if start-stop-daemon --start --quiet --pidfile $PIDFILE $EXTRA_ARGS \
			--oknodo --exec $JAVA -- $JAVA_ARGS_DEFAULT
        	log_end_msg 0
        	log_end_msg 1

by the way: which way is right?\ or"/dev/ttyUSB0"
Nevertheless non of these ways worked for me.

items document:

String Arduino "Arduino" { serial="/dev/ttyUSB0@115200" }
Number          livingTemp01                             "Temperatur [%.1f °C]" <temperature> (Temperature,GF_Living)

Accessing to /dev/ttyUSB0, by for example screen, works without any problems.


When I start openhab with the file, it works without any problems.
So what’s different to the /init.d/openhab startup file?
The User? openhab vs root?

Can anybody help?

Thank you!

Hello there,

It would be nice to have an answer on that one.
I use openhab 1.7.1 (installed via apt-get), I copied the demo files on top of it and tuned them a bit to read a temperature via a serial binding (MySensors, which is the same as Peet I believe)

If I start openhab with “sudo /etc/init.d/openhab start” the website is up but the relevant Temperature item read “- °C”
If I start openhab with “sudo /usr/share/openhab/bin/” the temperature item gets the correct value…

One other thing, I change the group of all files and directories inside the “configurations” directory (the new group is my user so I can modify them without “sudo” (permitions set to 775 instead of 755).

Other info : It is running on an embedded linux like the raspberry but another one (hummingboard)

Thanks for the help, it is not very user friendly to have to keep an ssh terminal active (even with a detached screen :wink: )

have you tried adding user “openhab” to group “dialout”?

1 Like

Well I don’t have a user named openhab. Do you mean I should create one? Or should I add root or myusername to dialout ?

are you sure? I didn’t think I did, but apt-get created one for me…

Well I check with the command users which gave me only myuser as a result but openhab is listed in /etc/passwd so I’ll try :wink:

Ok that did half the trick.
Now the temperature item is correctly shown but not the humidity (which of course was working just fine with
(As a new user, it seems I can’t have more then 3 replies on a topic … So I dont know how I’m going to reply to your next reply …

Ok, I added myuser and root to dialout, reboot and it worked !
Thanks Dan for this quick fix !!!

thank you! that worked for me as well!

Excellent! The same problem cost me two days earlier this week… I too was fooled by the fact that “users” doesn’t list the openhab user.

I’ve added it into the wiki

It would be good to add some information to the manual installation method to create and configure the openhab user. I did a manual installation and I’m having the same issues. At least I know which direction to investigate when I get home, so thanks for the info :smile:


I have installed Openhab 1.7.1 from apt-get, and I was getting the error:
[ERROR] [b.z.i.protocol.ZWaveController] - Serial Error: Port /dev/ttyAMA0 does not exist
( On a Razberry )

I had to add \

to /user/share/openhab/bin/ (JAVA_ARGS_DEFAULT= section)

not to /etc/init.d/openhab

(this is in addition to adding the openhab user to the dialout group in /etc/groups)

I have the same problem but following all the instructions here I cannot get it working.

Here is my scenario: raspberrt pi 2
installed the MySensorsGateway serial onto the Pi (nrf24 radio connected on the pi)
using openhab 1.8.2 installed with apt-get
file /etc/init.d/openhab has line \ just after -Dosgi.noShutdown=true
the same was added for file /usr/share/openhab/bin/
when I run sudo service openhab start, I get the error and available ports are: (empty)
if I run sudo /usr/share/openhab/bin/ then it works
I did add openhab to dialout, if I run groups openhab I get: openhab : openhab dialout

ttyMySensorsGateway is a soft device, actually a link
ls -l ttyMySensorsGateway gives lrwxrwxrwx 1 root root 10 date ttyMySensorsGateway -> /dev/pts/0
ls -l /dev/pts/0 gives crw-rw---- 1 root tty136, 0 date /dev/pts/0

Any ideas? I’m not very experienced with Linux so I might be doing a simple mistake

Edit: I finally got it working by adding the user openhab to group tty
Now I can’t get openhab service to start up at boot but that’s for another topic. Linux hates me.