Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to use the library with esp-idf component manager #2

Open
noName2005 opened this issue Oct 16, 2023 · 2 comments
Open

Not able to use the library with esp-idf component manager #2

noName2005 opened this issue Oct 16, 2023 · 2 comments

Comments

@noName2005
Copy link

noName2005 commented Oct 16, 2023

  • My goal is: Use the mongoose library using ESP-IDFs component manager on VsCode.

  • My actions were:
    Used the command palette in VsCode to create a new ESP-IDF project. I created the project using the template provided by the extension "template-app". Then ran idf.py add-dependency "cesanta/mongoose^7.8.2" to add mongoose component with ESP-IDF component manager. Then built the project.

  • My expectation was: To build the project without errors

  • The result I saw:
    The important snippet of the log is:
    "
    In file included from D:/Code/sketches/Hydroponics/TheUltimate/Esp/using-mongoose-only/managed_components/cesanta__mongoose/mongoose/mongoose.c:20:
    D:/Code/sketches/Hydroponics/TheUltimate/Esp/using-mongoose-only/managed_components/cesanta__mongoose/mongoose/mongoose.h:133:10: fatal error: esp_timer.h: No such file or directory
    133 | #include <esp_timer.h>
    | ^~~~~~~~~~~~~
    compilation terminated.
    "
    It looks like the esp_timer component is not registered as a requirement / dependency. As stated in the Espressif docs, some components like esp_timer were in previous versions always added as public requirements. This is not true for ESP-IDF v5.0.

reference: (https://docs.espressif.com/projects/esp-idf/en/v5.0/esp32s2/migration-guides/release-5.x/build-system.html#specify-component-requirements-explicitly)

  • My question is:
    How, and where do i add this dependency, and any other dependencies that might not be included? Are there other factors contributing to this issue? Is my environment set up correctly with the correct versions?

Edit

For some reason the CMakeList file that got downloaded is not the same as the one on github.

Mine that was downloaded with the component manager:
"
idf_component_register(SRCS "mongoose/mongoose.c"
INCLUDE_DIRS "mongoose"
REQUIRES lwip mbedtls)

target_compile_definitions(${COMPONENT_LIB} PRIVATE MG_ENABLE_MBEDTLS=1)
"
The one on github:
"
idf_component_register(SRCS "mongoose/mongoose.c"
INCLUDE_DIRS "mongoose"
REQUIRES lwip mbedtls esp_timer)

target_compile_definitions(${COMPONENT_LIB} PRIVATE MG_ENABLE_MBEDTLS=1)
"
I assume this fixes exactly my problem. ESP-IDF does not allow me to make the change ". My project directory also does not have a separate "components" folder, so i cant migrate the mongoose component. I tried making my own folder, but have not managed to "link" it correctly to the rest of my project.

ESP-IDF v 5.1.1 on VsCode

  • mongoose version: 7.8.2
  • Target hardware/board: ESP32-WROOM-32

logs.txt

@BenMens
Copy link

BenMens commented Nov 4, 2023

I edited my idf_component.yml to:

dependencies:
  cesanta/mongoose: 
    version: 3636100d68b4e44d4aa6bd2bd1f097b50a9929dc
    git: "https://github.com/cesanta/mongoose-esp-idf"

It seems to be a workaround until a new version of cesanta/mongoose is published.

@SlowTypist
Copy link

There is no new version since 2022, is this repo even maintained?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants