Amazon AWS IoT with Wipy

Questions and discussion about The WiPy 1.0 board and CC3200 boards.
Target audience: Users with a WiPy 1.0 or CC3200 board.
Post Reply
User avatar
marfis
Posts: 215
Joined: Fri Oct 31, 2014 10:29 am
Location: Zurich / Switzerland

Amazon AWS IoT with Wipy

Post by marfis » Wed Jun 22, 2016 8:44 pm

Is there any information / pointers available on how to hookup the wipy using amazon web services?

I'm aware of a thread using microsoft azure
https://www.pycom.io/connecting-to-microsoft-azure/

and I would give it a try with that tutorial as a start but I thought maybe somebody has already done it?

slzatz
Posts: 92
Joined: Mon Feb 09, 2015 1:09 am

Re: Amazon AWS IoT with Wipy

Post by slzatz » Wed Jun 22, 2016 9:33 pm

My personal experience is that it is easier and cheaper to just run an mqtt broker in the Amazon cloud (or whatever cloud you prefer to use) than to use proprietary AWS services (or at least that's true after the free trial period ends) . You're probably aware that the standard way to interact with many AWS services via python is to use boto/boto3 but that code is never going to fit or run on a microcontroller. The MQTT library that Paul Sokolovsky created is a great starting point for IoT interactions and you can always add whatever database or other applications you need in the cloud. I don't have experience with the WiPy but this approach has worked well with the esp8266.

User avatar
marfis
Posts: 215
Joined: Fri Oct 31, 2014 10:29 am
Location: Zurich / Switzerland

Re: Amazon AWS IoT with Wipy

Post by marfis » Thu Jun 23, 2016 3:48 am

thanks for the feedback!

Maybe my question was misleading.... As you recommend my goal is to use MQTT as a start, using the amazon cloud as broker (not porting boto3).

But I'm worried if the wipy (or the 8266...) can actually do the heavylifting with SSL/TLS certificates. It seems as they have to be placed as DER encoded files in /flash (at least that was the pycoms tutorial says).

If not, I'd be tempted to use a local proxy server like a raspberry pi. Then just place a simple GET request from the wipy and the proxy would translate this to the cloud.

slzatz
Posts: 92
Joined: Mon Feb 09, 2015 1:09 am

Re: Amazon AWS IoT with Wipy

Post by slzatz » Thu Jun 23, 2016 12:54 pm

Have not been using SSL/TLS certificates so sorry no help there.

As to using a raspberry pi or similar full linux system as a proxy -- I have been doing that too for some applications and that works fine including running boto on those systems. For others I've just used the raspberry pi as a local MQTT broker plus whatever additional processing was needed. I should have also said that while I've used a number of AWS services like SQS, DynamoDB, CloudWatch, etc, I actually haven't tried their managed IoT Platform.

digimatic
Posts: 2
Joined: Sat Jun 25, 2016 11:02 am

Re: Amazon AWS IoT with Wipy

Post by digimatic » Sat Jun 25, 2016 11:10 am

Hi I have exactly the same challenge (albeit, ultimately on the development version of the LoPy, but the principle is the same)

I don't want to use a self hosted MQTT gateway due to then needing to handle the scaling and redundancy myself, plus my project is using the device shadows and IoT Rules engine quite extensively and I'd need to also replicate all that.

AWS IoT is pretty much plain jane MQTT and any stock MQTT code should be able to talk to it (not sure where one of the other posters was going with the Boto thing but you certainly don't need that device side to talk to AWS IoT)

The problem is the TLS 1.2 requirement and there at the moment I am a bit stuck.

User avatar
marfis
Posts: 215
Joined: Fri Oct 31, 2014 10:29 am
Location: Zurich / Switzerland

Re: Amazon AWS IoT with Wipy

Post by marfis » Sat Jun 25, 2016 7:19 pm

@digimatic: Where did you get stuck? Did you get an error from the TLS certificate check?

Also i believe it makes a difference if you are using Esp8266 or wipy, as they seem to support ssl differently. However I'm not sure about that, so if anybody can clarify this, that would be great.

As far as I understood, boto only makes sense if you want to admin your things registry via python, instead of the web based interface or cli.

User avatar
marfis
Posts: 215
Joined: Fri Oct 31, 2014 10:29 am
Location: Zurich / Switzerland

Re: Amazon AWS IoT with Wipy

Post by marfis » Fri Jul 08, 2016 11:42 am

to follow up on this:
AWS IoT services require TLS V1.2 (see http://docs.aws.amazon.com/iot/latest/d ... n-iot.html)

TI's simple link docu on the CC3200 seems to indicate that TLS V1.2 is supported: http://processors.wiki.ti.com/index.php ... pplication
By default, SSL 3.0 and TLS 1.2 are enabled..
But I'm not sure if that is the case on the wipy.. The code line here:
https://github.com/micropython/micropyt ... ssl.c#L106
indicate that it is forced to TLS V1.

I could patch that line to use

Code: Select all

SL_SO_SEC_METHOD_SSLv3_TLSV1_2 
but maybe there was a reason not to use that... perhaps @danicampora can you share your thoughts on this?

BTW: I also checked esp8266 support for SSL. The axTLS library used there also seems to be limited to V1.1

User avatar
marfis
Posts: 215
Joined: Fri Oct 31, 2014 10:29 am
Location: Zurich / Switzerland

Re: Amazon AWS IoT with Wipy

Post by marfis » Fri Jul 08, 2016 11:46 am

ok just saw this commit:
https://github.com/micropython/micropyt ... f14e5f724f
where dani indicates that TLS V1 seems to work better for a large range of servers.

Hmm would it be possible to made that configurable?

Post Reply