[Solved] Very frequent MQTT disconnects

I’ve got very frequent MQTT disconnects. It is that frequent (almost instantly new disconnects) that my log has grown to +10MB in only 2 days.

2017-01-04 19:55:48.062 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'mosquitto’
2017-01-04 19:55:48.082 [ERROR] [t.mqtt.internal.MqttBrokerConnection] - MQTT connection to broker was lost
Connection lost (32109) - java.io.EOFException
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:138)[211:org.openhab.io.transport.mqtt:1.9.0.b5]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_111]
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:267)[:1.8.0_111]
at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:56)[211:org.openhab.io.transport.mqtt:1.9.0.b5]
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:100)[211:org.openhab.io.transport.mqtt:1.9.0.b5]
… 1 more
2017-01-04 19:55:48.085 [ERROR] [t.mqtt.internal.MqttBrokerConnection] - MQTT connection to ‘moqsuitto’ was lost: Connection lost : ReasonCode 32109 : Cause : null
2017-01-04 19:55:48.086 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting connection helper to periodically try restore connection to broker ‘moqsuitto’

Besides that, the binding IS WORKING.
OH2 on Raspbian (RPI3) Mosquitto on localhost.

Have you got a typo somewhere - “Starting MQTT broker connection ‘mosquitto’”* then

“MQTT connection to ‘moqsuitto’ was lost: Connection lost : ReasonCode 32109 : Cause : null”



Dumb typo… I didn’t see it in the log. Anyway, I know that I had that typo at first. But I already corrected it and restarted OH2 to be sure.

Or I’ve missed one, or the typo has ended up somewhere in the system that I cannot reach easily.

All my MQTT-based items work and the mqtt.cfg doesn’t have the typo anymore. So I don’t know where to look for the error.

Should reinstalling the binding do any good? Is the cfg retained when uninstalling?

check this out:

Maybe it will help


case closed

1 Like

I had the same problem, and then I tried to follow your instructions.
I had a broker connection named broker and one named mqtt in the OH2 database, I edited the config files, deleted the OH2 entries and restarted the openhabian.

Now it seems I have no mqtt anymore.
Before my deletions I saw some state changes in events.log, but also the dropped connections to the brokers in openhab.log.
Now I see nothing anymore regarding mqtt.
I already tried to remove the mqtt binding in paperUI and re-added it, restarted again, but nothing worked…

Any clue?