MQTT: Client is not connected

I want to connect to via mqtt.

But i have an error:
2016-09-01 16:35:17.933 [ERROR] [o.i.t.m.i.MqttBrokerConnection] - Error starting consumer org.eclipse.paho.client.mqttv3.MqttException: Connection lost at ~[na:na] at ~[na:1.8.0_101] Caused by: null at ~[na:1.8.0_101] at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage( ~[na:na] at ~[na:na] ... 1 common frames omitted 2016-09-01 16:35:17.937 [ERROR] [o.i.t.m.i.MqttBrokerConnection] - Error starting consumer org.eclipse.paho.client.mqttv3.MqttException: Client is not connected at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException( ~[mqtt-client-0.4.0.jar:na] at org.eclipse.paho.client.mqttv3.internal.ClientComms.sendNoWait( ~[mqtt-client-0.4.0.jar:na] at org.eclipse.paho.client.mqttv3.MqttAsyncClient.subscribe( ~[mqtt-client-0.4.0.jar:na] at org.eclipse.paho.client.mqttv3.MqttClient.subscribe( ~[mqtt-client-0.4.0.jar:na] at org.eclipse.paho.client.mqttv3.MqttClient.subscribe( ~[mqtt-client-0.4.0.jar:na] at [] at [] at [] at java.util.TimerThread.mainLoop( [na:1.8.0_101] at [na:1.8.0_101]

I suppose that error is connected with eclipse paho.
Am i right?

root@uc:/etc/openhab# dpkg -l | grep openhab ii openhab-addon-action-mqtt 1.8.3 all openHAB MQTT Action ii openhab-addon-binding-modbus 1.8.3 all openHAB Modbus Binding ii openhab-addon-binding-mqtt 1.8.3 all openHAB MQTT Binding ii openhab-addon-binding-mqttitude 1.8.3 all openHAB Mqttitude Binding ii openhab-addon-io-gpio 1.8.3 all openHAB GPIO IO Module ii openhab-addon-io-serial 1.8.3 all openHAB Serial Transport ii openhab-addon-persistence-mqtt 1.8.3 all openHAB MQTT Persistence ii openhab-runtime 1.8.3 all openHAB Distribution

What is your config, Items, rules, and messages being sent and received?

Eclipse paho is the MQTT library that the MQTT bindings use so that is the part of the code that is throwing the error, but the problem is either with your configs or with the data being received. The EOFException is usually thrown when reading data and that data ends before it is supposed to.

But without knowing more there isn’t much I can offer in terms of help.

Thanks for the answer.
I found my mistake.
I tried to appeal to non-existent a topic in .items.

I’ve got one more question:
i want in .items:
Number TE1 "Temperature1 [%.1f]" (GF_Termo,Temperature){onewire="deviceId=28.FF478D2D0400;propertyName=temperature;refreshinterval=10;ignore85CPowerOnResetValues",mqtt=">[mosquitto:v1/fSBqvJ5ZRSed_UQgcN7GCQ/data?ct=json:state:*:{"r":[{"k":"temp","v":${state}}]}"}

How can i send messege {"r":[{"k":"temp","v":${state}}]}?

I think you have to at least escape the quotes in your string, possibly the curly brackets and other special characters.


It’s not work.


17:02:28.947 [INFO ] [c.internal.ModelRepositoryImpl:98 ] - Refreshing model 'default.items’
17:02:29.078 [DEBUG] [i.internal.GenericItemProvider:154 ] - Processing binding configs for items from model 'default.items’
17:02:29.090 [ERROR] [i.internal.GenericItemProvider:350 ] - Binding configuration of type ‘mqtt’ of item ‘TE1‘ could not be parsed correctly.
org.openhab.model.item.binding.BindingConfigParseException: Missing mqtt binding configuration for item TE1
at org.openhab.binding.mqtt.internal.MqttGenericBindingProvider.processBindingConfiguration( ~[na:na]
at org.openhab.model.item.internal.GenericItemProvider.internalDispatchBindings( [org.openhab.model.item_1.8.3.jar:na]
at org.openhab.model.item.internal.GenericItemProvider.internalDispatchBindings( [org.openhab.model.item_1.8.3.jar:na]
at org.openhab.model.item.internal.GenericItemProvider.processBindingConfigsFromModel( [org.openhab.model.item_1.8.3.jar:na]
at org.openhab.model.item.internal.GenericItemProvider.modelChanged( [org.openhab.model.item_1.8.3.jar:na]
at org.openhab.model.core.internal.ModelRepositoryImpl.notifyListeners( [org.openhab.model.core_1.8.3.jar:na]
at org.openhab.model.core.internal.ModelRepositoryImpl.addOrRefreshModel( [org.openhab.model.core_1.8.3.jar:na]
at org.openhab.model.core.internal.folder.FolderObserver.checkFolder( [org.openhab.model.core_1.8.3.jar:na]
at [org.openhab.model.core_1.8.3.jar:na]


17:02:29.092 [DEBUG] [i.internal.GenericItemProvider:419 ] - Couldn’t find ItemFactory for item ‘null’ of type ‘state’

I tried to send in Unicode, but without success.
I tried to treat through Transformation Javascript, but without success.

I’m not sure how to make this work in the Item. You can try sending the String using a Rule and the MQTT action.