MQTT: Client is not connected

I want to connect to cloudthing.io 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 org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:138) ~[na: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) ~[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(ExceptionHelper.java:27) ~[mqtt-client-0.4.0.jar:na] at org.eclipse.paho.client.mqttv3.internal.ClientComms.sendNoWait(ClientComms.java:132) ~[mqtt-client-0.4.0.jar:na] at org.eclipse.paho.client.mqttv3.MqttAsyncClient.subscribe(MqttAsyncClient.java:657) ~[mqtt-client-0.4.0.jar:na] at org.eclipse.paho.client.mqttv3.MqttClient.subscribe(MqttClient.java:282) ~[mqtt-client-0.4.0.jar:na] at org.eclipse.paho.client.mqttv3.MqttClient.subscribe(MqttClient.java:275) ~[mqtt-client-0.4.0.jar:na] at org.openhab.io.transport.mqtt.internal.MqttBrokerConnection.startConsumer(MqttBrokerConnection.java:480) [org.openhab.io.transport.mqtt_1.8.3.jar:na] at org.openhab.io.transport.mqtt.internal.MqttBrokerConnection.start(MqttBrokerConnection.java:124) [org.openhab.io.transport.mqtt_1.8.3.jar:na] at org.openhab.io.transport.mqtt.internal.MqttBrokerConnectionHelper.run(MqttBrokerConnectionHelper.java:37) [org.openhab.io.transport.mqtt_1.8.3.jar:na] at java.util.TimerThread.mainLoop(Timer.java:555) [na:1.8.0_101] at java.util.TimerThread.run(Timer.java:505) [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.

\{\"r\":\[\{\"k\":\"temp\",\"v\":$\{state\}\}

It’s not work.

errors:

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(MqttGenericBindingProvider.java:55) ~[na:na]
at org.openhab.model.item.internal.GenericItemProvider.internalDispatchBindings(GenericItemProvider.java:348) [org.openhab.model.item_1.8.3.jar:na]
at org.openhab.model.item.internal.GenericItemProvider.internalDispatchBindings(GenericItemProvider.java:324) [org.openhab.model.item_1.8.3.jar:na]
at org.openhab.model.item.internal.GenericItemProvider.processBindingConfigsFromModel(GenericItemProvider.java:171) [org.openhab.model.item_1.8.3.jar:na]
at org.openhab.model.item.internal.GenericItemProvider.modelChanged(GenericItemProvider.java:390) [org.openhab.model.item_1.8.3.jar:na]
at org.openhab.model.core.internal.ModelRepositoryImpl.notifyListeners(ModelRepositoryImpl.java:159) [org.openhab.model.core_1.8.3.jar:na]
at org.openhab.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:100) [org.openhab.model.core_1.8.3.jar:na]
at org.openhab.model.core.internal.folder.FolderObserver.checkFolder(FolderObserver.java:142) [org.openhab.model.core_1.8.3.jar:na]
at org.openhab.model.core.internal.folder.FolderObserver.run(FolderObserver.java:99) [org.openhab.model.core_1.8.3.jar:na]

and

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.