HTTPS requests

Posted on
of 2
/ 2
  • Hi all,
    i got to connect to a https server to get some data to espruino...
    Is there anyway to do this now or will it be implemented somehow?

  •'s all there... w/ Espruino-Wifi, for example, or any other Espruino plus a wifi breakout board...

  • Hi, sorry maybe i wasn't that clear:
    using HTTPS in espruino code i gotta connect to firebase database that is HTTPS not HTTP... i didn't see anywhere the https library... is it somewhere and i didn't see it?!

  • By the way i'm using ESP12E microprocessor...

  • ESP12E is just an ESP8266 and you may run out of memory because the ESP code and the Espruino w/ application fight for the same RAM... And that's not the only issue you will run into, because ESP code has priority and may mess up your app running in Espruino JS. One processor is just not good enough to handle all at the same time, especially since ESP code behaves like bit banger in communication respects.

    Running your app on a native Espruino board and using the ESP for wifi - as Espruino-Wifi does and any Espruino boartd with any ESP8266 board do - gives you enough power and independence for the app and the wifi communication/

    I assume you consulted Espruino on ESP8266 and the related forum conversations that will get you started with Espruino on your current device.

  • @AlessioBacin
    The ESP8266 port does not have the TLS component compiled in that is required for https. There is not enough free memory for the buffers required. You reduce the number of jsvars and compile this in, but depending on how complex your code is, you might not have enough space left to do what you want to achieve.

    You could use a http to https proxy service as a helper.

    The ESP32 build has enough resources, so that https:// works.

  • ...there you go, thanks @Wilberforce...

    @AlessioBacin, just get a Espruino board that has a real ARM3 or 4 on it and use your ESP12E as plain wifi stack device. Talk to it with serial as supported in any Espruino and this way you get your https connection and programming in JavaScript.

    'Alternative' is using LUA on the ESP12E... but you could stick to Arduino then...

  • Wow guys... thanks a lot. Now i got i very clearer idea on how all works.
    I guess for now i'll go for http to https proxies for now but next step is going for esp32 cause espruino board is quite more expensive for the simplicity of the job i have to do and especially for the numbers i might buy so that difference in price is important.

  • Sorry, a you can see i'm not an experianced technician... so i gotta ask: if i decide to stick for esp32 how do implement the code as there is no https library in espruino?

  • There may be many things to be factored into your decision... price is one, anther one is what is how you power your devices, yet another one is your wifi infrastructure.

    esp32 - Espruino on ESP32 is a multi-core (duo core) processor and has also more memory resources. About how far the port of Espruino - that includes all the support incl HTTPS - has been achieved, you have to track down the conversations in the forum... I know that @Wilberforce, @JumJum, @Kolban (and others) have worked on its guts, and I have nowhere read that SSL would not be supported. From conversation Writing an SSL HTTPS web server ... I read that connecting with https to a server in the net is there, but not running a https listening server on ESP32.

    Looking up some more info about SLL and ESP8266, I came across this nice youtube

    and follow-up presentation. It talks about the space issue creating functions involved in SSL communication. Going to a single, defined server gives some relieve, and may be an option to go with less resource...

  • Does anyone actually use Just that the domain expires on Jun 12, 2017, wondering if I should renew it. @MaBe Do you use it?

  • Hi @Ducky not now, can we find your code on github?

  • wow Ducky of course i'll use in these days... and i guess i'tll be usefull for many peaple doing this stuff.

  • if you share the and don't want to give the service anymore i would like to contribute somehow... with one server for example...

  • Alright, I've put the code on GitHub whether or not I decide to keep the domain.

  • Is the main espruino site php? Perhaps this could be put up as a sub-domain... ?

  • Cool - Thanks Ducky!

  • yeah.. would be cool to put it as an espruino service or test service

  • @Ducky I'm using it!

  • +1 Yes that would be cool to have it as a service here. :)

    Another way -- though weird, but cheap, would be to compile Espruino for the 8266 to get TLS going, and then use a second one to communicate with it using the first one to do the HTTPS requests (either via WiFi or the UART). Considering their price it would still be under $5 ... though could suck up alot of your time - so be prepared :P . The Espruino WiFi that Gordon sells sounds like a nice solution that "just works", if you're doing one off production.

  • @Ducky -- Thanks! I always wondered what the code was -- it should be easy for any of us to throw this up on Heroku -- I think for a couple years now their free their account allows running a dyno for 24 hours....or AWS if you're more dedicated :P

  • @Ducky do you have any stats of server logs showing how much it has been used? I guess from the IP addresses you should get a pretty good idea how many people are looking at doing things with it.

    yeah.. would be cool to put it as an espruino service or test service

    Well yes, but what you're actually saying is: "I'm too cheap to actually pay you any money for an Espruino board that does exactly what I want, so will you work for free to make me a free service so that I can avoid buying your hardware and can instead use something else?"

    You can see how that's not desperately compelling :)

  • You can see how that's not desperately compelling :)

    @Gordon - I guess it depends on your revenue model. You already have Patreon (from I presume non "Official Board" owners even), and there could be other services you provide that are not part of the open source distro that would be cheap, but doable ($1 a month), etc, a custom firmware builder for commercial use, whatever. Anyways, off topic, but somewhat relevant.

    @Ducky +1 for renewing the domain btw, if that wasn't obvious. :P I didn't use it much, because I thought it would go "away", but if I know it will be around for a year or two I will for sure.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

HTTPS requests

Posted by Avatar for AlessioBacin @AlessioBacin