I am trying to get MQTT running with a runtime from 2.10.2015 (timestamp of the jar files in runtime/server).
This is my conf/services/mqtt.cfg
localhost.url=tcp://127.0.0.1:1883
This is the address of my local mosquitto, which is hidden in my private network, so no passwords are configured. When starting the runtime, I get to the stage where the debug log shows
i can see in my logs (I added a few logger.debug() statements) that the addConsumer method of the MqttBrokerConnection is called, but nothing more happens because the variable started is still false.
So, if anyone has already gotten MQTT working in a current OH2 runtime, I’d love some help
Would you mind sharing your configuration with me? As far as I understood binding configuration with OH2, I would need a conf/services/mqtt.cfg in which I define my broker:
and possibly some items to use data from the broker:
hakan@openhab:~/conf$ cat items/mqtt.items
Number Foo_Temp "Foo Temperature [%.1f °C]" <temperature> (Foo,Temperature) {mqtt="<[broker:openhab/foo/temperature:state:default]"}
all I get with further debugging information on my setup is that the MqttService.updated() method is called with no properties, which makes it return immediately and fail to start any consumers. This sounds like I need to set up something more somewhere, but I am totally out of ideas by now.
Sorry about the binding question. Yes, I do have my own binding in the addons directory. It also gets initialized just fine, I can use its discovery and see it does work. What I am trying to get working is using the mqttService from it.
So, after banging my head against the code and log files yesterday I decided to set up a simple item to see whether the mqtt part of OH2 itself is working or whether I have some problem with my configuration.
Hmmmm, are you using some kind of custom MQTT addon? Is it maybe overriding something? Is the official MQTT binding working for you like it does on mine?
Stupid question, in what file did you put this bit of configuration? conf/services/mqtt.cfg or somewhere else? I am getting pretty desperate for ideas by now
My development OH2 instance just successfully pushed an item value change to the mosquitto server
In the end, it was a simple wrong assumption on my part. I saw the mqtt binding in the Eclipse repository and assumed incorrectly that it would already be working. Especially given that the 2.0.0-SNAPSHOT builds contain some 1.8.0 jars but no mqtt ones.
In the end, @kai told me that MQTT in ESH is not functional yet and that I should take the relevant jars from the 1.8.0-SNAPSHOT build. Taking the following jars from the latest Jenkins build of 1.8.0-SNAPSHOT: