MQTT verliert die Connection

Hallo Leute,

ich bin am verzweifeln… Ich bekomme MQTT nicht stabil ans laufen…

Ich verwende OpenHab 1.8.x

Nach 10 Sekunden verliert OPENHAB immer die Connection und kann nichts senden. Danach verbindet er wieder und sendet und nach 10 Sekunden ist die Connection wieder weg…

Was kann das sein ?

14:58:13.783 [INFO ] [o.i.t.m.i.MqttBrokerConnection:114 ] - Starting MQTT broker connection 'openhab_srv’
14:58:23.815 [ERROR] [o.i.t.m.i.MqttBrokerConnection:536 ] - MQTT connection to broker was lost
org.eclipse.paho.client.mqttv3.MqttException: Verbindung wurde getrennt
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:138) [mqtt-client-0.4.0.jar:na]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
Caused by: java.io.EOFException: null
at java.io.DataInputStream.readByte(DataInputStream.java:267) ~[na:1.8.0_101]
at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:56) ~[na:na]
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:100) [mqtt-client-0.4.0.jar:na]
… 1 common frames omitted
14:58:23.818 [ERROR] [o.i.t.m.i.MqttBrokerConnection:540 ] - MQTT connection to ‘openhab_srv’ was lost: Verbindung wurde getrennt : ReasonCode 32109 : Cause : null
14:58:23.820 [INFO ] [o.i.t.m.i.MqttBrokerConnection:547 ] - Starting connection helper to periodically try restore connection to broker 'openhab_srv’
14:58:33.820 [INFO ] [o.i.t.m.i.MqttBrokerConnection:114 ] - Starting MQTT broker connection 'openhab_srv’
14:58:43.840 [ERROR] [o.i.t.m.i.MqttBrokerConnection:536 ] - MQTT connection to broker was lost
org.eclipse.paho.client.mqttv3.MqttException: Verbindung wurde getrennt
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:138) [mqtt-client-0.4.0.jar:na]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
Caused by: java.io.EOFException: null
at java.io.DataInputStream.readByte(DataInputStream.java:267) ~[na:1.8.0_101]
at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:56) ~[na:na]
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:100) [mqtt-client-0.4.0.jar:na]
… 1 common frames omitted
14:58:43.842 [ERROR] [o.i.t.m.i.MqttBrokerConnection:540 ] - MQTT connection to ‘openhab_srv’ was lost: Verbindung wurde getrennt : ReasonCode 32109 : Cause : null
14:58:43.842 [INFO ] [o.i.t.m.i.MqttBrokerConnection:547 ] - Starting connection helper to periodically try restore connection to broker 'openhab_srv’
14:58:53.844 [INFO ] [o.i.t.m.i.MqttBrokerConnection:114 ] - Starting MQTT broker connection 'openhab_srv’
14:59:03.860 [ERROR] [o.i.t.m.i.MqttBrokerConnection:536 ] - MQTT connection to broker was lost
org.eclipse.paho.client.mqttv3.MqttException: Verbindung wurde getrennt
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:138) [mqtt-client-0.4.0.jar:na]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
Caused by: java.io.EOFException: null
at java.io.DataInputStream.readByte(DataInputStream.java:267) ~[na:1.8.0_101]
at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:56) ~[na:na]
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:100) [mqtt-client-0.4.0.jar:na]
… 1 common frames omitted
14:59:03.862 [ERROR] [o.i.t.m.i.MqttBrokerConnection:540 ] - MQTT connection to ‘openhab_srv’ was lost: Verbindung wurde getrennt : ReasonCode 32109 : Cause : null

Die MQTT Sektion

URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883

mqtt:openhab_srv.url=tcp://192.168.2.35:1883

Optional. Client id (max 23 chars) to use when connecting to the broker.

If not provided a default one is generated.

mqtt:openhab_srv.clientId=openhab_srv_client

Optional. User id to authenticate with the broker.

mqtt:.user=

Optional. Password to authenticate with the broker.

#mqtt:.pwd=

Optional. Set the quality of service level for sending messages to this broker.

Possible values are 0 (Deliver at most once),1 (Deliver at least once) or 2

(Deliver exactly once). Defaults to 0.

mqtt:openhab_srv.qos=1

Optional. True or false. Defines if the broker should retain the messages sent to

it. Defaults to false.

mqtt:openhab_srv.retain=true

Optional. True or false. Defines if messages are published asynchronously or

synchronously. Defaults to true.

mqtt:openhab_srv.async=false

Optional. Defines the last will and testament that is sent when this client goes offline

Format: topic:message:qos:retained

#mqtt:.lwt=

Wo liegt der Fehler ???

Im voraus Vielen Dank für Eure Hilfe

Tino

First thing to do: please write in English because this is an intentional forum and this way all users can participate in the conversation.

Second thing to do: please format your code with code fences or use the </> button so we can read your config easier:

```
code goes here
```

14:58:13.783 [INFO ] [o.i.t.m.i.MqttBrokerConnection:114 ] - Starting MQTT broker connection 'openhab_srv’
14:58:23.815 [ERROR] [o.i.t.m.i.MqttBrokerConnection:536 ] - MQTT connection to broker was lost
org.eclipse.paho.client.mqttv3.MqttException: Verbindung wurde getrennt
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:138) [mqtt-client-0.4.0.jar:na]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
Caused by: java.io.EOFException: null
at java.io.DataInputStream.readByte(DataInputStream.java:267) ~[na:1.8.0_101]
at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:56) ~[na:na]
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:100) [mqtt-client-0.4.0.jar:na]
… 1 common frames omitted

A lot easier to read, right? :grinning:

Unfortunately I don’t remember those old times from openHAB1. All I can remember is that it worked out of the box. In openHAB2 it causes problems when the mqtt actions are installed the same time as the mqtt binding. But I don’t think that is true for openHAB1.

On a sidenote: you may also use a German language forum at

2 Likes