MQTT Binding Stopped Working

  • Platform information:
    • Hardware: Atom64/4GB
    • OS: Linux debian/sid
    • Java Runtime Environment: Not even sure…
    • openHAB version: 2.4.0

I’ve had OpenHAB running for a while, but just noticed that it’s stopped communicating properly with my MQTT server. I’m not aware of any changes since the last time I observed it working, but debugging it has been rather frustrating.

My config is basically:

eve.url=tcp://localhost:1883
eve.user=openhab
eve.pwd=something

eve.retain=true

and a variety of things referencing ‘eve’ which previously worked, and now don’t at all.

I can see my MQTT server receiving a connection from openhab:

1546021690: New client connected from 127.0.0.1 as paho9305337983803391 (c1, k60, u’openhab’).

but it doesn’t talk other than that. I set a LWT and could see it add that once, but nothing else.

An example item that used to work that OpenHAB doesn’t seem to be paying attention to is:

Number B_FamilyRoom_Temperature "Temperature [%.1f °C]" <temperature> (B_FamilyRoom, gTemperature, TimeoutGroup, myOpenHAB) ["CurrentTemperature"] {mqtt="<[eve:sj/basement/plant-temp:state:default]", expire="1h"}

I also noticed in the Paper UI I’m given the option to install the MQTT binding, but pressing the button doesn’t do much.

The only relevant log entries I can find look like this:

2018-12-28 10:53:08.501 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
2018-12-28 10:53:08.516 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'eve'

How can I go about making this work again?

Enable “Legacy Bindings” and install mqtt version 1 binding again.
BTW, tons of threads regarding this problem, search function would have been quicker than waiting for an answer :sunglasses:

1 Like

Having posted this, it briefly started working again… but then it stopped again.

I’m not entirely sure what I changed. I had removed a line that was copied from an older version of the mqtt config into /var/lib/... that declared an LWT I didn’t care about.

I had created an error in one of my item configs this morning when trying to debug the issue. I removed that line.

I’d restarted a few times. I noticed it persisted some state into mqtt briefly, but then it seems to have just stopped paying attention.

Looking back through my logs, this seems to have happened at exactly 2018-12-18 06:30:06 (the last time I saw something via MQTT).

It looks like I had a software update around that time. I don’t see any errors, but this thing just isn’t working. I guess I’ll try reinstalling java…

Thanks. I did look around a bit and looked at the suggestions, but I guess not in the right places.

In any case, this does seem to also be my issue. Something magical happened one morning that disabled some things.