Has anyone played with the Red to connect to AWS IoT instead of the AirVantage platform? Google was of no great help! Would love to see a tutorial for doing this. Any pointers welcome.
Thanks in advance
Has anyone played with the Red to connect to AWS IoT instead of the AirVantage platform? Google was of no great help! Would love to see a tutorial for doing this. Any pointers welcome.
Thanks in advance
We use the Mangoh Red and have an option to connect to AWS IoT using certificates as they specify. We started with WolfSSL and created our own variant of MQTT based off the Paho async clients. Our solution is the result of many months of work and was not a simple exercise, but we have what I believe is one of the most stable and best performing solutions out there. We also have created a second security solution that uses the SIM card to generate TLS security credentials. That is our real product. Our solution is really a reference solution that weâve created for the automotive market and it includes a complete set of options including very low power operation, secure software update and our patent pending âquick connectâ solution. We can connect to an idle device in under 3 seconds without an active data session and without SMS messages.
Hi Thanks for the pointers. I had a look at the WolfSSL and there is a WolfMQTT. Wonder why you created your own variant and not use the WolfMQTT? There is also an example of AWS IOT. Did that work for you? Curious to learn more about your experiences
Hi,
You might also want to check this out as it uses AWS.
https://developer.qualcomm.com/project/mangoh-red-smart-home
Regards
Matt
I am trying to use the AWS IoT SDK as an external build and linking into my app. I know if I build the SDK natively and run the sample test files it is working. But when I bring it into the Legato component I am getting build errors. If anyone can help me unlock would appreciate it
mkapp -v -t wp85
linuxApp.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/mangOH/apps/linuxApp/linuxApp.adefâ.
Modelling application: 'linuxAppâ
defined in â/home/mangoh/mangOH/apps/linuxApp/linuxApp.adefâ
Parsing file: â/home/mangoh/mangOH/apps/linuxApp/aws/Component.cdefâ.
Modelling component: âawsâ
found at: â/home/mangoh/mangOH/apps/linuxApp/awsâ
== âawsâ component summary ==
Includes files from the build host:
â/home/mangoh/mangOH/apps/AWSIoTSDK/awsIot/samples/linux/subscribe_publish_sample/subscribe_publish_sampleâ:
appearing inside app as: '/usr/binâ
permissions: execute
Application âlinuxAppâ contains component âawsâ (/home/mangoh/mangOH/apps/linuxApp/aws).
Application âlinuxAppâ contains executable âlinuxAppâ.
Parsing file: â/home/mangoh/mangOH/apps/linuxApp/linuxAppComp/Component.cdefâ.
Modelling component: 'linuxAppCompâ
found at: â/home/mangoh/mangOH/apps/linuxApp/linuxAppCompâ
Parsing file: â/home/mangoh/mangOH/apps/AWSIoTSDK/awsIot/samples/linux/subscribe_publish_sample/Component.cdefâ.
Modelling component: âsubscribe_publish_sampleâ
found at: â/home/mangoh/mangOH/apps/AWSIoTSDK/awsIot/samples/linux/subscribe_publish_sampleâ
== âsubscribe_publish_sampleâ component summary ==
Includes files from the build host:
â/home/mangoh/mangOH/apps/AWSIoTSDK/awsIot/samples/linux/subscribe_publish_sample/subscribe_publish_sampleâ:
appearing inside app as: â/usr/binâ
permissions: execute
== âlinuxAppCompâ component summary ==
C sources:
â/home/mangoh/mangOH/apps/linuxApp/linuxAppComp/linuxAppComp.câ
Depends on components:
'subscribe_publish_sampleâ
Executable âlinuxAppâ in application âlinuxAppâ contains component âlinuxAppCompâ (/home/mangoh/mangOH/apps/linuxApp/linuxAppComp).
== âlinuxAppâ application summary ==
Uses components:
âawsâ
âlinuxAppCompâ
'subscribe_publish_sampleâ
Builds executables:
'linuxAppâ
Instantiates components:
âsubscribe_publish_sampleâ
'linuxAppCompâ
Runs inside a sandbox.
Has the following limits:
maxSecureStorageBytes: 8192
maxThreads: 20
maxMQueueBytes: 512
maxQueuedSignals: 100
maxMemoryBytes: 40960000
cpuShare: 1024
maxFileSystemBytes: 131072
Has access to the following configuration trees:
Its own tree: read + write
Will only start when requested to start.
When started, will run process: 'linuxAppâ
Executing file: 'linuxAppâ
Without any command line arguments.
With the following environment variables:
PATH=/usr/local/bin:/usr/bin:/bin
Fault recovery action: ignore (default)
Watchdog timeout: disabled
With the following limits:
Max. core dump file size: 102400 bytes
Max. file size: 102400 bytes
Max. locked memory size: 8192 bytes
Max. number of file descriptors: 256
Executable âlinuxAppâ:
Generating interfaces.h for component âlinuxAppCompâ in â_build_linuxApp/wp85/component/89207388a079506e6139546b7bd788c8/src/interfaces.hâ.
Generating component-specific IPC code for component âlinuxAppCompâ in â_build_linuxApp/wp85/component/89207388a079506e6139546b7bd788c8/src/_componentMain.câ.
Generating system configuration data for app âlinuxAppâ in file â_build_linuxApp/wp85/app/linuxApp/staging/root.cfgâ.
Generating startup code for executable âlinuxAppâ (app/linuxApp/staging/read-only/bin/linuxApp) in â_build_linuxApp/wp85/app/linuxApp/src/linuxApp/_main.câ.
Generating ninja build script: â_build_linuxApp/wp85/build.ninjaâ.
Executing ninja build systemâŚ
$ ninja -v -d explain -f _build_linuxApp/wp85/build.ninja
ninja: warning: multiple rules generate /home/mangoh/mangOH/apps/AWSIoTSDK/awsIot/samples/linux/subscribe_publish_sample/subscribe_publish_sample. builds involving this target will not be correct; continuing anyway
ninja explain: output awsExternalBuild_line0 doesnât exist
ninja explain: awsExternalBuild_line0 is dirty
ninja explain: depfile â_build_linuxApp/wp85/component/89207388a079506e6139546b7bd788c8/obj/ae347cb872d52c8c76f8c392dba5558c.o.dâ is missing
ninja explain: output subscribe_publish_sampleExternalBuild_line0 doesnât exist
ninja explain: subscribe_publish_sampleExternalBuild_line0 is dirty
ninja explain: subscribe_publish_sampleExternalBuild is dirty
ninja explain: _build_linuxApp/wp85/component/89207388a079506e6139546b7bd788c8/obj/ae347cb872d52c8c76f8c392dba5558c.o is dirty
ninja explain: depfile â_build_linuxApp/wp85/component/89207388a079506e6139546b7bd788c8/obj/_componentMain.c.o.dâ is missing
ninja explain: _build_linuxApp/wp85/component/89207388a079506e6139546b7bd788c8/obj/_componentMain.c.o is dirty
ninja explain: subscribe_publish_sampleExternalBuild is dirty
ninja explain: subscribe_publish_sampleExternalBuild is dirty
ninja explain: _build_linuxApp/wp85/staging/read-only/lib/libComponent_linuxAppComp.so is dirty
ninja explain: _build_linuxApp/wp85/app/linuxApp/staging/read-only/lib/libComponent_linuxAppComp.so is dirty
ninja explain: /home/mangoh/mangOH/apps/AWSIoTSDK/awsIot/samples/linux/subscribe_publish_sample/subscribe_publish_sample is dirty
ninja explain: _build_linuxApp/wp85/app/linuxApp/staging/read-only/usr/bin is dirty
ninja explain: depfile â_build_linuxApp/wp85/app/linuxApp/obj/linuxApp/_main.c.o.dâ is missing
ninja explain: _build_linuxApp/wp85/app/linuxApp/obj/linuxApp/_main.c.o is dirty
ninja explain: _build_linuxApp/wp85/staging/read-only/lib/libComponent_linuxAppComp.so is dirty
ninja explain: _build_linuxApp/wp85/app/linuxApp/staging/read-only/bin/linuxApp is dirty
ninja explain: _build_linuxApp/wp85/app/linuxApp/staging/info.properties is dirty
[1/11] cd ./_build_linuxApp/wp85/component/82a06889c6b3cf01d0a01301c07f2c57; env CFLAGS="âsysroot=/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi -I ./_build_linuxApp/wp85 -I/home/mangoh/legato_framework/legato/interfaces -I/home/mangoh/legato_framework/legato/framework/c/inc -I/home/mangoh/mangOH/apps/linuxApp" CXXFLAGS="âsysroot=/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi -I ./_build_linuxApp/wp85 -I/home/mangoh/legato_framework/legato/interfaces -I/home/mangoh/legato_framework/legato/framework/c/inc -I/home/mangoh/mangOH/apps/linuxApp" LDFLAGS="âsysroot=/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi " PATH="/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:$PATH" sh -c âmakeâ
[2/11] /opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc --sysroot=/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi -MMD -MF _build_linuxApp/wp85/component/89207388a079506e6139546b7bd788c8/obj/_componentMain.c.o.d -c _build_linuxApp/wp85/component/89207388a079506e6139546b7bd788c8/src/_componentMain.c -o _build_linuxApp/wp85/component/89207388a079506e6139546b7bd788c8/obj/_componentMain.c.o -DLE_FILENAME=basename _build_linuxApp/wp85/component/89207388a079506e6139546b7bd788c8/src/_componentMain.c
-Wall -fPIC -Werror -fvisibility=hidden -DMK_TOOLS_BUILD -DLEGATO_EMBEDDED -I ./_build_linuxApp/wp85 -I/home/mangoh/legato_framework/legato/interfaces -I/home/mangoh/legato_framework/legato/framework/c/inc -I/home/mangoh/mangOH/apps/linuxApp -I./_build_linuxApp/wp85/component/89207388a079506e6139546b7bd788c8/src -I/home/mangoh/mangOH/apps/AWSIoTSDK/awsIot/samples/linux/subscribe_publish_sample -I./_build_linuxApp/wp85/component/7b588f83d063b84d1da636a389259450 -DLE_COMPONENT_NAME=linuxAppComp -DLE_LOG_SESSION=linuxAppComp_LogSession -DLE_LOG_LEVEL_FILTER_PTR=linuxAppComp_LogLevelFilterPtr â-DCOMPONENT_INIT=LE_CI_LINKAGE LE_SHARED void _linuxAppComp_COMPONENT_INIT()â
[3/11] cd ./_build_linuxApp/wp85/component/7b588f83d063b84d1da636a389259450; env CFLAGS="âsysroot=/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi -I ./_build_linuxApp/wp85 -I/home/mangoh/legato_framework/legato/interfaces -I/home/mangoh/legato_framework/legato/framework/c/inc -I/home/mangoh/mangOH/apps/linuxApp" CXXFLAGS="âsysroot=/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi -I ./_build_linuxApp/wp85 -I/home/mangoh/legato_framework/legato/interfaces -I/home/mangoh/legato_framework/legato/framework/c/inc -I/home/mangoh/mangOH/apps/linuxApp" LDFLAGS="âsysroot=/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi " PATH="/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:$PATH" sh -c 'makeâ
FAILED: cd ./_build_linuxApp/wp85/component/7b588f83d063b84d1da636a389259450; env CFLAGS="âsysroot=/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi -I ./_build_linuxApp/wp85 -I/home/mangoh/legato_framework/legato/interfaces -I/home/mangoh/legato_framework/legato/framework/c/inc -I/home/mangoh/mangOH/apps/linuxApp" CXXFLAGS="âsysroot=/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi -I ./_build_linuxApp/wp85 -I/home/mangoh/legato_framework/legato/interfaces -I/home/mangoh/legato_framework/legato/framework/c/inc -I/home/mangoh/mangOH/apps/linuxApp" LDFLAGS="âsysroot=/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi " PATH="/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:$PATH" sh -c 'makeâ
make[1]: Entering directory '/home/mangoh/mangOH/apps/linuxApp/_build_linuxApp/wp85/component/7b588f83d063b84d1da636a389259450â
make[1]: *** No targets specified and no makefile found. Stop.
make[1]: Leaving directory '/home/mangoh/mangOH/apps/linuxApp/_build_linuxApp/wp85/component/7b588f83d063b84d1da636a389259450â
FAILED: cd ./_build_linuxApp/wp85/component/82a06889c6b3cf01d0a01301c07f2c57; env CFLAGS="âsysroot=/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi -I ./_build_linuxApp/wp85 -I/home/mangoh/legato_framework/legato/interfaces -I/home/mangoh/legato_framework/legato/framework/c/inc -I/home/mangoh/mangOH/apps/linuxApp" CXXFLAGS="âsysroot=/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi -I ./_build_linuxApp/wp85 -I/home/mangoh/legato_framework/legato/interfaces -I/home/mangoh/legato_framework/legato/framework/c/inc -I/home/mangoh/mangOH/apps/linuxApp" LDFLAGS="âsysroot=/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi " PATH="/opt/swi/y17-ext/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:$PATH" sh -c 'makeâ
make[1]: Entering directory '/home/mangoh/mangOH/apps/linuxApp/_build_linuxApp/wp85/component/82a06889c6b3cf01d0a01301c07f2c57â
make[1]: *** No targets specified and no makefile found. Stop.
make[1]: Leaving directory '/home/mangoh/mangOH/apps/linuxApp/_build_linuxApp/wp85/component/82a06889c6b3cf01d0a01301c07f2c57â
ninja: build stopped: subcommand failed.
Makefile:7: recipe for target âwp85â failed
make: *** [wp85] Error 1
Iâm not sure what the problem is. Can you provide the source code for the project you are trying to build? If you can do that, then I will try to build it myself and try to work through any errors.
Hello David
Its not the same error any more, but I am still getting errors. Also Iâm not sure if I am using the DataServices call le_data correctly. Happy to receive your input. The file is attached
ThanksMo
RedToAWS.zip (857 KB)
I have made some progress and now able to load the software on the board but coming across with some stability issues.
So seeing a number of issues here.
First I packaged the application within the system build. When I installed the Red system package, my app didnât show up with âapp statusâ. Also when I make clean the files donât get removed. Iâm guessing may be a sdef configuration issue.
Second, When I didnât see any activity on the log from the app, I then attempted to update the app, but the software informs me that this is already installed and wonât do anything more.
Third, I am attempting to load by the App certain certificate files. On my development environment this is easily detected, but when I try to replicate the same structure, it doesnât work. So I then try to specify a location on the target and it appears that application doesnât find these files.
Fourth I can see that the application doesnât like my attempt to establish a data connection. Iâm at a loss as to why and I canât get to the AWS servers.
Lastly I havenât been able to trace why the application is closed down.
Any suggestions on how to move forward would be most appreciated as I have exhausted all thoughts
If this is a tools/versions mismatch issue please help with links to matching software versions as I have spent the best part of 2 days trying combinations to get past various uid mismatch errors
I have highlighted the concerning areas on the attached log file.
Log dump 1812.pdf (267.4 KB)
OK I have progressed now and able to subscribe and publish but at some expense. I wanted to sandbox the application so that it has access to whatever data connection that already exist. For whatever reason the application doesnât like being sandboxed and doesnât show up on the app list. My other problem is that the app wont auto start. The app also doesnât like being a standalone App. That is it wonât start a data connection which is still puzzling me. Perhaps its because its a legacy App and not a Legato App, but I do get connectivity if I have another Legato App not sandboxed started before the legacy App. It means I have to manually start both apps now. Any suggestions to automate the process and also work inside the sandbox is welcome.
Hi @mohamid, can you publish a tutorial/wiki page so others can follow what you did? Other members who are interested might be able to provide more insights as well.
Hello chucklink,
I would like to know if you can share with me the code of the connectivity for the MangOH RED with the AWS IOT.
Thank you
Hi mohamid,
Can you share some tutorials/additional comments how to install this SDK on MangOH red?