Is MQTT working with OH2 (build 159)?

1,915 views
Skip to first unread message

Hakan Tandoğan

unread,
May 7, 2015, 9:17:53 AM5/7/15
to open...@googlegroups.com
Hi,

I have semi-successfully converted my OH1 setup to OH2 snapshot build 159 using the addons from OH1 build 921 .

The mqtt binding is in addons, and the transport itself should come with the OH2 core if I understand things correctly. Also, I took the necessary part from my old openhab.cfg, and put it into services/mqtt.cfg, removing the "mqtt:" in front of the keys as described in https://github.com/openhab/openhab2/blob/master/docs/sources/installation/runtime.md

I did the same for NTP, onewire and a few more bindings, which I can use successfully.

For MQTT, I see no output in the log file that this particular service is started, neither can I see a connection being made to my local mosquitto server.

So, the question is, does someone have OH2 with MQTT already up and running and could give me a hint or should I expect MQTT to be not running at all at the moment (and switch back to OH1)?

Regards,
Hakan

Karel Goderis

unread,
May 7, 2015, 1:04:52 PM5/7/15
to open...@googlegroups.com
Yes,

it should work. I have mqttitude running

in services/runtime.cfg

mqtt:kalideux.url=tcp://localhost:1883

with mosquitto

macmini:logs kaladmin$ ps aux | grep mos
kaladmin        52007   0.1  0.0  2441988    656 s000  S+    7:03PM   0:00.01 grep mos
kaladmin           26   0.0  0.0  2438252    224   ??  Ss   27Apr15   6:22.06 /usr/local/Cellar/mosquitto/1.3.1_1/sbin/mosquitto -v -c /usr/local/etc/mosquitto/mosquitto.conf

in mqtt.items

String    Notify_Info            (Notification)    { mqtt=">[kalideux:/openhab/notification/info:state:*:default]" }
String    Notify_Alert          (Notification)    { mqtt=">[kalideux:/openhab/notification/alert:state:*:default]" }
String    Notify_Warn         (Notification)    { mqtt=">[kalideux:/openhab/notification/warn:state:*:default]" }
String    Notify_Alarm        (Notification)    { mqtt=">[kalideux:/openhab/notification/alarm:state:*:default]" }

in the logs:

2015-04-28 22:51:10 [DEBUG] [.b.mqtt.internal.MqttActivator:34   ] - MQTT binding has been started.
2015-04-28 22:51:21 [DEBUG] [.io.transport.mqtt.MqttService:118  ] - Starting MQTT Service...
2015-04-28 22:51:23 [DEBUG] [.io.transport.mqtt.MqttService:123  ] - Starting MQTT Service...
2015-04-28 22:51:23 [INFO ] [.io.transport.mqtt.MqttService:108  ] - MQTT Service initialization completed.
2015-04-28 22:51:53 [INFO ] [.e.s.m.c.i.ModelRepositoryImpl:86   ] - Loading model 'mqtt.items'
2015-04-28 22:51:53 [DEBUG] [.e.s.m.i.i.GenericItemProvider:142  ] - Processing binding configs for items from model 'mqtt.items'
2015-04-28 22:51:53 [DEBUG] [b.mqtt.internal.MqttItemConfig:71   ] - Loaded MQTT config for item 'Notify_Info' : 0 subscribers, 1 publishers
2015-04-28 22:51:53 [DEBUG] [b.mqtt.internal.MqttItemConfig:71   ] - Loaded MQTT config for item 'Notify_Alert' : 0 subscribers, 1 publishers
2015-04-28 22:51:53 [DEBUG] [b.mqtt.internal.MqttItemConfig:71   ] - Loaded MQTT config for item 'Notify_Warn' : 0 subscribers, 1 publishers
2015-04-28 22:51:53 [DEBUG] [b.mqtt.internal.MqttItemConfig:71   ] - Loaded MQTT config for item 'Notify_Alarm' : 0 subscribers, 1 publishers

K

--
You received this message because you are subscribed to the Google Groups "openhab2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab2+u...@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openhab2/4d81871a-ebd5-435c-9c10-39b21ecad99a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages