MQTT Binding Config - Where did I do that?

Tags: #<Tag:0x00007fc90eb995e0>

Hi,
I’m currently following instructions from the Sonoff/Tasmota community on how to connect my 8266 E12 device to OpenHAB2 via MQTT. All three are installed and to some degree working but my log output (via Karaf consol using log:display) seems to think I’m trying to connect to 2 MQTT brokers, one of which is correct but the other “RobsMosquitto” isn’t. I can’t remember or find how OpenHAB2 was configured to reference RobsMosquiito and wondered if someone could help me remove it as it’s causing errors.

The log display MQTT bits looks like…

    > 19:47:42.860 [INFO ] [openhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
    > 19:47:42.860 [INFO ] [rt.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'mosquitto'
    > 19:47:42.916 [INFO ] [rt.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'robsmosquitto'
    > 19:47:42.929 [ERROR] [rt.mqtt.internal.MqttBrokerConnection] - MQTT connection to broker was lost
    > org.eclipse.paho.client.mqttv3.MqttException: Connection lost
    >         at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:146) [218:org.openhab.io.transport.mqtt:1.11.0]
    >         at java.lang.Thread.run(Thread.java:748) [?:?]
    > Caused by: java.io.EOFException
    >         at java.io.DataInputStream.readByte(DataInputStream.java:267) ~[?:?]
    >         at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:65) ~[?:?]
    >         at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:107) ~[?:?]
    >         ... 1 more
    > 19:47:42.933 [ERROR] [rt.mqtt.internal.MqttBrokerConnection] - MQTT connection to 'mosquitto' was lost: Connection lost : ReasonCode 32109 : Cause : null
    > 19:47:42.934 [INFO ] [rt.mqtt.internal.MqttBrokerConnection] - Starting connection helper to periodically try restore connection to broker 'mosquitto'
    > 1

and followed by repetitions of…

> 20:06:24.295 [ERROR] [rt.mqtt.internal.MqttBrokerConnection] - MQTT connection to 'mosquitto' was lost: Connection lost : ReasonCode 32109 : Cause : null
> 20:06:24.295 [INFO ] [rt.mqtt.internal.MqttBrokerConnection] - Starting connection helper to periodically try restore connection to broker 'mosquitto'
> 20:06:34.297 [INFO ] [rt.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'mosquitto'
> 20:06:34.302 [ERROR] [rt.mqtt.internal.MqttBrokerConnection] - MQTT connection to broker was lost
> org.eclipse.paho.client.mqttv3.MqttException: Connection lost
>         at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:146) [218:org.openhab.io.transport.mqtt:1.11.0]
>         at java.lang.Thread.run(Thread.java:748) [?:?]
> Caused by: java.io.EOFException
>         at java.io.DataInputStream.readByte(DataInputStream.java:267) ~[?:?]
>         at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:65) ~[?:?]
>         at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:107) ~[?:?]
>         ... 1 more
> 20:06:34.303 [ERROR] [rt.mqtt.internal.MqttBrokerConnection] - MQTT connection to 'robsmosquitto' was lost: Connection lost : ReasonCode 32109 : Cause : null
> 2

services/mqtt.cfg https://docs.openhab.org/addons/bindings/mqtt1/readme.html#transport-configuration

the mqtt.cfg file is located at:
/var/openhab2/services/mqtt.cfg

Regards

Thanks for your responses but I’ve checked my mqtt.cfg (and all other .cfg files in /services folder) and it does not contain any reference to robsmosquitto. Are there any other places where this could possibly have been configured during installation?

i.e. Here’s my mqtt.cfg…

mosquitto.url=tcp://localhost:1883
mosquitto.clientId=OpenHAB2.2
mosquitto.user=mqttadmin
mosquitto.pwd=**************
mosquitto.qos=1
mosquitto.retain=true
mosquitto.async=false

Check the other cfg-files.

Did you mabe had wrongfully configured an robsmosquitto?
Saved the cfg file and then corrected it and saved again?

There was an issue with the mqtt binding not refresching the configuration when not restarted.
Maybe restart openhab.

Which OH version are you using?

Typo?

it has to be like this

/services/mqtt.cfg

Worst case uninstall the mqtt binding, restart openhab and install it again.

Did you by any chance install the new mqtt transport layer that some new experimental bindings are using like MySensors?
I did and it broke my mqtt binding and the errors were similar if I remember correctly.
I had to reinstall openhab from scratch. Twice…

Hi Josar,
Yes, it was a typo.
…and I’ve restarted my openHAB2 (2.2.0) a number of times but still have the same problem.
It’s not clear to me as to why my OpenHAB2 appears (or is it?) to be attempting to connect to 2 MQTT brokers - have I got this right? If so, why is it doing this?

i.e. Log extract…

> 19:47:42.860 [INFO ] [rt.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'mosquitto'
    > 19:47:42.916 [INFO ] [rt.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'robsmosquitto'

Hi Vincent,
To be honest, I’m not sure. I was just following the guidance in the openHAB2 documentation about installing bindings for MQTT but don’t think I came across or installed anything related to MySensors.

…but i do agree about the total uninstallation of openHAB2 to try. I’ll see what comments I get back in the next few hours then give the uninstall a go.
Rob

Try that first:

Look towards the end of that thread, looks like someone had 2 instances of the mqtt binding running!

Thanks Vincent. That’s got rid of the mysterious robsmosqutto.
However, my mosquitto fails to start with log info provided below.
Any ideas what’s wrong?

16:57:59.993 [INFO ] [rt.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'mosquitto'
16:58:00.004 [ERROR] [rt.mqtt.internal.MqttBrokerConnection] - MQTT connection to broker was lost
org.eclipse.paho.client.mqttv3.MqttException: Connection lost
        at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:146) [218:org.openhab.io.transport.mqtt:1.11.0]
        at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.io.EOFException
        at java.io.DataInputStream.readByte(DataInputStream.java:267) ~[?:?]
        at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:65) ~[?:?]
        at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:107) ~[?:?]
        ... 1 more
16:58:00.008 [ERROR] [rt.mqtt.internal.MqttBrokerConnection] - MQTT connection to 'robsmosquitto' was lost: Connection lost : ReasonCode 32109 : Cause : null
16:58:00.009 [INFO ] [rt.mqtt.internal.MqttBrokerConnection] - Starting connection helper to periodically try restore connection to broker 'robsmosquitto'

rob is still there or not?

Reference to robsmosqutto has now been removed by clearing my tmp folder as per Vincents link above.

Do you still have your error?