MQTT Not starting correctly

I am running OH 2.5.0-SNAPSHOT, build #1566 under docker on an i5 system. MQTT was starting correctly with older 2.5.0-SNAPSHOTs, but with build #1566 I cannot get the mqtt.generic binding to start without errors.

I have a log containing the MQTT entries starting from the org.openhab.binding.mqtt bundle start entry, but it is too large to paste here (> 250 KB). The log output filtered on ERROR is short enough to paste here:

2019-04-07 06:36:27.019 [ERROR][59-9b6c61a0982f][org.openhab.binding.mqtt.generic    ] - bundle org.openhab.binding.mqtt.generic:2.5.0.201904040210 (241)[org.openhab.binding.mqtt.MqttChannelStateDescriptionProvider(297)] : Could not load implementation object class org.openhab.binding.mqtt.MqttChannelStateDescriptionProvider
2019-04-07 06:36:27.029 [ERROR][lisher@3f67593e][org.openhab.binding.mqtt.generic    ] - FrameworkEvent ERROR - org.openhab.binding.mqtt.generic
2019-04-07 06:36:27.044 [ERROR][59-9b6c61a0982f][org.openhab.binding.mqtt.generic    ] - bundle org.openhab.binding.mqtt.generic:2.5.0.201904040210 (241)[org.openhab.binding.mqtt.MqttChannelStateDescriptionProvider(297)] : Could not load implementation object class org.openhab.binding.mqtt.MqttChannelStateDescriptionProvider
2019-04-07 06:36:27.048 [ERROR][59-9b6c61a0982f][org.openhab.binding.mqtt.generic    ] - bundle org.openhab.binding.mqtt.generic:2.5.0.201904040210 (241)[org.openhab.binding.mqtt.MqttChannelTypeProvider(298)] : Could not load implementation object class org.openhab.binding.mqtt.MqttChannelTypeProvider
2019-04-07 06:36:27.050 [ERROR][lisher@3f67593e][org.openhab.binding.mqtt.generic    ] - FrameworkEvent ERROR - org.openhab.binding.mqtt.generic
2019-04-07 06:36:27.062 [ERROR][lisher@3f67593e][org.openhab.binding.mqtt.generic    ] - FrameworkEvent ERROR - org.openhab.binding.mqtt.generic
2019-04-07 06:36:27.068 [ERROR][59-9b6c61a0982f][org.openhab.binding.mqtt.generic    ] - bundle org.openhab.binding.mqtt.generic:2.5.0.201904040210 (241)[org.openhab.binding.mqtt.MqttChannelTypeProvider(298)] : Could not load implementation object class org.openhab.binding.mqtt.MqttChannelTypeProvider
2019-04-07 06:36:27.072 [ERROR][lisher@3f67593e][org.openhab.binding.mqtt.generic    ] - FrameworkEvent ERROR - org.openhab.binding.mqtt.generic
2019-04-07 06:36:27.072 [ERROR][59-9b6c61a0982f][org.openhab.binding.mqtt.generic    ] - bundle org.openhab.binding.mqtt.generic:2.5.0.201904040210 (241)[org.openhab.binding.mqtt.MqttChannelTypeProvider(298)] : Could not load implementation object class org.openhab.binding.mqtt.MqttChannelTypeProvider
2019-04-07 06:36:27.085 [ERROR][lisher@3f67593e][org.openhab.binding.mqtt.generic    ] - FrameworkEvent ERROR - org.openhab.binding.mqtt.generic
2019-04-07 06:36:27.109 [ERROR][lisher@3f67593e][org.openhab.binding.mqtt.generic    ] - FrameworkEvent ERROR - org.openhab.binding.mqtt.generic
2019-04-07 06:36:27.133 [ERROR][lisher@3f67593e][org.openhab.binding.mqtt.generic    ] - FrameworkEvent ERROR - org.openhab.binding.mqtt.generic
2019-04-07 06:36:27.187 [ERROR][lisher@3f67593e][org.openhab.binding.mqtt.generic    ] - FrameworkEvent ERROR - org.openhab.binding.mqtt.generic
2019-04-07 06:36:27.217 [ERROR][lisher@3f67593e][org.openhab.binding.mqtt.generic    ] - FrameworkEvent ERROR - org.openhab.binding.mqtt.generic
2019-04-07 06:36:27.238 [ERROR][lisher@3f67593e][org.openhab.binding.mqtt.generic    ] - FrameworkEvent ERROR - org.openhab.binding.mqtt.generic
2019-04-07 06:36:27.270 [ERROR][lisher@3f67593e][g.openhab.binding.mqtt.homeassistant] - FrameworkEvent ERROR - org.openhab.binding.mqtt.homeassistant
2019-04-07 06:36:27.286 [ERROR][lisher@3f67593e][g.openhab.binding.mqtt.homeassistant] - FrameworkEvent ERROR - org.openhab.binding.mqtt.homeassistant
2019-04-07 06:36:27.313 [ERROR][lisher@3f67593e][g.openhab.binding.mqtt.homeassistant] - FrameworkEvent ERROR - org.openhab.binding.mqtt.homeassistant
2019-04-07 06:36:27.327 [ERROR][lisher@3f67593e][g.openhab.binding.mqtt.homeassistant] - FrameworkEvent ERROR - org.openhab.binding.mqtt.homeassistant
2019-04-07 06:36:27.342 [ERROR][lisher@3f67593e][g.openhab.binding.mqtt.homeassistant] - FrameworkEvent ERROR - org.openhab.binding.mqtt.homeassistant
2019-04-07 06:36:27.363 [ERROR][lisher@3f67593e][org.openhab.binding.mqtt.homie      ] - FrameworkEvent ERROR - org.openhab.binding.mqtt.homie
2019-04-07 06:36:27.374 [ERROR][lisher@3f67593e][org.openhab.binding.mqtt.homie      ] - FrameworkEvent ERROR - org.openhab.binding.mqtt.homie
2019-04-07 06:36:27.387 [ERROR][lisher@3f67593e][org.openhab.binding.mqtt.homie      ] - FrameworkEvent ERROR - org.openhab.binding.mqtt.homie
2019-04-07 06:36:27.399 [ERROR][lisher@3f67593e][org.openhab.binding.mqtt.homie      ] - FrameworkEvent ERROR - org.openhab.binding.mqtt.homie
2019-04-07 06:36:27.412 [ERROR][lisher@3f67593e][org.openhab.binding.mqtt.homie      ] - FrameworkEvent ERROR - org.openhab.binding.mqtt.homie

I configure MQTT with ${OPENHAB_CONF}/services/addons.cfg and both thing and item files.

MQTT thing configuration:

Bridge  mqtt:broker:mqtt_broker [
        host="127.0.0.1",
        secure=false,
        port=1883,
        qos=0,
        retain=false,
        clientid="Oh2MqttClient",
        keep_alive_time=30000,
        reconnect_time=60000,
        username="client",
        password="password"
        ] {
        Thing   topic  wifi_sw03        "Sonoff Switch 3" {
                Channels:
                        Type switch : command "Power Control" [
                                commandTopic="cmd/wifi-sw03/POWER",
                                stateTopic="stat/wifi-sw03/RESULT",
                                transformationPattern="JSONPATH:$.POWER",
                                retained=true,
                                on="ON",
                                off="OFF"
                                ]
                        Type string : updated "Time" [
                                stateTopic="tele/wifi-sw03/STATE",
                                transformationPattern="JSONPATH:$.Time"
                                ]
                        Type number : uptime "Switch Uptime" [
                                stateTopic="tele/wifi-sw03/STATE",
                                transformationPattern="JSONPATH:$.Uptime"
                                ]
                        Type number : vcc "VCC" [
                                stateTopic="tele/wifi-sw03/STATE",
                                transformationPattern="JSONPATH:$.Vcc"
                                ]
                        Type switch : state "Power State" [
                                stateTopic="tele/wifi-sw03/STATE",
                                transformationPattern="JSONPATH:$.POWER",
                                retained=true,
                                on="ON",
                                off="OFF"
                                ]
                        Type number : ap "Wifi AP" [
                                stateTopic="tele/wifi-sw03/STATE",
                                transformationPattern="JSONPATH:$.Wifi.AP"
                                ]
                        Type string : ssid "Wifi SSID" [
                                stateTopic="tele/wifi-sw03/STATE",
                                transformationPattern="JSONPATH:$.Wifi.SSId"
                                ]
                        Type number : rssi "Wifi RSSI" [
                                stateTopic="tele/wifi-sw03/STATE",
                                transformationPattern="JSONPATH:$.Wifi.RSSI"
                                ]
                        Type string : mac "Wifi AP MAC" [
                                stateTopic="tele/wifi-sw03/STATE",
                                transformationPattern="JSONPATH:$.Wifi.APMac"
                                ]
        }
}

Has some aspect of MQTT configuration changed in the latest snapshot version of the MQTT binding?

1 Like

Some additional information about installed bundles:

openhab> bundle:list -s -r | grep -i mqtt
237 β”‚ Active β”‚  80 β”‚ 1.2.0                 β”‚ org.eclipse.paho.client.mqttv3                               β”‚ [osgi.identity; type="osgi.bundle"; version:Version="1.2.0"; osgi.identity="org.eclipse.paho.client.mqttv3"]
240 β”‚ Active β”‚  80 β”‚ 2.5.0.201904040210    β”‚ org.openhab.binding.mqtt                                     β”‚ [osgi.identity; type="osgi.bundle"; version:Version="2.5.0.201904040210"; osgi.identity="org.openhab.binding.mqtt"]
241 β”‚ Active β”‚  81 β”‚ 2.5.0.201904040210    β”‚ org.openhab.binding.mqtt.generic                             β”‚ [osgi.identity; type="osgi.bundle"; version:Version="2.5.0.201904040210"; osgi.identity="org.openhab.binding.mqtt.generic"]
242 β”‚ Active β”‚  82 β”‚ 2.5.0.201904040210    β”‚ org.openhab.binding.mqtt.homeassistant                       β”‚ [osgi.identity; type="osgi.bundle"; version:Version="2.5.0.201904040210"; osgi.identity="org.openhab.binding.mqtt.homeassistant"]
243 β”‚ Active β”‚  82 β”‚ 2.5.0.201904040210    β”‚ org.openhab.binding.mqtt.homie                               β”‚ [osgi.identity; type="osgi.bundle"; version:Version="2.5.0.201904040210"; osgi.identity="org.openhab.binding.mqtt.homie"]
259 β”‚ Active β”‚  80 β”‚ 2.5.0.201904010608    β”‚ org.openhab.core.io.transport.mqtt                           β”‚ [osgi.identity; type="osgi.bundle"; version:Version="2.5.0.201904010608"; osgi.identity="org.openhab.core.io.transport.mqtt"]
openhab> bundle:list -s -r | grep -i transform
187 β”‚ Active β”‚  80 β”‚ 2.5.0.201904010550    β”‚ org.openhab.core.transform                                   β”‚ [osgi.identity; type="osgi.bundle"; version:Version="2.5.0.201904010550"; osgi.identity="org.openhab.core.transform"]
267 β”‚ Active β”‚  75 β”‚ 2.5.0.201904040209    β”‚ org.openhab.transform.jsonpath                               β”‚ [osgi.identity; type="osgi.bundle"; version:Version="2.5.0.201904040209"; osgi.identity="org.openhab.transform.jsonpath"]
268 β”‚ Active β”‚  75 β”‚ 2.5.0.201904040209    β”‚ org.openhab.transform.map                                    β”‚ [osgi.identity; type="osgi.bundle"; version:Version="2.5.0.201904040209"; osgi.identity="org.openhab.transform.map"]
269 β”‚ Active β”‚  75 β”‚ 2.5.0.201904040209    β”‚ org.openhab.transform.regex                                  β”‚ [osgi.identity; type="osgi.bundle"; version:Version="2.5.0.201904040209"; osgi.identity="org.openhab.transform.regex"]
270 β”‚ Active β”‚  75 β”‚ 2.5.0.201904040209    β”‚ org.openhab.transform.scale                                  β”‚ [osgi.identity; type="osgi.bundle"; version:Version="2.5.0.201904040209"; osgi.identity="org.openhab.transform.scale"]
openhab> bundle:list -s -r | grep -i transport
159 β”‚ Active β”‚  80 β”‚ 2.5.0.201904010604    β”‚ org.openhab.core.io.transport.mdns                           β”‚ [osgi.identity; type="osgi.bundle"; version:Version="2.5.0.201904010604"; osgi.identity="org.openhab.core.io.transport.mdns"]
259 β”‚ Active β”‚  80 β”‚ 2.5.0.201904010608    β”‚ org.openhab.core.io.transport.mqtt                           β”‚ [osgi.identity; type="osgi.bundle"; version:Version="2.5.0.201904010608"; osgi.identity="org.openhab.core.io.transport.mqtt"]
260 β”‚ Active β”‚  80 β”‚ 2.5.0.201904010604    β”‚ org.openhab.core.io.transport.serial                         β”‚ [osgi.identity; type="osgi.bundle"; version:Version="2.5.0.201904010604"; osgi.identity="org.openhab.core.io.transport.serial"]
261 β”‚ Active β”‚  80 β”‚ 2.5.0.201904010609    β”‚ org.openhab.core.io.transport.serial.rxtx                    β”‚ [osgi.identity; type="osgi.bundle"; version:Version="2.5.0.201904010609"; osgi.identity="org.openhab.core.io.transport.serial.rxtx"]
262 β”‚ Active β”‚  80 β”‚ 2.5.0.201904010609    β”‚ org.openhab.core.io.transport.serial.rxtx.rfc2217            β”‚ [osgi.identity; type="osgi.bundle"; version:Version="2.5.0.201904010609"; osgi.identity="org.openhab.core.io.transport.serial.rxtx.rfc2217"]

MQTT is not stable (or doesn’t work) in the latest snapshots. I’m still on snapshot 1560…this was for me the latest working version.

1 Like

Hi, @michaeljoos. Thank you for that information. I may just have to wait until the MQTT stability is sorted out as I’m not aware of an OpenHAB docker image archive from which I might download and install 2.5.0-SNAPSHOT build #1560. At least I now know it’s not anything to do with my configuration.

My complete system is on snapshot 1560, not only the MQTT-Binding. This is the command I use each time to go back to a previous version on my openHABian system (in this case 1560):

sudo apt-get install openhab2=2.5.0~S1560-1

…but without guarantee that it works for all systems and/or configurations :wink:

1 Like

I’ve experienced the same, #1566 is broken, full of java classpath errors in the mqtt binding. #1560 works correctly. #1566 reads the mqtt things file, but cannot parse that, I’ve lost all of my mqtt based things, because of the faulty starting.

should be

clientID="Oh2MqttClient",

:wink:

Actually, that exact same configuration was working with earlier snapshots, i.e., the case of the letters β€˜ID’ did not seem to matter. :wink:

In fact, as the parameter will not be set, you will only see the difference in the mosquitto log file :slight_smile:

1 Like

OK, that makes sense. When I first started working with the MQTT2 binding I had wondered why the case of clientID did not seem to matter. Thank you for the clarification.

I think you can use openhab/openhab:snapshot-1560 to choose a specific snapshot build in your docker pull. There might be a stray character before or after the build number or something. Unfortunately the readme isn’t clear on that.

MQTT working again with OH 2.5.0-SNAPSHOT, build 1568

Thanks! :+1: