Skip to content

unable to include esp_camera #768

@HudsonKortus

Description

@HudsonKortus

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate
  • Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

always

Expected behavior

Following the instructions on the readme, am unable to include the esp_camera drivers to my project.
I am using esp-idf v5.4.2 on vscode.

I expect to be able to run ``idf.py add-dependency "espressif/esp32-camera"```, edit the pertinent menuconfig settings and be able to build a file containing #include "esp_camera.h".

I am not new to programming the esp32 or the esp-idf. I have tried adding esp_camera to the CmakeLists.txt as a requirement, and using the idf_component.yml I have attached below. I have gone through extensive troubleshooting and thoroughly read the docs and other related form articles, I have upgraded to ESP-IDF v5.4.2 but nothing has worked.

Actual behavior (suspected bug)

I run create a new project, set the freeRTOS tick speed to 1000, and run idf.py add-dependency "espressif/esp32-camera" and see it correctly populates the components directory with the Arduino component. Next I change the menuconfig settings as directed and finally add #include "esp_camera.h" to main and build, expecting the code to correctly compile. Instead I get the following error:

[large text dump]
/home/hudson/Documents/minimal-camera/minimal-camera/1/1_try/main/main.c:2:10: fatal error: esp_camera.h: No such file or directory
    2 | #include "esp_camera.h"

Error logs or terminal output

[1/10] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj
FAILED: esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj 
/home/hudson/.espressif/tools/xtensa-esp-elf/esp-14.2.0_20241119/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc -DESP_PLATFORM -DIDF_VER=\"v5.4.2\" -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DSOC_XTAL_FREQ_MHZ=CONFIG_XTAL_FREQ -DUNITY_INCLUDE_CONFIG_H -D_GLIBCXX_HAVE_POSIX_SEMAPHORE -D_GLIBCXX_USE_POSIX_SEMAPHORE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -I/home/hudson/Documents/minimal-camera/minimal-camera/1/1_try/build/config -I/home/hudson/Documents/minimal-camera/minimal-camera/1/1_try/main -I/home/hudson/esp/esp-idf-v5.4.2/components/newlib/platform_include -I/home/hudson/esp/esp-idf-v5.4.2/components/freertos/config/include -I/home/hudson/esp/esp-idf-v5.4.2/components/freertos/config/include/freertos -I/home/hudson/esp/esp-idf-v5.4.2/components/freertos/config/xtensa/include -I/home/hudson/esp/esp-idf-v5.4.2/components/freertos/FreeRTOS-Kernel/include -I/home/hudson/esp/esp-idf-v5.4.2/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -I/home/hudson/esp/esp-idf-v5.4.2/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos -I/home/hudson/esp/esp-idf-v5.4.2/components/freertos/esp_additions/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_hw_support/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_hw_support/include/soc -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_hw_support/include/soc/esp32 -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_hw_support/dma/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_hw_support/ldo/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_hw_support/debug_probe/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_hw_support/port/esp32/. -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_hw_support/port/esp32/include -I/home/hudson/esp/esp-idf-v5.4.2/components/heap/include -I/home/hudson/esp/esp-idf-v5.4.2/components/heap/tlsf -I/home/hudson/esp/esp-idf-v5.4.2/components/log/include -I/home/hudson/esp/esp-idf-v5.4.2/components/soc/include -I/home/hudson/esp/esp-idf-v5.4.2/components/soc/esp32 -I/home/hudson/esp/esp-idf-v5.4.2/components/soc/esp32/include -I/home/hudson/esp/esp-idf-v5.4.2/components/soc/esp32/register -I/home/hudson/esp/esp-idf-v5.4.2/components/hal/platform_port/include -I/home/hudson/esp/esp-idf-v5.4.2/components/hal/esp32/include -I/home/hudson/esp/esp-idf-v5.4.2/components/hal/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_rom/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_rom/esp32/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_rom/esp32/include/esp32 -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_rom/esp32 -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_common/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_system/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_system/port/soc -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_system/port/include/private -I/home/hudson/esp/esp-idf-v5.4.2/components/xtensa/esp32/include -I/home/hudson/esp/esp-idf-v5.4.2/components/xtensa/include -I/home/hudson/esp/esp-idf-v5.4.2/components/xtensa/deprecated_include -I/home/hudson/esp/esp-idf-v5.4.2/components/lwip/include -I/home/hudson/esp/esp-idf-v5.4.2/components/lwip/include/apps -I/home/hudson/esp/esp-idf-v5.4.2/components/lwip/include/apps/sntp -I/home/hudson/esp/esp-idf-v5.4.2/components/lwip/lwip/src/include -I/home/hudson/esp/esp-idf-v5.4.2/components/lwip/port/include -I/home/hudson/esp/esp-idf-v5.4.2/components/lwip/port/freertos/include -I/home/hudson/esp/esp-idf-v5.4.2/components/lwip/port/esp32xx/include -I/home/hudson/esp/esp-idf-v5.4.2/components/lwip/port/esp32xx/include/arch -I/home/hudson/esp/esp-idf-v5.4.2/components/lwip/port/esp32xx/include/sys -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_gpio/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_pm/include -I/home/hudson/esp/esp-idf-v5.4.2/components/mbedtls/port/include -I/home/hudson/esp/esp-idf-v5.4.2/components/mbedtls/mbedtls/include -I/home/hudson/esp/esp-idf-v5.4.2/components/mbedtls/mbedtls/library -I/home/hudson/esp/esp-idf-v5.4.2/components/mbedtls/esp_crt_bundle/include -I/home/hudson/esp/esp-idf-v5.4.2/components/mbedtls/mbedtls/3rdparty/everest/include -I/home/hudson/esp/esp-idf-v5.4.2/components/mbedtls/mbedtls/3rdparty/p256-m -I/home/hudson/esp/esp-idf-v5.4.2/components/mbedtls/mbedtls/3rdparty/p256-m/p256-m -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_app_format/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_bootloader_format/include -I/home/hudson/esp/esp-idf-v5.4.2/components/app_update/include -I/home/hudson/esp/esp-idf-v5.4.2/components/bootloader_support/include -I/home/hudson/esp/esp-idf-v5.4.2/components/bootloader_support/bootloader_flash/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_partition/include -I/home/hudson/esp/esp-idf-v5.4.2/components/efuse/include -I/home/hudson/esp/esp-idf-v5.4.2/components/efuse/esp32/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_mm/include -I/home/hudson/esp/esp-idf-v5.4.2/components/spi_flash/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_security/include -I/home/hudson/esp/esp-idf-v5.4.2/components/pthread/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_timer/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_gptimer/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_ringbuf/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_uart/include -I/home/hudson/esp/esp-idf-v5.4.2/components/vfs/include -I/home/hudson/esp/esp-idf-v5.4.2/components/app_trace/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_event/include -I/home/hudson/esp/esp-idf-v5.4.2/components/nvs_flash/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_pcnt/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_spi/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_mcpwm/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_ana_cmpr/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_i2s/include -I/home/hudson/esp/esp-idf-v5.4.2/components/sdmmc/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_sdmmc/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_sdspi/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_sdio/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_dac/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_rmt/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_tsens/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_sdm/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_i2c/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_ledc/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_parlio/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_usb_serial_jtag/include -I/home/hudson/esp/esp-idf-v5.4.2/components/driver/deprecated -I/home/hudson/esp/esp-idf-v5.4.2/components/driver/i2c/include -I/home/hudson/esp/esp-idf-v5.4.2/components/driver/touch_sensor/include -I/home/hudson/esp/esp-idf-v5.4.2/components/driver/twai/include -I/home/hudson/esp/esp-idf-v5.4.2/components/driver/touch_sensor/esp32/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_phy/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_phy/esp32/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_vfs_console/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_netif/include -I/home/hudson/esp/esp-idf-v5.4.2/components/wpa_supplicant/include -I/home/hudson/esp/esp-idf-v5.4.2/components/wpa_supplicant/port/include -I/home/hudson/esp/esp-idf-v5.4.2/components/wpa_supplicant/esp_supplicant/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_coex/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_wifi/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_wifi/include/local -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_wifi/wifi_apps/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_wifi/wifi_apps/nan_app/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_gdbstub/include -I/home/hudson/esp/esp-idf-v5.4.2/components/unity/include -I/home/hudson/esp/esp-idf-v5.4.2/components/unity/unity/src -I/home/hudson/esp/esp-idf-v5.4.2/components/cmock/CMock/src -I/home/hudson/esp/esp-idf-v5.4.2/components/console -I/home/hudson/esp/esp-idf-v5.4.2/components/http_parser -I/home/hudson/esp/esp-idf-v5.4.2/components/esp-tls -I/home/hudson/esp/esp-idf-v5.4.2/components/esp-tls/esp-tls-crypto -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_adc/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_adc/interface -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_adc/esp32/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_adc/deprecated/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_isp/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_cam/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_cam/interface -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_psram/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_jpeg/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_driver_ppa/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_eth/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_hid/include -I/home/hudson/esp/esp-idf-v5.4.2/components/tcp_transport/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_http_client/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_http_server/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_https_ota/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_https_server/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_lcd/include -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_lcd/interface -I/home/hudson/esp/esp-idf-v5.4.2/components/protobuf-c/protobuf-c -I/home/hudson/esp/esp-idf-v5.4.2/components/protocomm/include/common -I/home/hudson/esp/esp-idf-v5.4.2/components/protocomm/include/security -I/home/hudson/esp/esp-idf-v5.4.2/components/protocomm/include/transports -I/home/hudson/esp/esp-idf-v5.4.2/components/protocomm/include/crypto/srp6a -I/home/hudson/esp/esp-idf-v5.4.2/components/protocomm/proto-c -I/home/hudson/esp/esp-idf-v5.4.2/components/esp_local_ctrl/include -I/home/hudson/esp/esp-idf-v5.4.2/components/espcoredump/include -I/home/hudson/esp/esp-idf-v5.4.2/components/espcoredump/include/port/xtensa -I/home/hudson/esp/esp-idf-v5.4.2/components/wear_levelling/include -I/home/hudson/esp/esp-idf-v5.4.2/components/fatfs/diskio -I/home/hudson/esp/esp-idf-v5.4.2/components/fatfs/src -I/home/hudson/esp/esp-idf-v5.4.2/components/fatfs/vfs -I/home/hudson/esp/esp-idf-v5.4.2/components/idf_test/include -I/home/hudson/esp/esp-idf-v5.4.2/components/idf_test/include/esp32 -I/home/hudson/esp/esp-idf-v5.4.2/components/ieee802154/include -I/home/hudson/esp/esp-idf-v5.4.2/components/json/cJSON -I/home/hudson/esp/esp-idf-v5.4.2/components/mqtt/esp-mqtt/include -I/home/hudson/esp/esp-idf-v5.4.2/components/nvs_sec_provider/include -I/home/hudson/esp/esp-idf-v5.4.2/components/perfmon/include -I/home/hudson/esp/esp-idf-v5.4.2/components/rt/include -I/home/hudson/esp/esp-idf-v5.4.2/components/spiffs/include -I/home/hudson/esp/esp-idf-v5.4.2/components/wifi_provisioning/include -mlongcalls -Wno-frame-address  -fno-builtin-memcpy -fno-builtin-memset -fno-builtin-bzero -fno-builtin-stpcpy -fno-builtin-strncpy -fdiagnostics-color=always -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-error=extra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -mdisable-hardware-atomics -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw -Og -fno-shrink-wrap -fmacro-prefix-map=/home/hudson/Documents/minimal-camera/minimal-camera/1/1_try=. -fmacro-prefix-map=/home/hudson/esp/esp-idf-v5.4.2=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -std=gnu17 -Wno-old-style-declaration -MD -MT esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj -MF esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj.d -o esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj -c /home/hudson/Documents/minimal-camera/minimal-camera/1/1_try/main/main.c
/home/hudson/Documents/minimal-camera/minimal-camera/1/1_try/main/main.c:2:10: fatal error: esp_camera.h: No such file or directory
    2 | #include "esp_camera.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.

Steps to reproduce the behavior

  1. create a new project- this can be any project, including any example
  2. change freeRTOS Tick rate to 1000 (if you dont do this, idf.py menuconfig breaks durring the next step)
  3. run idf.py add-dependency "espressif/esp32-camera"
  4. enable PSRAM, change the clock speed of RAM and FLASH to 80Mz
  5. build project

Project release version

ESP-IDF v5.4.2, ESP-IDF v5.4.2

System architecture

Intel/AMD 64-bit (modern PC, older Mac)

Operating system

Linux

Operating system version

Ubuntu 24.04.2

Shell

Bash

Additional context

Thank you so much for your help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions