Installed the MQTT Binding, but no mqtt.cfg file


I’m having a challenge, and after several hours of scouring the forum, I’ve decided I should probably speak up.

  • Brand new install on Ubuntu 16.04.2 LTS
  • Mosquitto v1.4.8 installed, and operational, validated using MQTT.fx. I am able to publish messages without issue.
  • In OH2, added the MQTT Binding add-on (binding-mqtt1 - 1.9.0), which on the screen says installed.
  • Navigated to /etc/openhab2/services, and mqtt.cfg does not exist. The only files in the folder are addons.cfg, readme.txt and runtime.cfg

So, tried another … Chromecast Binding (binding-chromecast - 2.0.0). Nothing for that one either, although not certain if there is a .cfg file for that.

Little lost - thoughts?

that’s not a good sign… the mqtt.cfg (and mqtt-eventbus.cfg) should have been auto-created (in /etc/openhab2/services/) when you installed the MQTT binding

Try to re-install the MQTT binding and check the log (/var/log/openhab2) for any errors.
Which release of OH2 are you running? (check /var/lib/openhab2/etc/

For the Chromecast: It’s a 2.x binding, so normally you will not need a *.cfg file… On the other hand… the docs entry talks about a strange services.cfg file… (without mentioning where it should be placed). We may need to clarify the docs entry.

No logs at all in /var/log/openhab2:

Downloaded the stable release today via apt-get"

openHAB Distribution Version Information

build-no : Release Build
online-repo :

Repository Version

openhab-distro : 2.0.0
smarthome : 0.9.0.b4
openhab-core : 2.0.0
openhab1-addons : 1.9.0
openhab2-addons : 2.0.0
karaf : 4.0.8

output of java -version ?
seems like OH2 process can’t write to the filesystem (due to some reason that we need to identify)
Dir permissions look good (owned by openhab:openhab)

Should I go with the Oracle proper version of Java, instead of OpenJDK?

Yeah, try Oracle to see if things improve
or even better: Zulu

Installed Oracle Java 8:

java -version
java version "1.8.0_131"
Java™ SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot™ 64-Bit Server VM (build 25.131-b11, mixed mode)

Rebooted server (just to make sure)
Reinstalled the MQTT Binding in OH
Checked /etc/openhab2/services/ … no mqtt.cfg

All sub-directories are set to 755, with openhab set as the user/owner, so writing shouldn’t be an issue.

I don’t have any suggestions at the moment…
Also, since your java -version is showing Oracle, then your system is configured to use it as default (you can check with update-alternatives --config java)

Maybe try to start OH2 in debug mode: /usr/share/openhab2/ to see if something useful is posted?

Started debug mode … there is now an events.log and openhab.log. Viewing events.log shows an empty file, however openhab.log has a few entries.

1 Like
    2017-06-20 01:14:34.278 [WARN ] [tty.util.component.AbstractLifeCycle] - FAILED{SSL-http/1.1}{}: Address already in use Address already in use
at Method)[:1.8.0_131]
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(
at org.eclipse.jetty.server.ServerConnector.doStart(
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(
at org.eclipse.jetty.server.Server.doStart(
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(
at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.start(
at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(
at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(
at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(
at org.ops4j.pax.web.service.internal.HttpServiceProxy.registerServlet(
at org.openhab.ui.dashboard.internal.DashboardService.activate(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_131]
at sun.reflect.NativeMethodAccessorImpl.invoke([:1.8.0_131]
at sun.reflect.DelegatingMethodAccessorImpl.invoke([:1.8.0_131]
at java.lang.reflect.Method.invoke([:1.8.0_131]
at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod([32:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.inject.BaseMethod.access$500([32:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke([32:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.inject.BaseMethod.invoke([32:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.inject.ActivateMethod.invoke([32:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.inject.ActivateMethod.invoke([32:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject([32:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent([32:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.manager.SingleComponentManager.getService([32:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal([32:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal([32:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService([32:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService([32:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded([32:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded([32:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding([32:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track([32:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged([32:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged([32:org.apache.felix.scr:2.0.6]
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService([org.eclipse.osgi-3.10.101.v20150820-1432.jar:]


# openHAB 2 service configuration
# Additional options for the JAVA_OPTS environment variable.
# These will be appended to the execution of the openHAB Java runtime in front of all other options.
# A couple of independent examples:
#   EXTRA_JAVA_OPTS="-Djna.library.path=/lib/arm-linux-gnueabihf/ -Duser.timezone=Europe/Berlin"

# The ports openHAB will bind its HTTP/HTTPS web server to.

No comments, just the EXTRA_JAVA_OPTS="" line.

The server is defaulted to port 8080, but I could add the line to change that.

maybe tomcat with ssl is installed?
check what process is using tcp 8443

lsof -i:8443
netstat -nlp|grep 8443

yeah, add the 2 lines to change the default ports that OH2 will listen to


Ps: The extra comments were added in the file during a recent snapshot (I think S#947)

On the other hand… that’s only a warning… (that OH2 couldn’t bring up its https interface)
You were able to run PaperUI on 8080 (so that was free) and install the MQTT binding…
so… something else is wrong…
anyway… fix the 8443 port issue and continue debugging :slight_smile:

Ok … tomcat8 is now installed and the service is running … attempted to install MQTT Binding via PaperUI, still no go.

Here’s something, though … so I appended the two additional lines for ports 8081 and 8444, saved the file, restarted services, and both ports 8080 and 8443 are still active, and 8081/8444 don’t do a thing.

BTW … I appreciate you taking the time with me this early in the morning.

1 Like

you don’t need tomcat. I asked if it was installed to see if that process was taking up tcp 8443 (that would cause the warning {}: Address already in use)
If you stop OH2 service: do you see any other process using tcp 8443?

ok… strange… :frowning:
I have to check if there is any difference for Ubuntu (I use Debian)…
it should have worked :stuck_out_tongue:

Any other useful info in the openhab.log when you start the service using

I am not sure if will use /etc/defaults/openhab2
Maybe try: systemctl start openhab2 to make sure that it will use the file

openhab services stopped … validated web interface no longer active on both 8080 and 8443, and reports the same with lsof and netstat.

Started the service, only ports 8080 & 8443 are accessible.

FYI … I am maxed out on the number of entries I’m allowed to post, and the forum is blocking me from adding new replies for 22 hours.

cool … thx!

I’ll purge everything (not losing anything at the moment) and install the current snapshot to see if that helps, then will report.

Well … that didn’t work … after uninstalling and installing the snapshot, the service is now failing to start. :confused:

    root@TigieMontana:/etc/default# systemctl status openhab2.service
● openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled; vendor preset: enabled)
   Active: inactive (dead) (Result: exit-code) since Tue 2017-06-20 02:31:44 MDT; 2s ago
  Process: 13096 ExecStop=/usr/share/openhab2/runtime/bin/stop (code=exited, status=3)
  Process: 12887 ExecStart=/usr/share/openhab2/ server (code=exited, status=255)
 Main PID: 12887 (code=exited, status=255)

Jun 20 02:31:44 TigieMontana systemd[1]: openhab2.service: Unit entered failed state.
Jun 20 02:31:44 TigieMontana systemd[1]: openhab2.service: Failed with result 'exit-code'.
Jun 20 02:31:44 TigieMontana systemd[1]: openhab2.service: Service hold-off time over, scheduling
Jun 20 02:31:44 TigieMontana systemd[1]: Stopped openHAB 2 - empowering the smart home.
Jun 20 02:31:44 TigieMontana systemd[1]: openhab2.service: Start request repeated too quickly.
Jun 20 02:31:44 TigieMontana systemd[1]: Failed to start openHAB 2 - empowering the smart home.

I think we have success!

                      __  _____    ____

____ ____ ___ ____ / / / / | / __ )
/ __ / __ / _ / __ / // / /| | / __ |
/ /
/ / // / __/ / / / __ / ___ |/ // /
_/ ./_// /// /// |/_____/
/_/ 2.1.0-SNAPSHOT
Build #958

Hit ‘’ for a list of available commands
and ‘[cmd] --help’ for help on a specific command.
Hit ‘’ or type ‘system:shutdown’ or ‘logout’ to shutdown openHAB.

openhab> log:tail
02:38:12.926 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at http://192.168 .1.29:8080
02:38:12.928 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at https://192.16 8.1.29:8443
02:39:06.997 [INFO ] [smarthome.event.ExtensionEvent ] - Extension ‘package-expert’ has been installed.
02:39:09.536 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Started HABmin servlet at /habmin
02:39:09.567 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
02:39:09.589 [INFO ] [assic.internal.servlet.WebAppServlet] - Started Classic UI at /classicui/app
02:39:09.664 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
02:39:09.684 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
02:39:09.705 [INFO ] [smarthome.event.ExtensionEvent ] - Extension ‘misc-restdocs’ has been installed.
02:39:09.706 [INFO ] [smarthome.event.ExtensionEvent ] - Extension ‘transformation-javascript’ has been installed.
02:39:09.706 [INFO ] [smarthome.event.ExtensionEvent ] - Extension ‘ui-habpanel’ has been installed.
02:39:09.707 [INFO ] [smarthome.event.ExtensionEvent ] - Extension ‘transformation-regex’ has been installed.
02:39:09.708 [INFO ] [smarthome.event.ExtensionEvent ] - Extension ‘transformation-jsonpath’ has been installed.
02:39:09.708 [INFO ] [smarthome.event.ExtensionEvent ] - Extension ‘transformation-xpath’ has been installed.
02:39:09.709 [INFO ] [smarthome.event.ExtensionEvent ] - Extension ‘ui-basic’ has been installed.
02:39:09.709 [INFO ] [smarthome.event.ExtensionEvent ] - Extension ‘transformation-map’ has been installed.
02:39:09.710 [INFO ] [smarthome.event.ExtensionEvent ] - Extension ‘ui-classic’ has been installed.
02:39:09.710 [INFO ] [smarthome.event.ExtensionEvent ] - Extension ‘ui-habmin’ has been installed.
02:39:09.711 [INFO ] [smarthome.event.ExtensionEvent ] - Extension ‘transformation-xslt’ has been installed.
02:39:09.711 [INFO ] [smarthome.event.ExtensionEvent ] - Extension ‘transformation-exec’ has been installed.
02:39:09.711 [INFO ] [smarthome.event.ExtensionEvent ] - Extension ‘ui-paper’ has been installed.
02:39:09.712 [INFO ] [smarthome.event.ExtensionEvent ] - Extension ‘transformation-scale’ has been installed.
02:39:48.640 [INFO ] [smarthome.event.ExtensionEvent ] - Extension ‘binding-mqtt1’ has been installed.

root@TigieMontana:/etc/openhab2/services# ls
addons.cfg  mqtt.cfg  mqtt-eventbus.cfg  readme.txt  runtime.cfg

Checking the file now …

Woohoo! I think we got it. Interesting how the stable release was challenging, but the the current snapshot was the ticket. Oh well … its operational, which is great.

Thank you very much for your help walking through this. I really appreciate your time.

1 Like