MQTT with Legato 16.10.1 SW FX30S


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?



1 Like

Which source code are you referring to?

I download the mango source here:

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.

I was trying to use that code GitHub - startwithsierra/utils-legato-mqtt: Legato MQTT client, 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?

I can find the required header file here:

did you include the correct path when doing complication?

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/ undefined reference to `mqttMain_getClient’

maybe you can go to mqtt_service.c and change all the mqttService_getClient to mqttMain_getClient

1 Like

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

This should have been marked as the solution.