Mangoh-to-gcloud

*** I also submitted this to the legato forum ***

Hi – I’m new to the MangOH Red and Legato platform. I’ve successfully completed the mangOH Red Getting Started Tutorial. I updated my Legato Application Framework to version 17.09.0 and successfully ran the HelloWorld and RedSensorToCloud applications. My project requires that I send MQTT messages directly to Google Cloud IoT. I found this tutorial (https://github.com/startwithsierra/mangoh-to-gcloud/tree/red) but I’m getting build errors.

  1. A prerequisite is to install the MQTT client Legato application (page 2). I found this at https://github.com/nhonchu/mqttClient-for-Legato. I downloaded the files to ~/legato_framework/legato/apps/sample/mqttClient. I ran cfglegato and make wp85. The build finished with this error: “Unrecognized section name ‘provides’”.

  2. Next, I tried to build the mangoh-to-gcloud application. I downloaded the files to ~/legato_framework/legato/apps/sample/mangohToGCloud. I ran cfglegato and make wp85 (page 13). The build finished with this error: “Unrecognized section name ‘assets’”.

How do I resolve these errors?

*** mqttClient Build Output ***
mangoh@mangoh-virtualbox:~/legato_framework/legato/apps/sample/mqttClient$ make wp85
export TARGET=wp85 ;
mkapp -v -t wp85
-i /home/mangoh/legato_framework/legato/interfaces/dataConnectionService
-i /home/mangoh/legato_framework/legato/interfaces/modemServices
-i mqttClientComp/inc
-i mqttClientComp/inc/mqtt
mqttClient.adef
C compiler = /opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
C++ compiler =/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
Compiler sysroot = /opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi
Linker = /opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-ld
Static lib archiver = /opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-ar
Assembler = /opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-as
Debug symbol stripper = /opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-strip
Object file copier/translator = /opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-objcopy
ELF file info extractor = /opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-readelf
Command-line arguments from previous run not found.
Parsing file: ‘/home/mangoh/legato_framework/legato/apps/sample/mqttClient/mqttClient.adef’.
** ERROR:
/home/mangoh/legato_framework/legato/apps/sample/mqttClient/mqttClient.adef:41:8: error: Unrecognized section name ‘provides’.
Makefile:7: recipe for target ‘wp85’ failed
make: *** [wp85] Error 1


*** mangoh-to-gcloud Build Output ***
mangoh@mangoh-virtualbox:~/legato_framework/legato/apps/sample/mangohToGCloud$ make wp85
mkapp -v -t wp85
-i myComponent/utils
mangohToGCloud.adef
C compiler = /opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
C++ compiler =/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
Compiler sysroot = /opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi
Linker = /opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-ld
Static lib archiver = /opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-ar
Assembler = /opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-as
Debug symbol stripper = /opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-strip
Object file copier/translator = /opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-objcopy
ELF file info extractor = /opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-readelf
Command-line arguments from previous run not found.
Parsing file: ‘/home/mangoh/legato_framework/legato/apps/sample/mangohToGCloud/mangohToGCloud.adef’.
Modelling application: 'mangohToGCloud’
defined in '/home/mangoh/legato_framework/legato/apps/sample/mangohToGCloud/mangohToGCloud.adef’
Application ‘mangohToGCloud’ contains executable ‘mangohToGCloud’.
Parsing file: ‘/home/mangoh/legato_framework/legato/apps/sample/mangohToGCloud/myComponent/Component.cdef’.
** ERROR:
/home/mangoh/legato_framework/legato/apps/sample/mangohToGCloud/myComponent/Component.cdef:51:6: error: Unrecognized section name ‘assets’.
Makefile:29: recipe for target ‘wp85’ failed
make: *** [wp85] Error 1


Thanks ,

Troy

Hi Troy, I have been trying the same example for quite some time now. Yet to get it up and running.

assets section is no longer supported, thats what I learned from this on legato.io website

And looking at the same source, it looks like your provides section should be in the .cdef file instead of .adef.

Hope this helps to at least compile the project.

Either you can rollback to legato-16.10.1 (along with toolchain and device firmware) or you can change the example for your legato compatibility.

@majditoumi can you please comment on this?

Hi, we actually discussed about this by e-mail with @WedaPashi.
I’m going to resolve some issues asap with a specific ReadMe file to explain all steps around mqtt client, jwt library, etc.

There is also some issues with the Legato version.
I will notify here when the update is push on github.

1 Like

@majditoumi @asyal

Hey, thanks for responding!
I did go on to rollback everything (including toolchain and firmware on mangOH Green board) to legato-16.10.1.
I managed to get the MQTT Client working. Now, I am trying to figure out how to get around the jwt-cpp library and the implicit dependencies it has on OpenSSL.

@majditoumi could we investigate allowing this app to work with latest legato release as well. Can you dig into that?

@asyal and @majditoumi:

I appreciate your support for this so far.

There are issues with dependencies in example that seemed to be compatible with older legato version (legato-16.01.3 for that matter), although no longer compatible now that external libraries have changed to a greater extent.
It would indeed help to have a completely functional sample application which gets connected to google cloud, based on legato-16.01.3, with all the dependencies clearly stated and provided with.

This could make life easy to port a functional example with all the dependencies well-sorted, to a higher/latest legato version.

@cchins: You might want to follow this discussion.

Sure @asyal, I’m on it, I’m going a new version with all issues fixed. Don’t worry about that @WedaPashi.

You’ll have access to the latest legato version API.

2 Likes

Hi - Thank you for working on this project. majditoumi, do you have an estimated date when the new version will be released?

Troy

So currently this is broken?

Hi @majditoumi - I’m just following up on when the new version will be released?

Thanks

Troy

Hey @Troy1, sorry about the delay.
A new developer is going to fix this current repository.

I’m actually working around a new mangoh-to-gcloud project without any dependency.
I’ll post the link here and I’ll fix this one if not yet :wink:

Hi,
whats the status of the new mangoh-to-gcloud project with all dependencies. I am working on that at present there are many compatibility issues in present repository.

Any updates on the mangoh-to-gloud project? @majditoumi

Hey all,

Has anyone here considered using Google Cloud Functions + AirVantage pubsub connector? I’ve really been enjoying this solution for a few reasons:

  1. You still get the highly integrated AirVantage features such as over the air updates.
  2. You can still use all the nice native APIs/services in Legato.
  3. It’s very simple to handle incoming data. Google Cloud Functions allows you to specify a simple callback function to handle all incoming data.

If anyone is curious about how we have this setup, let me know and I can provide some sample code (in TypeScript).
Cheers!

Hey @nick

We tried this for a bit and it worked ok. But sending our data through Airvantage was way to expensive! Today we use airvantage only for software updates and SIM card activation and send our data with mqtt via our own server to google cloud.

We would like to send the data directly to gcloud with mqtt but have not had the time to implement it. majditoumi example is broken (not working with legato 18.x) and I guess he has changed his job?

Maybe using this https://github.com/GoogleCloudPlatform/cpp-docs-samples/tree/master/iot/mqtt-ciotc
google sample is the way to go?

Hey @nilsarve,

Definitely looks promising, keep us posted about how it goes!

Cheers!

Hello guys,

You’re right @nilsarve, the issue is on the Legato version. I can’t take a look at the code right now but I will try to fix it as soon as possible to allow sending data through gcloud.

@majditoumi

Has there been any further progress with this.

Kas

Hi Nick!
How much did you pay to declair your topic in Airvantage? I heard that this connector is an additional service so you need to pay for it.
BTW, I am also researching about transfering raw data from Airvantage to Google Cloud Platform for storage and analysis. If you have any referrences, please let me know. I appriciate your kind help.
Best regards,
Thuc.