# An update on MQTT support

**URL:** <https://mangoh.discourse.group/t/an-update-on-mqtt-support/952>\
**Category:** Uncategorized\
**Created:** [November 30, 2017, 10:51pm UTC](https://mangoh.discourse.group/t/an-update-on-mqtt-support/952 "2017-11-30T22:51:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [November 30, 2017, 10:51pm UTC](https://mangoh.discourse.group/t/an-update-on-mqtt-support/952/1 "2017-11-30T22:51:14Z")

</div>

I have done a bit of work on the use\_paho\_linux\_version branch of the MqttClient app. I have enabled TLS support for for server side certificates. What this means is that if you specify your URI as `ssl://eu.airvantage.net:8883` instead of `tcp://eu.airvantage.net:1883` your messages will be encrypted. I have only tested this with the AirVantage MQTT broker, but I would expect it to work for others as well.

Unfortunately, the ArduinoBridge app used on mangOH Green depends on the DataRouter app which depends on the API exposed by the master branch of MqttClient. This makes it difficult to promote the use\_paho\_linux\_version branch to become master until the DataRouter can be updated. I think the DataRouter update requires quite a bit of work, so I don’t know when that will happen.

If you’re interested in contributing to the mangOH project and you want something small to start out on, take a look at trying to add support for “will” messages to the use\_paho\_linux\_version branch of MqttClient.

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [December 4, 2017, 11:29pm UTC](https://mangoh.discourse.group/t/an-update-on-mqtt-support/952/2 "2017-12-04T23:29:31Z")

</div>

Another small update…

I have updated the `use_paho_linux_version` branch of `MqttClient` to make use of the [`externalBuild` feature in the `Component.cdef`](http://legato.io/legato-docs/latest/defFilesCdef.html#defFilesCdef_externalBuild). What this means is that it’s not longer necessary to run a separate command to build the paho library before trying to build the `MqttClient` app. Now `mksys` or `mkapp` will build it automatically.

---

<div class="post-metadata">

**Author:** ![dingo](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@dingo](https://mangoh.discourse.group/u/dingo)\
**Post date:** [December 17, 2017, 6:06pm UTC](https://mangoh.discourse.group/t/an-update-on-mqtt-support/952/3 "2017-12-17T18:06:27Z")

</div>

seems like its not completely there doing a make green\_wp85 however i can build and install it manually from the apps/MqttClient directory

make green\_wp85  
mksys -t wp85 -s /home/dingo/mangOH/apps/GpioExpander/gpioExpanderService mangOH\_Green.sdef  
\*\* Warning: Ignoring empty app specification  
\*\* Warning: Ignoring empty app specification  
\*\* ERROR:  
/home/dingo/mangOH/apps/MqttClient/mqttClientService/Component.cdef:11:8: error: Couldn’t find component ‘pahoLegatoComponent’.  
Makefile:22: recipe for target ‘green\_wp85’ failed  
make: \*\*\* [green\_wp85] Error 1

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [December 18, 2017, 7:59pm UTC](https://mangoh.discourse.group/t/an-update-on-mqtt-support/952/4 "2017-12-18T19:59:40Z")

</div>

@dingo,

I forgot to mention that in order to make the system build, you will have to remove dataRouter from the system and add an entry to the `Makefile`. In the `Makefile`, you need to add `-s $(MANGOH_ROOT)/apps/MqttClient` in `MKSYS_ARGS_COMMON` so that `mksys` knows how to find the `pahoLegatoComponent` component.

---

<div class="post-metadata">

**Author:** ![dingo](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@dingo](https://mangoh.discourse.group/u/dingo)\
**Post date:** [December 21, 2017, 10:36am UTC](https://mangoh.discourse.group/t/an-update-on-mqtt-support/952/5 "2017-12-21T10:36:20Z")

</div>

> [@dfrey](#):
>
> add -s $(MANGOH\_ROOT)/apps/MqttClient

so it appears not only do you need to remove DataRouter, but also anything that depends on it  
ie… ArduinoTools and Dr… there should really be a way to do this without loosing functionalities

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [December 21, 2017, 5:18pm UTC](https://mangoh.discourse.group/t/an-update-on-mqtt-support/952/6 "2017-12-21T17:18:59Z")

</div>

I mentioned that issue in the original post. Currently, I think the `use_paho_linux_version` is a better MQTT client, but it means that you can’t use the DataRouter and thus can’t use the ArduinoBridge.
