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!
[Info] Port of libcurl to ESP32
[Info] Port of libcurl to ESP32
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
Re: Port of libcurl to ESP32
That's interesting, but seems like a blunt instrument for the job.
Still a nice demo.
With this strategy you're going to run out of memory quickly.how I would do this on Linux?
Still a nice demo.
Re: Port of libcurl to ESP32
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?
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
Re: [Info] Port of libcurl to ESP32
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?
Re: [Info] Port of libcurl to ESP32
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.
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 8 guests