[Info] Port of libcurl to ESP32

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

[Info] Port of libcurl to ESP32

Postby kolban » Fri Nov 04, 2016 9:41 pm

I had a need to make REST calls from a C ESP32 program and asked myself how I would do this on Linux? One of the more common patterns is to use "libcurl" so I had a go at attempting to port this to an ESP-IDF component. For the most part, it worked. At least to the extent that I can make a simple REST request. The "libcurl" also supports a wide variety of other protocols that I haven't tested out yet ... but this is a start.

The component can be found on github here ...

https://github.com/nkolban/curl-esp32

If we see value in this, we can perhaps collaborate on a richer port in terms of testing and function. This would include enabling SSL and other protocols. I want to get this out as quickly as possible so if you wish to use and have issues, don't hesitate to post here and I'll try and assist as quickly as I can.

later ... Just tested FTP as a URL, worked just fine!
Last edited by kolban on Wed Dec 28, 2016 1:49 am, edited 2 times in total.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Port of libcurl to ESP32

Postby WiFive » Fri Nov 04, 2016 10:37 pm

That's interesting, but seems like a blunt instrument for the job.
how I would do this on Linux?
With this strategy you're going to run out of memory quickly.

Still a nice demo.

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Port of libcurl to ESP32

Postby kolban » Sat Nov 05, 2016 1:36 am

Howdy,
I'm not seeing what would cause me to run out of memory? I'm sure as heck not saying you aren't right ... but can you help me see why this is a bad library because of memory usage?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

andrew_p
Posts: 30
Joined: Sun Jan 01, 2017 5:37 pm

Re: [Info] Port of libcurl to ESP32

Postby andrew_p » Sun Jan 01, 2017 10:32 pm

I'm struggling trying to build and link curl in the provided example code.. is there any chance you can post detailed steps with what options curl needs to be built and and how to link it to esp32 app?

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: [Info] Port of libcurl to ESP32

Postby kolban » Mon Jan 02, 2017 3:48 pm

Howdy @andrew_p,
When I got libcurl working, I tried to capture the recipe and wrote it down in my book of ESP32 notes ... see:

http://esp32.com/viewtopic.php?f=2&t=390&p=3526

In the latest version (2017-01-01) the notes begin on page 91.

Its been a few months since I practiced them ... but if they aren't correct or sufficient, then I'll update ... did you have a chance to see these notes and give them a try? If yes and it wasn't clear, then for sure I want to hear about that.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Who is online

Users browsing this forum: No registered users and 101 guests