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, I used the following.

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

topic # out 0 ""

Out-bound topics have "" pre-pended, currently I do not allow or receive data from 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 -t ''

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:

No comments:

Post a Comment