Mqtt: get rid of old config

Hi there,

I was trying to get my mqtt<->oh2 working. While I was trying to find out what’s wrong, I decided to rename ‘broker’ in mqtt.cfg. I used to be:

broker.url=tcp://localhost:1883
broker.clientId=openhab2

And I changed it to:

oh2broker.url=tcp://localhost:1885
oh2broker.clientId=openhab2

I now get a lot of error messages like that:
15:57:09.305 [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)[215:org.openhab.io.transport.mqtt:1.9.0.201701200211]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_65]
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:267)[:1.8.0_65]
at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:56)[215:org.openhab.io.transport.mqtt:1.9.0.201701200211]
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:100)[215:org.openhab.io.transport.mqtt:1.9.0.201701200211]
… 1 more
15:57:09.311 [ERROR] [t.mqtt.internal.MqttBrokerConnection] - MQTT connection to ‘oh2broker’ was lost: Connection lost : ReasonCode 32109 : Cause : null

and also:
15:57:19.357 [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)[215:org.openhab.io.transport.mqtt:1.9.0.201701200211]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_65]
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:267)[:1.8.0_65]
at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:56)[215:org.openhab.io.transport.mqtt:1.9.0.201701200211]
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:100)[215:org.openhab.io.transport.mqtt:1.9.0.201701200211]
… 1 more
15:57:19.363 [ERROR] [t.mqtt.internal.MqttBrokerConnection] - MQTT connection to ‘broker’ was lost: Connection lost : ReasonCode 32109 : Cause : null

I rebooted the system a couple of times, I uninstalled the binding and installed it again.
It seems that both versions of the config got somehow persisted …

Any ideas how to solve this problem?

Best

1 Like

Good info … but I’m past that. What can I do now?

When I’ve seen the EOFException working with MQTT from openHAB, my cause was that the clientId I provided in the configuration was not unique among all of the broker’s clients.

Hi, I’ve changed the clientID, but it didn’t help. I’ve read this: MQTT config under OH2 but my config-folder is not present at this location. Any idea where else it could be?

If it is not under
/var/lib/openhab2/config/org/openhab/mqtt.config
you probably have a manual install and in this case the file is located here:
/openhab2/userdata/config/org/openhab/mqtt.config

3 Likes

Okay, another restart, defining the old name of the broker and the new name and giving them different clientIds did the trick. No error messages anymore. I guess that the old descriptor is now active as well, not nice, but what can we do…