How to fix ESP-IDF fatal error: esp_crt_bundle.h: No such file or directory
Problem
While compiling your ESP-IDF project, you get an error message like this:
esp_crt_bundle_error.txt
/home/user/my-project/managed_components/espressif__rmaker_common/src/esp-mqtt/esp-mqtt-glue.c:47:10: fatal error: esp_crt_bundle.h: No such file or directory
47 | #include <esp_crt_bundle.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
Solution
Either make Rainermaker not use the certificate bundle, or enable the certificate bundle component in your project’s sdkconfig
file.
Make Rainmaker not use the certificate bundle (recommended)
In your project’s sdkconfig
file, set the following:
example.txt
CONFIG_ESP_RMAKER_USE_CERT_BUNDLE=n
CONFIG_ESP_RMAKER_MQTT_USE_CERT_BUNDLE=n
Enable the certificate bundle component
This eats up a bunch of flash space, so my recommendation is to only do this if you really need it.
Enable the certificate bundle component in your project’s sdkconfig
file:
example.txt
CONFIG_ESP_CRT_BUNDLE=y
Check out similar posts by category:
ESP-IDF
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow