# Develop application sending data to Air Vantage with Legato using MQTT protocol

**URL:** <https://mangoh.discourse.group/t/develop-application-sending-data-to-air-vantage-with-legato-using-mqtt-protocol/899>\
**Category:** mangOH Green\
**Created:** [November 14, 2017, 9:53am UTC](https://mangoh.discourse.group/t/develop-application-sending-data-to-air-vantage-with-legato-using-mqtt-protocol/899 "2017-11-14T09:53:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tctay](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@tctay](https://mangoh.discourse.group/u/tctay)\
**Post date:** [November 14, 2017, 9:53am UTC](https://mangoh.discourse.group/t/develop-application-sending-data-to-air-vantage-with-legato-using-mqtt-protocol/899/1 "2017-11-14T09:53:12Z")

</div>

Hi all,

I am new to Mangoh Green and Legato. I want to develop an application with Lagato framework using MQTT protocol to send sensor data from Mangoh green board to Air Vantage cloud but I do not know how and where to start. I also cannot find any document or guide about using Legato with MQTT. Is there any reference document, guide or sample application about this that I can refer to?

Many thanks!

---

<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 14, 2017, 10:00pm UTC](https://mangoh.discourse.group/t/develop-application-sending-data-to-air-vantage-with-legato-using-mqtt-protocol/899/2 "2017-11-14T22:00:17Z")

</div>

Is there a reason why you want to use MQTT to push the data to AirVantage rather than the COAP based solution provided by `le_avdata`?

---

<div class="post-metadata">

**Author:** ![tctay](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@tctay](https://mangoh.discourse.group/u/tctay)\
**Post date:** [November 16, 2017, 7:10am UTC](https://mangoh.discourse.group/t/develop-application-sending-data-to-air-vantage-with-legato-using-mqtt-protocol/899/3 "2017-11-16T07:10:50Z")

</div>

Hi dfrey, thanks for your reply.

I can find that MQTT protocol is supported with AirVantage. Refer to this [link](https://doc.airvantage.net/av/howto/mqttlens/), we can simulate a device sending data to AirVantage, so I wonder it is possible to write a Legato app for Mangoh Green using MQTT. It’s just my idea to use MQTT as a solution.

Does Legato only provide us COAP based solution?

---

<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 20, 2017, 3:21pm UTC](https://mangoh.discourse.group/t/develop-application-sending-data-to-air-vantage-with-legato-using-mqtt-protocol/899/4 "2017-11-20T15:21:24Z")

</div>

AirVantage supports MQTT, but the Legato application framework doesn’t include anything by default which enables the use of MQTT. That’s why we created the MqttClient app in the mangOH repository. The MqttClient app has two branches (master and use\_paho\_linux). If you’re going with MQTT, then I suggest the use\_paho\_linux branch because it has a more natural API. There are still limitations with our MQTT app. For example, we haven’t had time to figure out how to enable encryption yet. The CoAP based le\_avdata is probably better supported right now, so I suggest that you look at that if you can.
