parse-community / parse-embedded-sdks

The Embedded SDKs for the Parse Platform
http://parseplatform.org
Other
246 stars 118 forks source link

Request: ESP8266 Version Please #5

Closed chall3ng3r closed 8 years ago

chall3ng3r commented 9 years ago

There is a new phenomenon currently getting good hype and worked on, ESP8266 which is full-fledged 32bit SoC with WiFi built-in. It's more powerful (speed + flash storage) than regular Arduino Mini Pro or even Mega 2560, and the size of it makes it really ideal for standalone IoT devices.

There are many modified firmwares for it with added functionality, and some like NodeMCU (LUA runtime with a file system). I've been playing around with it, and pretty impressed.

I believe a Parse SDK for ESP8266 would be really useful for many IoT developers like myself.

// chall3ng3r //

abl commented 9 years ago

:+1: currently sitting at the F8 garage and working on it.

There are a number of issues around the ESP8266 but it's a pretty amazing platform - it's most comparable to the CC3200, which is supported. Major blocker is SSL/TLS support, which is available but apparently broken since ESP8266 SDK rev 0.92 or so.

chall3ng3r commented 9 years ago

Thanks for your reply. The latest ESPSDK is 0.95, I will check if they have fixed SSL/TLS in it.

CC3200 is a expensive ~10$/unit compared to ~2$/unit of ESP8266 01. If we make something for mass production, it impacts the cost of hardware big time.

For now, I am going to experiment using Parse's REST APIs from ESP8266 with NodeMCU. I hope Parse team work with ESP8266 community and bring a native solution soon.

// chall3ng3r //

abl commented 9 years ago

Latest ESP SDK is actually v1.0.0 (possibly 0.9.9? I'm seeing conflicting version numbers) - I was able to build, after quite a bit of hacking, a few things with it - including SSL support. Limited, but there - particularly, asking it to validate a full certificate chain makes it fall over. Self-signed 1024-bit certs appears to be the maximum. (For reference, api.parse.com is sending me a 2048-bit key - https://www.ssllabs.com/ssltest/analyze.html?d=api.parse.com&s=54.152.176.8&hideResults=on)

The ESP SDK's SSL appears to be based on axTLS (so no TLS v1.2, ECC, DES/3DES, etc.) Furthermore, the SSL calls provide no feedback - no way to do certificate pinning, know what cipher you're using, etc. This is all in the closed-source blob, so I don't think it's 3rd-party-fixable.

The ESP SDK does include Lwip, so there's a chance someone can get, say, WolfSSL on top of that.

kelsayed commented 9 years ago

It would be great to have parse on ESP8266. I was searching for this and the search lead me to this thread. So, I would certainly be one of the early testers whenever this comes out.

chall3ng3r commented 9 years ago

Thanks Alexander for your reply. I've been busy with some quick Unity projects so didn't checked ESP8266 SDK progress. And great going with experimentation with the SDK.

Looks like we'll to wait on the guys behind SDK to have it implemented correctly. I will dive in soon to explore more on it as I get free.

// challn3g3r //

abl commented 9 years ago

Finally got some replacement chips in - I can now, successfully, handshake with api.parse.com on an ESP8266. :)

abrarfahad commented 9 years ago

:+1: Thanks Alexander. Which model of ESP8266 you used?

abl commented 9 years ago

I'm currently using an ESP-11 paired with an Arduino for rapid testing - I started trying to port the Yun module over to it, threw that out, and moved on to the CC3000.

Specifically? https://www.tindie.com/products/AprilBrother/cactus-micro-arduino-compatible-plus-wifi-esp8266/

I'm using https://github.com/tuanpmt/espduino as a base - a blocker right now is that libssl is broken in 1.0, so I need to retrofit the earlier, working libssl in (or see if the later ones patch it) - right now I have too much Parse logic being handled on the Arduino side (like JSON parsing) since I can't recompile the bridge.

The MQTT broker maps ~reasonably in to the Parse Push space.

Once I have everything moved on to the ESP8266 side, it'll end up being more or less the equivalent of the CC3000 Parse SDK, so you could deploy it on an ESP-01 and get rid of the Arduino completely.

I've kind of punted on a few things, however - certificate pinning appears broken/unavailable without building, for example, WolfSSL (which wouldn't be a bad thing, because then we'd get TLS v1.2 instead of TLS v1.1) against the ESP's network stack...I'm kind of waiting for the LwIP-ESP8266 or PicoTCP-ESP8266 projects to get off the ground for that problem. Still better than plaintext for now!

NOTE: I'll need to get approvals to release this code which may take awhile - so don't wait for my release. :)

tzapu commented 9 years ago

I m also very interested in this and would love to test.

cometu commented 9 years ago

:+1: Yo guys, I am very interested too. Is it possible to get what you've already done @abl ? else I'll try to do it myself, but your work would certainly help a lot.

Plus, it seems that the new sdk(1.2) is now supporting ssl, with patch for sha-512 (http://bbs.espressif.com/viewtopic.php?f=5&t=708&p=2599#p2599).

and that certificate size can be enlarge with the "espconn_secure_set_size(...,...)" function.

Thanks :)

ghost commented 9 years ago

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

steve0hh commented 9 years ago

would love to test this too! :smile:

jcard0na commented 8 years ago

interested in testing this too!

jcard0na commented 8 years ago

Guys, I've spent a few hours working on this. I was able to get REST calls to api.parse.com (documented here: https://jcard0na.wordpress.com/2015/11/12/connecting-to-parse-com-from-esp8266/ ). I also started porting the Parse SDK, to the point that things compile but core dump on connection. If anyone is interested in reviewing the work, you can find it here: https://github.com/jcard0na/parse-sdk-for-esp8266

Suggestions on how to move forward are welcome. My development flow is very slow, with each upload taking tens of seconds, and debugging limited to the serial console...

Cheers,

francip commented 8 years ago

I just merged @jcard0na changes in the master Arduino repo.

ParsePlatform/Parse-SDK-Arduino@01ca6a309ee28a16413f8b2f78168fdb3d8a6751

chall3ng3r commented 8 years ago

Thanks, will try it soon.

dee101k commented 8 years ago

@jcard0na I am working on Push notification using esp8266.I am trying to send something from apps installed in parse.com to my esp8266 modules.But i am getting some issues.

When i am using Parse.setInstallationId("854a7552-718b-46b4-ac2a-25ac8cea5781"); in my codes then i am not able to push notifications from parse to esp8266.And getting following on Serial:

Parse notification example started
start push
please start sntp first !
push started
{"installation_id":"854a7552-718b-46b4-ac2a-25ac8cea5781", "oauth_key":"sQ4PalyTKfY8unTrfWG5FI9h7ZPZePG28tI7WCwy", "v":"e1.0.0", "last":null}
{}
..pm open,type:2 0
.................

But when i am using Parse.getInstallationId(); Then my stack is getting overflowed and have following error:

Parse notification example started
please start sntp first !
creating new installationId:e998d470-e863-b677-5f7e-3d907f95630d
sendRequest("POST", "/1/installations", "{"installationId": "e998d470-e863-b677-5f7e-3d907f95630d", "deviceType": "embedded", "parseVersion": "1.0.0"}", "")
please start sntp first !

Soft WDT reset

ctx: sys 
sp: 3fff0e30 end: 3fffffb0 offset: 01b0

>>>stack>>>
3fff0fe0:  00000000 00000001 402012d0 00001388  
3fff0ff0:  402012e6 00001388 00001388 402012db 

So,please guide me to solve this kind of problem..