Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Arduino and ESP8266 #7

Closed
geovanisouza92 opened this issue Nov 18, 2015 · 67 comments
Closed

Compatibility with Arduino and ESP8266 #7

geovanisouza92 opened this issue Nov 18, 2015 · 67 comments

Comments

@geovanisouza92
Copy link

There is a way to turn this lib compatible with Arduino or ESP8266?

@bhadrip
Copy link
Contributor

bhadrip commented Nov 30, 2015

Hi @geovanisouza92 ,

Can you share which Arduino platform you are looking to port this SDK ?
As mentioned in the Porting Guide this SDK could be ported to any device by providing a TLS network and timer interface.
We have an Arduino SDK for Arduino Yun.

In this post, there are discussions of porting to ESP8266.

Please let us know more about your use case. It will help us answer specific questions.

Thanks
Bhadri

@geovanisouza92
Copy link
Author

@bhadrip thank you for reply. I have Arduino Uno and ESP8266 in mind, standalone or working together. I have made this with MQTT (without client certificate, that seems to be the chalenge) and Node-RED on Bluemix, but I would like to use the AWS IoT, Rules, Lambda, and so on.

@bhadrip
Copy link
Contributor

bhadrip commented Dec 11, 2015

Hi @geovanisouza92 ,

Can you check the post here,
#5 (comment) for some information on ESP8266

Also, We have support only for Arduino Yun which has a 2 processor architecture. python code is running on the OpenWRT side of yun.

Unfortunately we don't have a reference design with Arduino UNO.

Thanks
Bhadri

@Daemach
Copy link

Daemach commented Jan 11, 2016

Not having support for Arduino Uno or ESP8266 Arduino is a serious oversight. The atmega328-based arduino is arguably the most popular/successful microcontroller platform on the planet, and is a perfect fit for 80% of IoT projects out there. ESP8266 costs $2.50 each in sample quantities and does wifi!

This board is driven by an ESP8266: https://dl.dropboxusercontent.com/u/1578778/Pictures/AirNode%20ESP/File%20Oct%2010%2C%202%2059%2016%20PM.jpeg

It has altimeter, barometer, temp and humidity and indoor air quality sensor (I2C), drives an SPI TFT screen and sends data to the internet via wifi (io.adafruit.com currently). But, I can't do anything with Amazon IoT!!!

A REST API for low power devices would be great.

@bhadrip
Copy link
Contributor

bhadrip commented Jan 14, 2016

@Daemach,

Apologies for the inconvenience.
I have passed the information regarding ESP8266 to our Product management team.

As far as the REST API goes, AWS IoT platform already has a REST API that you could use to publish.
More Information about the Rest API could be found here.
An Example curl command to publish on a topic will be something like this:

curl -X POST https://abc.iot.us-east-1.amazonaws.com:8443/topics/myTopic?qos=0 --data "hello" --cacert aws-iot-rootCA.crt --key ./private.pem --cert ./certificate.pem

Thanks
Bhadri

@Daemach
Copy link

Daemach commented Jan 14, 2016

Thanks for the response. I've seen that. The reliance on a certificate is the problem. We cannot use any of your APIs with 8-bit microcontrollers. Support for a simpler data channel using HTTP/S with a key exchanged in the headers would be a lot better for smaller devices. It would be good to have support for HTTP with all of the necessary disclaimers. HTTPS hasn't been fully sorted out across the various wifi adapters yet.

BTW, the ESP8266 is running Arduino software. The most popular Arduino board (Arduino Uno) is based on an ATMega 328, which costs around $3.50 in single quantities. The IoT is going to be based on cheap microcontrollers - why would I want to pay $9-15 (+$2.50-30 for wifi) for a CPU that is just checking temperature/humidity?

Here are more examples:

https://www.arduino.cc/en/Main/Products

https://lowpowerlab.com/shop/Moteino

https://www.adafruit.com/?q=Adafruit%20feather&

https://www.sparkfun.com/categories/103

Thanks for your consideration! AWS IoT is a REALLY exciting prospect, if it becomes usable for microcontrollers, and I'm excited to get started on development.

@badigo
Copy link

badigo commented Jan 21, 2016

+1 , a solution for a low memory device like ESP8266 would be amazing.
Not easy though.

@njvijay
Copy link

njvijay commented Jan 25, 2016

Need solution for esp8266

@dauntlessone
Copy link

The ESP8266 can be programmed either in C with the Arduino IDE or in nodeMCU-LUA, although at least in our case use of C via the Arduino IDE would be preferable.
In any event, the ESP8266 is a very desirable little embedded platform and I am eagerly awaiting an AWS IoT solution.

@comino
Copy link

comino commented Jan 27, 2016

+1 - we need it!

@ctaloi
Copy link

ctaloi commented Feb 10, 2016

+1, came here looking for AWS IOT + ESP2866

@jeanfbrito
Copy link

+1, came here looking for AWS IOT + ESP2866 [2]

@jasonkuehl
Copy link

+1, came here looking for AWS IOT + ESP2866

@vgheo
Copy link

vgheo commented Feb 13, 2016

+1

I think that there is consensus that with the current design (SSL certificates), due to memory requirements, it is virtually impossible to have an application for 8bit MCUs.(e.g. Arduino / ATmega MCUs).

However, using ESP8266 as a stand-alone Arduino target should work as soon as SSL support is added - esp8266/Arduino#43

Am I missing something here ?

@ripple0328
Copy link

+1, came here looking for AWS IOT + ESP2866

@comino
Copy link

comino commented Feb 15, 2016

@vgheo There is already a SSL support for both, SDK and Arduino version!

@vgheo
Copy link

vgheo commented Feb 15, 2016

@comino then what is the point of this issue ?
As I understood issue esp8266/Arduino#43, currently only TLS1.1 is supported, whereas aws iot requires TLS 1.2.

Additionally, my understanding of this SDK's architecture is that it provides an interface for timers and SSL functions, which must be implemented by users for specific platforms. It is not meant to include platform-specific implementations of these interfaces.
If this is correct, then a separate project must be started that provides the required platform dependent layer for esp8266/arduino (for instance..)
Only if there are issues with providing such a layer and actually running an app on top, this issue would be valid.
@bhadrip could you please comment on this?

Has anyone attempted such a port ? Can s/he share the code to seed a community project?

Reading the esp8266/arduino issue, mbedtls requires 2 * 16kb rx/tx buffers, and that is deemed as insufficient in the referenced issue. Still, it might be enough for really simple sensing applications - and would be a decent starting point...

@vgheo
Copy link

vgheo commented Feb 15, 2016

@bhadrip regarding your comment referencing #5.
From that thread:

I'm a maintainer for esp-open-rtos, which is a community-developed FreeRTOS port for the esp8266 microcontroller.

I think that the current issue refers to arduino/esp8266, which is different to esp-open-rtos /esp8266.
They are 2 different platforms, sharing the same hw.

Now it seems that the arduino one currently uses an older library, which cannot satisfy the current requirement of aws-iot of TLS1.2.

Would it be possible to support TLS1.1 ? (At least to make sure this is a no-go)

I'd also like to subscribe the opinions expressed above in that assuming as a minimal aws iot 'thing' the raspberry pi b 2 (1GB, 4cores @900Mhz) is a really big miss.

@arsinio
Copy link

arsinio commented Feb 15, 2016

@vgheo

  • The Arduino project uses the SSL library provided by Espressif...only TLS1.1 is supported
  • esp-open-rtos uses mbedTLS which DOES support TLS1.2.

My understanding is that the TLS1.2 mandate is a security decision by Amazon (one I begrudgingly support). I believe it should be possible to utilize AWS IoT building upon the esp-open-rtos project (something I'm currently working on).

Ultimately 100% agree with you...the AWS IoT concept is awesome, the AWS IoT "embedded" SDK really misses the mark in terms of being targeted at actual embedded hardware. It seems like the originators came from a mobile or embedded linux background rather than a "bare metal" background.

@comino
Copy link

comino commented Feb 15, 2016

As far as I know there is no fundamental limitation to support TLS 1.2, its just that noone took the time to do it.

@arsinio : Arduino is NOT using the ESp implementation. Arduino is using a custom version of axtls !! https://github.com/igrr/axtls-8266 <-- igrr did the port to esp8266 forked from http://axtls.sourceforge.net/

@arsinio
Copy link

arsinio commented Feb 15, 2016

@comino
You are correct, my mistake...

@Daemach
Copy link

Daemach commented Feb 16, 2016

There are 2 problems that prevent the use of AWS IoT for ESP8266 Arduino and pretty much every other 8-bit microcontroller-based device. One is the requirement to either support certificates or use a crypto library to create "signatures" (http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html). The other is TLS 1.2 or higher.

If they allowed TLS 1.1 and added a "pre-shared key" authentication system, similar to the rest of the IoT providers' de-facto standard for devices like these, we could put another billion devices on the net.

AWS IoT supports websockets with MQTT now, which would be really exciting if we could take advantage of it... https://aws.amazon.com/about-aws/whats-new/2016/01/aws-iot-now-supports-websockets-custom-keepalive-intervals-and-enhanced-console/

@comino
Copy link

comino commented Feb 16, 2016

+1 for @Daemach

1 similar comment
@jasonkuehl
Copy link

+1 for @Daemach

@vgheo
Copy link

vgheo commented Feb 16, 2016

@comino , @arsinio
Just for the record - regarding current use of SSL/TLS implementations in the various ESP8266 sdks.

Arduino is NOT using the ESp implementation. Arduino is using a custom version of axtls !!

The Espressif SDK is ALSO using a fork of axTLS:
https://github.com/espressif/ESP8266_RTOS_SDK/blob/master/include/ssl/ssl_ssl.h#L36

But according to the axtls-8266 fork :

Replacement for Espressif's libssl, kept as close as possible to axTLS source. Currently based on axTLS 1.4.9, will be upgraded to 1.5.3.

It looks like esp8266/arduino uses indeed a different fork of axTLS than the espressif one, due to the mentioned reasons..

@gkwicker
Copy link
Contributor

Hi everyone,

Thanks for your input, we are always interested to know which devices people are working with. As vgheo pointed out, this SDK is architecture-independent; any port of this software to a particular architecture will be in a separate project. As an example, this SDK has been successfully ported to a number of similar low-cost/high-volume 802.11 microcontroller designs such as the Marvell MW302, Broadcom BCM4343W, and TI CC3200. These ports are all maintained by their owners in separate repositories; for example, the repository for the Marvell MW302 port is here.

We're also always interested to hear your feature requests, and a change to the service's requirements would be a feature request which couldn't be implemented on the SDK side alone; the best place to let us know about these is the AWS Forums. Thanks again for all your comments and for using AWS IoT.

@gojimmypi
Copy link

+1 on wishing for esp8266 support using mqtt with aws

@EricRohlfs
Copy link

came here looking for AWS IOT + ESP2866 [3]

@ptc-oyifrach
Copy link

+1, came here looking for AWS IOT + ESP2866

2 similar comments
@pdealwis
Copy link

+1, came here looking for AWS IOT + ESP2866

@forthlightning
Copy link

+1, came here looking for AWS IOT + ESP2866

@thiriet
Copy link

thiriet commented Aug 26, 2016

+1 for AWS IOT + ESP2866 support

FYI, Atmel seems to be working on adding TLS1.2 to ESP2866 (Firmware update release is planned for July and postponed to September), but only supporting SHA-384 encryption (not SHA-512).
Not sure if this would be good for AWS IOT SDK integration.

arduino-libraries/WiFi101#48

@copercini
Copy link

Good news: with axTLS update to v2.0.0, the ESP8266 (with arduino IDE) can get support to TLS1.2 and work with AWS iot

https://twitter.com/i_grr/status/766982749865422848
esp8266/Arduino#2436

@copercini
Copy link

ESP8266 is working with TLS1.2 with git version of esp8266/arduino IDE !!!

@villagebike
Copy link

Has anybody got this working with these latest developments?

@thiriet
Copy link

thiriet commented Sep 5, 2016

I don't think the update to axtls-2.0.0 has been merged to master?!?
esp8266/Arduino#2436 has been closed and me-no-dev's branch has been deleted.

@me-no-dev

@copercini
Copy link

copercini commented Sep 5, 2016

@thiriet it was merged here: esp8266/Arduino@c2414a2

@markingle
Copy link

Does anyone know if there is an effort to provide SSL on the server side? I have a need to connect to a SSL web server running on the ESP8266

@me-no-dev
Copy link

axtls-2.0.0 has been merged into ESP8266-Arduino master. I am able to run SSL server (check my ESPAsyncTCP library) though you should limit clients to one or the heap will overflow. Also using SSL server for small packets might be OK, but if you attempt to send a larger file... heap will end.
AxTLS is not written to handle full heap at all so watch out :)

@joekickass
Copy link

@me-no-dev are you sure axtls-2.0.0 has been merged? Seems its still reporting version 1.4.9, see https://github.com/igrr/axtls-8266/blob/master/ssl/version.h

@me-no-dev
Copy link

header was not updated, but yes :) axtls2 is in there

@copercini
Copy link

I have made an implementation of AWS iot using x.509 certificates in ESP8266. The big problem is in TLS v1.2 handshake when the ESP run out of heap =(

If someone is interested, here is the tutorial: https://github.com/copercini/esp8266-aws_iot

@odelot
Copy link

odelot commented Dec 4, 2016

Amazon has a option to use the MQTT broker over websockets. I made a library to use it with ESP8266 and it is stable. It uses TLS 1.1 to connect to the websocket layer and it is not heavy as the TLS 1.2 (esp8266 can handle bigger messages). https://github.com/odelot/aws-mqtt-websockets

@davidmann4
Copy link

+1

@wordyallen
Copy link

@copercini so does that mean that esp can't handle tls 1.2? If so, there's nothing aws can do.

@copercini
Copy link

copercini commented Jan 10, 2017

@wordyallen ESP is working with TLS 1.2 but it runs out of ram during AWS authentication. I think it's possible optimize AXTLS to works fine, because https://github.com/SuperHouse/esp-open-rtos/tree/master/examples/aws_iot is working on same board.

Anyway, ESP32 is working fine with IDF ide

@yipcma
Copy link

yipcma commented Jan 16, 2017

Am here to follow latest development and best approach to developing with the Arduino esp8266

@yelvert
Copy link

yelvert commented Jan 31, 2017

+1 Am wanting to do a Webcam using Arduino Pro Mini + ESP8266 + ArduCAM OV7670

@joeinaustin
Copy link

joeinaustin commented Feb 4, 2017

In trying to make odelot's example work, I am having a problem with the dependent lib https://github.com/svdgraaf/aws-sdk-arduino. Two of the files only contain paths. ESP8266AWSImplentations.cpp and ESP8266AWSImplentations.h in odelot's referenced zip are not actually cpp files. The files only contain a path to "/Users/svdgraaf/Documents/Arduino/Libraries/aws-sdk-arduino/src/esp8266/".

I found possible replacements and am forging ahead.

Thanks

@copercini
Copy link

copercini commented Feb 13, 2017

Working example for ESP32 using Arduino IDE (finally): https://github.com/copercini/esp32-iot-examples/blob/master/ESP32_aws_iot/ESP32_aws_iot.ino

@odelot
Copy link

odelot commented Feb 13, 2017

Hi @joeinaustin you can try this set of libraries https://drive.google.com/open?id=0Bz4aQEzOwPp_a05yRVB2bHZWcVk

@copercini
Copy link

Finally, here it is: https://github.com/copercini/esp8266-aws_iot

@shehrazjazib
Copy link

I have successfully published and subscribe data from aws IoT cloud with esp32 by following this link.
But when i tried to implement Greengrass with esp32, above mentioned solution is failed.
Kindly guide me or share any helping material, so I can implement greengrasss(offline) communication with esp32

@sborsay
Copy link

sborsay commented Jan 31, 2019

A successful port of mbedTLS 12 for esp8266 is in Mongoose OS (Cesanta). This is a free tool and it allows a MQTT connection for AWS IoT and also creates credentials for you through your AWS CLI.

Alternately, as mentioned before, you could host the certificates in Node-Red free trial and connect through any WiFi enabled device on any Arduino (i.e. ESP8266) that can HTTP to Node-Red hosted on the Bluemix cloud or your own webserver with a static IP. Node-Red can then forward that data via port 8883 to AWS IoT core.

Zerynth has a successful TLS1.2 port to AWS IoT Core for the ESP32, but not the ESP8266.

For Greengrass you can any AWS certified device including the ESP32 and also Zerynths Greengrass constrained Python program for the ESP32.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests