MQTT/TLS AWS IoT implementation in Atmel WINC1500 + SAMD21 Development Board

1,329 views
Skip to first unread message

Jon M.

unread,
Nov 6, 2015, 1:13:03 PM11/6/15
to MQTT
Hi All! :D

So, I'm beginning with C/C++ development for that evaluation kit with Atmel Studio as IDE. I want to stablish a MQTT/TLS connection between the AWS Endpoint configured, with that Atmel microcontroller. So I want to use the AWS IoT Embedded C SDK with this unofficial microcontroller solution.

Given the resource from Amazon Web Services, already have the Embedded C SDK downloaded, have read the docs, and so a few Atmel ones in order to get started.

But the issue here is:

 - I don't have any idea of where to put the SDK directories and/or the different files among the "solution" (project) tree in order to put the #include statements to work.
 - How to put to a good use the Embedded C SDK in a generic way so it can be used with almost any microcontroller solution other than the AWS official ones.

Notice again, that I haven't worked with C/C++ before... To much Java for me until these times. 

Thanks a lot for your time!

Yours, faithfully, Jon.

John Rotach

unread,
Nov 7, 2015, 5:26:23 PM11/7/15
to MQTT
Hello Jon,

I'd recommend tackling this in stages.  The C SDK comes with a port to Linux/POSIX platforms so you can get started without having to immediately port the SDK to your target embedded board.  If you have Linux or OS X, I'd recommend trying out the SDK on one of those platforms to familiarize yourself with the SDK, the service, and developing in C.

After you are comfortable with this you can start the task of porting to your particular board.  Note that the act of porting will involve writing some driver code that will present your underlying TCP/IP stack and timers to the interface expected by the SDK.  An overview of porting can be found online (https://github.com/aws/aws-iot-device-sdk-embedded-C/blob/master/PortingGuide.md) as well as in the docs directory of your downloaded SDK.

The AWS IoT forum has some good questions surrounding using the service and the SDKs.  It can be found here: https://forums.aws.amazon.com/forum.jspa?forumID=210.

Best of luck with your project!

John
AWS IoT

Jon M.

unread,
Nov 10, 2015, 11:02:11 AM11/10/15
to MQTT
Hi John and all! Thanks a lot for your wishes, time and consideration for answering!!! :D

As you said, I'm getting used to the platform with a Raspberry Pi indeed, however, this solution is quite high-level and has its own organization as stated in docs when create and managing directories, libraries, scripts and so on. Regardless working with mqtt clients, node SDK solution or the actual Embedded C platform.

The porting overview is quite clear if working with high-level or supported embedded platforms, like Intel Edison, Beaglebone, etc... Furthermore, there are recipes of getting the boards up with their own instructions and stuff, from those specific embedded platforms providers.

The thing here is, given the structure of a project that can be either C or C++, even an Arduino sketch import, I'm thinking that the Atmel board has its own project structure (I can be highly mistaken) and the issue is that given the structure of that kind of project I must be able to port the SDK into it.

The structure of a project for that platform is the following:

+ Solution 'The_Example_Project'
    + The_Example_Project
        - Dependencies 
        - Output Files
        + Libraries
            - libarm...
            - another_lib
            - and_another_for_MQTT
        + src
            + ASF (Atmel Software Framework)
                - directories_of_specific_Atmel_solutions
            + config
                - some_config_.h_files
            + iot
                + mqtt
                    - mqtt_library_.a_extension
                    - mqtt_script_.h_extension
                - streaming_.c_script
                - streaming_.h_script
                - timer_.c_script
                - timer_.h_script
            - asf.h
            - main.h
            - main21.h

And that's about it, Any idea of how to port the SDK the right way? Does it need to be at some specific directiry path at a project? I understand some code for porting must be written and that I'm skipping stuff or missing information. I might be asking for a lot, But I just need the quite simple frame of how the things can be done in a generic or specific way (if necessary), in order to get started with that embedded solution, which is the WINC1500 with the SAMD21 Xplained Board.

I'll keep hitting the Embedded Linux C while I learn things from that implementation and the Atmel documentation in order to make that board talk to the AWS endpoint.

Any suggestion, comment, hint, is well welcomed! ( ^-^)/

Thanks a lot, good vibes and will keep in touch here at the forums! [:

Yours faithfully, Jon.

Jon M.

unread,
Nov 18, 2015, 5:52:03 PM11/18/15
to MQTT
Hi All Again!

Well, been playing around with the hardware for a while and digging up some info about authentication methods, server, client-server, and stuff... And it seems that the Atmel board doesn't want any other certificates but the root CA type, not client, neither keys (even if converted to DER type, both client certificate and its key with extension *.cer). I'm still searching a workaround meanwhile I get a closer idea of how can that hardware board work with client cert-key files.


Thanks a lot for your time! :D

Raja Rashid

unread,
May 10, 2016, 5:23:34 AM5/10/16
to MQTT
Hi John
I am also going to try this AWS thing in the same platform, Please let me know how you moved forward to work it out.

Jon M.

unread,
May 11, 2016, 12:46:51 PM5/11/16
to MQTT
Hi Raja and community!

The implementation of the TLS mutual auth for the communication flow, from TCP/IP to application layer is, or was natively supported by both parties, Atmel and Amazon.

It's like some sort of strategy campaign, a lot of work indeed. So, Atmel is currently working on making possible the mutual authentication flow that Amazon needs in order
to give access to messages from the end devices. The CSR generation and other demons. From Amazon, they discovered that some enhacements were needed in order 
to satisfy Atmel requirements as well in the exchange of data for validated certificate delivery.

Atmel suggested working on the SAM4S, because of memory issues that can have the platform more loose in that context. But as we are working in the integration of other services
and communications stated by business rules, and we kept working with the SAMD21 at least in this product phase, so the solution is gonna be pretty tight. It's been a lot of time 
since the issue showed up, and both, Atmel and Amazon are still working out that stuff.

So, if we have more news, will be updating this thread. Meanwhile I can suggest to test the communication flow with a local MQTT server with Mosquitto, can be at the local PC, 
or in a Raspberry Pi in order to have adressing at scope and see how it works. That is made of course, without any secure protocol, and that's why its local, if want to test with another
online broker, just take the adequate precautions.

Wish the best  to all!

Kind regards,

Jon M.

Ayman Rjab

unread,
May 27, 2016, 10:43:46 AM5/27/16
to MQTT

Hi all,

 

Please, I need to know if the WINC1500 is capable of handle client certificates and private keys? if so, does any one know how could I program my client certificate and the private key to the WINC1500 module ?

 

Many thanks in advance.

Message has been deleted
Message has been deleted

Ahmed Ismail

unread,
Jul 19, 2016, 3:24:39 PM7/19/16
to MQTT
What is FW version you are using?
Message has been deleted

Jon M.

unread,
Jul 19, 2016, 3:37:23 PM7/19/16
to MQTT
Hi All! :D

The topic continued here, since google deleted two of my rresponse attempts to Ayman back then.

Ahmed, if you have or want to add something, please let us know!

Good vibes to everyone!

Kind regards,

Jon M.
Reply all
Reply to author
Forward
0 new messages