|
Post by jmdharis on Feb 4, 2015 19:38:55 GMT
Hi guys i am new to home automation but i already managed to configure openhab on linux ubuntu 14.10 and arduino connected through serial and everything is working fine . Now i bought an ethernet shield and hook it up on arduino. I already downloaded mosquito 1.3.5 in ubuntu but couldn't understand how to configure the mqtt server.. I already read the mqtt documentation and searched Google but couldn't find something helpful and easy. Any help would be grateful thanks in advance;)
|
|
|
Post by demondreamer on Feb 5, 2015 15:48:52 GMT
I don't think there's much you need to do to configure MQTT. I've installed it on Windows 8 and a Raspberry Pi and both times left all the settings default. There's no interface, it just runs silently in the background and publishes the messages sent to it. To help interact with MQTT, it helps to use a client that you can publish and subscribe with for diagnostic purposes. I've used MyMQTT app on Android and MQTT.fx. MQTT.fx is a JAVA program that I'm using on Windows 8 but I think it runs on Macs and Linux as well, though I've not tried it. You'll need to configure OpenHAB and the Arduino gateway sketch to point to the MQTT server. Below is the relevant part of the openhab.cfg file. In this example I was running the MQTT server "mosquitto" on the same computer as was running OpenHab, that's why the URL to the MQTT broker was localhost. In your Arduino gateway or from any other device you'll have to put the actual local IP address of the MQTT server. ################################# MQTT Transport ###################################### # # Define your MQTT broker connections here for use in the MQTT Binding or MQTT # Persistence bundles. Replace <broker> with a id you choose. #
# URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883 #mqtt:<broker>.url=tcp://<host>:1883 mqtt:mymosquitto.url=tcp://localhost:1883
# Optional. Client id (max 23 chars) to use when connecting to the broker. # If not provided a default one is generated. #mqtt:<broker>.clientId=<clientId>
# Optional. User id to authenticate with the broker. # mqtt:<broker>.user=<user>
# Optional. Password to authenticate with the broker. #mqtt:<broker>.pwd=<password>
# 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:<broker>.qos=<qos> mqtt:mymosquitto.qos=0
# Optional. True or false. Defines if the broker should retain the messages sent to # it. Defaults to false. #mqtt:<broker>.retain=<retain> mqtt:mymosquitto.retain=true
# Optional. True or false. Defines if messages are published asynchronously or # synchronously. Defaults to true. #mqtt:<broker>.async=<async> mqtt:mymosquitto.async=true
# Optional. Defines the last will and testament that is sent when this client goes offline # Format: topic:message:qos:retained <br/> #mqtt:<broker>.lwt=<last will definition>
|
|
|
Post by jmdharis on Feb 6, 2015 9:53:33 GMT
Thanks for the helpful information i will try it today with the raspberry but do i have to declare topics in mqtt? Like ( myhouse/room/ceilinglight)
|
|
|
Post by demondreamer on Feb 12, 2015 7:14:29 GMT
No, you don't have to declare anything in the MQTT broker. It just handles the distribution
|
|
|
Post by jmdharis on Feb 12, 2015 7:43:47 GMT
Ok my friend thnx a lot;))
|
|