# MQTT with Legato 16.10.1 SW FX30S

**URL:** <https://forum.legato.io/t/mqtt-with-legato-16-10-1-sw-fx30s/3291>\
**Category:** Uncategorized\
**Created:** [May 22, 2018, 9:53am UTC](https://forum.legato.io/t/mqtt-with-legato-16-10-1-sw-fx30s/3291 "2018-05-22T09:53:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![baiticpruebas](https://avatars.discourse-cdn.com/v4/letter/b/f475e1/32.png) [@baiticpruebas](https://forum.legato.io/u/baiticpruebas)\
**Post date:** [May 22, 2018, 9:53am UTC](https://forum.legato.io/t/mqtt-with-legato-16-10-1-sw-fx30s/3291/1 "2018-05-22T09:53:02Z")

</div>

Hi,

I am trying to do a Legato app that permit the connection of a SierraWireless FX30S to a cloud that uses MQTT. I found some examples but I cant build any of them, neither from Developer Studio nor manually in the FX30S. It exists an example of MQTTClient for the FX30S (with legato 16.10.1) that is functional?

Regards,

Pablo

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [May 23, 2018, 2:17am UTC](https://forum.legato.io/t/mqtt-with-legato-16-10-1-sw-fx30s/3291/2 "2018-05-23T02:17:58Z")

</div>

Which source code are you referring to?

I download the mango source here:  
[https://github.com/mangOH/mangOH/tree/for\_legato\_16.10](https://github.com/mangOH/mangOH/tree/for_legato_16.10)

I can compile it by the following:  
cd /home/owner/legato/packages/legato.framework.16.10.4.wp85-wp750x-201712131342/resources/legato/  
. bin/configlegatoenv  
cd /home/owner/Downloads/mangOH-for\_legato\_16.10/mangOH/  
make --include-dir=$LEGATO\_ROOT wp85

In the manOG\_Green.sdef, mqttclient is included.  
That means we can compile the mqttclient.wp85.update binary.

---

<div class="post-metadata">

**Author:** ![baiticpruebas](https://avatars.discourse-cdn.com/v4/letter/b/f475e1/32.png) [@baiticpruebas](https://forum.legato.io/u/baiticpruebas)\
**Post date:** [May 23, 2018, 11:22am UTC](https://forum.legato.io/t/mqtt-with-legato-16-10-1-sw-fx30s/3291/3 "2018-05-23T11:22:42Z")

</div>

I was trying to use that code [GitHub - startwithsierra/utils-legato-mqtt: Legato MQTT client](https://github.com/startwithsierra/utils-legato-mqtt), but i cant use it from Developer Studio because some libraries cant be linked. The error is:  
“C:\Legato\workspace\pruebaLegatoMqtt/pruebaLegatoMqttComponent/src/json/swir\_json.c:17:32: fatal error: src/json/swir\_json.h: No such file or directory”

The code that you send is like compile a full firmware an install it on the equipment, is that right?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [May 24, 2018, 1:16am UTC](https://forum.legato.io/t/mqtt-with-legato-16-10-1-sw-fx30s/3291/4 "2018-05-24T01:16:25Z")

</div>

I can find the required header file here:

> **[utils-legato-mqtt/mqttComponent/inc/json at master ·...](https://github.com/startwithsierra/utils-legato-mqtt/tree/master/mqttComponent/inc/json)**
>
> master/mqttComponent/inc/json

did you include the correct path when doing complication?

---

<div class="post-metadata">

**Author:** ![baiticpruebas](https://avatars.discourse-cdn.com/v4/letter/b/f475e1/32.png) [@baiticpruebas](https://forum.legato.io/u/baiticpruebas)\
**Post date:** [May 24, 2018, 8:14am UTC](https://forum.legato.io/t/mqtt-with-legato-16-10-1-sw-fx30s/3291/5 "2018-05-24T08:14:28Z")

</div>

I think that the problem is that I forget to add the folder that contains the .h files on properties-\>Legato Application-\>Add Workspace path. Now i added and it seems that everything compiles, but I have another error:  
/tmp/build/mqttService/Target\_Legato\_Debug/staging/read-only/lib/libComponent\_mqttComponent.so: undefined reference to `mqttMain\_getClient’

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [May 24, 2018, 9:21am UTC](https://forum.legato.io/t/mqtt-with-legato-16-10-1-sw-fx30s/3291/6 "2018-05-24T09:21:07Z")

</div>

maybe you can go to mqtt\_service.c and change all the mqttService\_getClient to mqttMain\_getClient

---

<div class="post-metadata">

**Author:** ![baiticpruebas](https://avatars.discourse-cdn.com/v4/letter/b/f475e1/32.png) [@baiticpruebas](https://forum.legato.io/u/baiticpruebas)\
**Post date:** [May 24, 2018, 11:13am UTC](https://forum.legato.io/t/mqtt-with-legato-16-10-1-sw-fx30s/3291/7 "2018-05-24T11:13:37Z")

</div>

That was the problem! Thanks a lot, it seems to be working

---

<div class="post-metadata">

**Author:** ![vlory73](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/vlory73/32/914_2.png) [@vlory73](https://forum.legato.io/u/vlory73)\
**Post date:** [April 1, 2020, 3:05pm UTC](https://forum.legato.io/t/mqtt-with-legato-16-10-1-sw-fx30s/3291/9 "2020-04-01T15:05:08Z")

</div>

> [@jyijyi](#):
>
> maybe you can go to mqtt\_service.c and change all the mqttService\_getClient to mqttMain\_getClient

This should have been marked as the solution.
