# Missing esp\_http\_client component

**URL:** <https://forums.freertos.org/t/missing-esp-http-client-component/9098>\
**Category:** AWS\
**Created:** [February 28, 2020, 7:49pm UTC](https://forums.freertos.org/t/missing-esp-http-client-component/9098 "2020-02-28T19:49:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![isnore](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@isnore](https://forums.freertos.org/u/isnore)\
**Post date:** [February 28, 2020, 7:49pm UTC](https://forums.freertos.org/t/missing-esp-http-client-component/9098/1 "2020-02-28T19:49:42Z")

</div>

I noticed that esp\_http\_client is not in the following directory

```auto
./amazon-freertos/vendors/espressif/esp-idf/components

```

However it is in the official esp-idf release v3.3  
[Link to ESP-IDF repo](https://github.com/espressif/esp-idf/tree/v3.3/components/esp_http_client)

So I was wondering how I could use this component for my ESP32? Thanks!

**Notes**  
I have the latest Amazon FreeRTOS release

---

<div class="post-metadata">

**Author:** ![ravibhagavandas](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/ravibhagavandas/32/1309_2.png) [@ravibhagavandas](https://forums.freertos.org/u/ravibhagavandas)\
**Post date:** [February 28, 2020, 10:22pm UTC](https://forums.freertos.org/t/missing-esp-http-client-component/9098/2 "2020-02-28T22:22:57Z")

</div>

FreeRTOS has it’s own [HTTPS client library](https://docs.aws.amazon.com/freertos/latest/lib-ref/https/index.html), which have been tested against our other IoT Libraries.

For more information on adding esp\_http\_client component, members from [@Espressif](https://forums.freertos.org/groups/espressif) team should be able to help you.

---

<div class="post-metadata">

**Author:** ![mahavirj](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@mahavirj](https://forums.freertos.org/u/mahavirj)\
**Post date:** [March 1, 2020, 8:49am UTC](https://forums.freertos.org/t/missing-esp-http-client-component/9098/3 "2020-03-01T08:49:03Z")

</div>

@isnore You can use `esp_http_client` from ESP-IDF v3.3 release, as long as you are using `lwIP` networking stack (using -DAFR\_ESP\_LWIP=1, please refer to [https://docs.aws.amazon.com/freertos/latest/userguide/getting\_started\_espressif.html#build-and-run-example-espressif](https://docs.aws.amazon.com/freertos/latest/userguide/getting_started_espressif.html#build-and-run-example-espressif)). It should work without any changes with required components copied into `vendors/espressif/esp-idf/components`. However, this can not work with FreeRTOS TCP stack, since it does not provide posix socket layer interface.

Let me know if you face any issues, can provide you with feature branch if required for same.

Thanks.

---

<div class="post-metadata">

**Author:** ![isnore](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@isnore](https://forums.freertos.org/u/isnore)\
**Post date:** [March 2, 2020, 7:06pm UTC](https://forums.freertos.org/t/missing-esp-http-client-component/9098/4 "2020-03-02T19:06:02Z")

</div>

I am using the lwip stack but I still can’t seem to get it to work:

**CMake Options**

```auto
-DAFR_ESP_LWIP=1
-DCMAKE_TOOLCHAIN_FILE=amazon-freertos/tools/cmake/toolchains/xtensa-esp32.cmake
-GNinja

```

**I copied and pasted esp\_http\_client from the release v3.3 branch** into the following directory

```auto
./amazon-freertos/vendors/espressif/esp-idf/components/esp_http_client

```

This is the error output in the console:

```auto
====================[Build | flash | Debug]===================================
/usr/local/bin/cmake --build /Users/vp/esp/Pebble_ESP32_Firmware/build --target flash
[0/2] Re-checking globbed directories...
[1/2] Re-running CMake...
-- Submodule update
-- Checking Python dependencies...
Python requirements from /Users/vp/esp/Pebble_ESP32_Firmware/amazon-freertos/vendors/espressif/esp-idf/requirements.txt are satisfied.
-- Building for target esp32
CMake Error at /Users/vp/esp/Pebble_ESP32_Firmware/amazon-freertos/vendors/espressif/esp-idf/tools/cmake/component_utils.cmake:20 (message):
  Required component esp-tls is not found in any of the provided
  COMPONENT_DIRS
Call Stack (most recent call first):
  /Users/vp/esp/Pebble_ESP32_Firmware/amazon-freertos/vendors/espressif/esp-idf/tools/cmake/scripts/expand_requirements.cmake:95 (find_component_path)
  /Users/vp/esp/Pebble_ESP32_Firmware/amazon-freertos/vendors/espressif/esp-idf/tools/cmake/scripts/expand_requirements.cmake:114 (expand_component_requirements)
  /Users/vp/esp/Pebble_ESP32_Firmware/amazon-freertos/vendors/espressif/esp-idf/tools/cmake/scripts/expand_requirements.cmake:217 (expand_component_requirements)

CMake Error at amazon-freertos/vendors/espressif/esp-idf/tools/cmake/idf_functions.cmake:338 (message):
  Failed to expand component requirements
Call Stack (most recent call first):
  amazon-freertos/vendors/espressif/boards/esp32/CMakeLists.txt:437 (idf_import_components)
  amazon-freertos/CMakeLists.txt:49 (include)

-- Configuring incomplete, errors occurred!
See also "/Users/vp/esp/Pebble_ESP32_Firmware/build/CMakeFiles/CMakeOutput.log".
See also "/Users/vp/esp/Pebble_ESP32_Firmware/build/CMakeFiles/CMakeError.log".
FAILED: build.ninja 
/usr/local/Cellar/cmake/3.16.2/bin/cmake -S/Users/vp/esp/Pebble_ESP32_Firmware -B/Users/vp/esp/Pebble_ESP32_Firmware/build
ninja: error: rebuilding 'build.ninja': subcommand failed

```

Please let me know if you need any more information. Thanks!

**Notes**  
_Compiler:_  
– The C compiler identification is GNU 5.2.0  
– The CXX compiler identification is GNU 5.2.0

_Our project layout:_  
/components  
----/wifi  
--------/include  
------------dns.h  
--------/src  
------------dns.c  
--------CMakeLists.txt \< this is the file that tries to include the esp\_http\_client  
/src  
----main.c

_Amazon Version:_  
Latest version on master branch

---

<div class="post-metadata">

**Author:** ![shubhamkulkarni97](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/shubhamkulkarni97/32/517_2.png) [@shubhamkulkarni97](https://forums.freertos.org/u/shubhamkulkarni97)\
**Post date:** [March 3, 2020, 6:41am UTC](https://forums.freertos.org/t/missing-esp-http-client-component/9098/5 "2020-03-03T06:41:51Z")

</div>

@isnore esp\_http\_client requires esp-tls and tcp\_transport components. These components should also be copied from release/v3.3.

I have pulled in all the required components in my [feature branch](https://github.com/shubhamkulkarni97/amazon-freertos/tree/feature/add_esp_http_client). For reference, you can checkout to this branch.

---

<div class="post-metadata">

**Author:** ![isnore](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@isnore](https://forums.freertos.org/u/isnore)\
**Post date:** [March 3, 2020, 4:38pm UTC](https://forums.freertos.org/t/missing-esp-http-client-component/9098/6 "2020-03-03T16:38:19Z")

</div>

Got it to compile! Thanks! Also copied over the mbedtls component from release/v3.3.

---

<div class="post-metadata">

**Author:** ![shubhamkulkarni97](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/shubhamkulkarni97/32/517_2.png) [@shubhamkulkarni97](https://forums.freertos.org/u/shubhamkulkarni97)\
**Post date:** [March 5, 2020, 9:00am UTC](https://forums.freertos.org/t/missing-esp-http-client-component/9098/8 "2020-03-05T09:00:24Z")

</div>

@isnore As mbedtls component is already available in Amazon FreeRTOS, it should not be copied from release/v3.3.

To build application using esp\_http\_client, a change is required in mbedtls port layer. I have added the change in the [same branch](https://github.com/shubhamkulkarni97/amazon-freertos/tree/feature/add_esp_http_client). Please try building the application using this branch with LwIP stack. Feel free to post if you face any issues.

---

<div class="post-metadata">

**Author:** ![isnore](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@isnore](https://forums.freertos.org/u/isnore)\
**Post date:** [March 5, 2020, 7:08pm UTC](https://forums.freertos.org/t/missing-esp-http-client-component/9098/9 "2020-03-05T19:08:11Z")

</div>

Thanks for the update! Got it working 🙂
