Sunday, April 12, 2015

More Playing with MQTT

With updated software, mosquitto version 1.4.1, it is very easy to connect two Brokers (see problem as suggested on previous post). A few new line in the configuration files is all that is needed. To publish (upload-only) my Broker's Topics to the public Broker at iot.eclipse.org, I used the following.

Content of: /etc/mosquitto/conf.d/bridge.conf


connection ebcon.com
address iot.eclipse.org
topic # out 0 "" ebcon.com/



Out-bound topics have "ebcon.com/" pre-pended, currently I do not allow or receive data from iot.eclipse.org directly by my Broker. If I want a topic, I subscribe directly with an application (mosquitto_sub).

My own local Brokers (in three different physical locations) exchange data from the two lesser Brokers in bidirectional fashion. Brokers do not have to be hierarchical, they can be peers. In my case I chose to configure the "bridge" on what I consider the lesser Brokers.



connection remote1
address <remote broker IPA>
topic # both 0



As a test, I created a "JoyStick" control publisher, when the joysticks are moved, all Brokers receive the data, much faster than I expected. Performance is very good. Eventually, I will control remote servos to direct (point) Raspberry PI Cameras.

You can subscribe to my testing with:



$ mosquitto_sub -v -h iot.eclipse.org -t 'ebcon.com/#'




Note: Mosquitto MQTT Brokers can publish any kind of data, including Web Pages and Photos.



I am just learning and having FUN with MQTT !


-- Home Page: https://WA0UWH.blogspot.com

No comments:

Post a Comment