esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 34 forks source link

esp32-cam setup failed when using esp-idf #5661

Closed khaiql closed 3 weeks ago

khaiql commented 5 months ago

The problem

I'm developing a custom component that needs to use esp-idf platform instead of adruino. The code can compile but it fails at the setup without any clear error message. It works fine with Adruino though

Which version of ESPHome has the issue?

2024.3.1

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

No response

What platform are you using?

ESP32-IDF

Board

esp32cam

Component causing the issue

esp32-cam

Example YAML snippet

esphome:
  name: litter-robot-cam
  friendly_name: litter-robot-cam

esp32:
  board: esp32cam
  framework:
    type: esp-idf
    # version: recommended
    # Custom sdkconfig options
    # sdkconfig_options:
    #   COMPILER_OPTIMIZATION_SIZE: y
    # # Advanced tweaking options
    # advanced:
    #   ignore_efuse_mac_crc: false

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: ""

ota:
  password: ""

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  manual_ip:
    static_ip: 192.168.31.192
    gateway: 192.168.31.1
    subnet: 255.255.255.0

  use_address: 192.168.31.192

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Litter-Robot-Cam"
    password: "jxxkykKcMKxw"

captive_portal:

esp32_camera:
  name: Litter Robot camera
  external_clock:
    pin: GPIO0
    frequency: 20MHz
  i2c_pins:
    sda: GPIO26
    scl: GPIO27
  data_pins: [GPIO5, GPIO18, GPIO19, GPIO21, GPIO36, GPIO39, GPIO34, GPIO35]
  vsync_pin: GPIO25
  href_pin: GPIO23
  pixel_clock_pin: GPIO22
  power_down_pin: GPIO32
  # resolution: 800x600
  vertical_flip: true
  agc_mode: auto
  wb_mode: cloudy

switch:        
  - platform: gpio
    name: "Flashlight"
    pin: GPIO4

Anything in the logs that might be useful for us?

[14:55:07][C][logger:166]: Logger:
[14:55:07][C][logger:167]:   Level: DEBUG
[14:55:07][C][logger:169]:   Log Baud Rate: 115200
[14:55:07][C][logger:170]:   Hardware UART: UART0
[14:55:07][C][switch.gpio:068]: GPIO Switch 'Flashlight'
[14:55:07][C][switch.gpio:091]:   Restore Mode: always OFF
[14:55:07][C][switch.gpio:031]:   Pin: GPIO4
[14:55:07][C][esp32_camera:048]: ESP32 Camera:
[14:55:07][C][esp32_camera:049]:   Name: Litter Robot camera
[14:55:07][C][esp32_camera:050]:   Internal: NO
[14:55:07][C][esp32_camera:052]:   Data Pins: D0:5 D1:18 D2:19 D3:21 D4:36 D5:39 D6:34 D7:35
[14:55:07][C][esp32_camera:053]:   VSYNC Pin: 25
[14:55:07][C][esp32_camera:054]:   HREF Pin: 23
[14:55:07][C][esp32_camera:055]:   Pixel Clock Pin: 22
[14:55:07][C][esp32_camera:056]:   External Clock: Pin:0 Frequency:20000000
[14:55:07][C][esp32_camera:058]:   I2C Pins: SDA:26 SCL:27
[14:55:07][C][esp32_camera:062]:   Reset Pin: -1
[14:55:07][C][esp32_camera:080]:   Resolution: 640x480 (VGA)
[14:55:07][E][esp32_camera:123]:   Setup Failed: ERROR

Additional information

No response

khaiql commented 5 months ago

I found this log

E][camera.c:1049] camera_probe(): Detected camera not supported.
[E][camera.c:1249] esp_camera_init(): Camera probe failed with error 0x20004

There were a few issues reported but none of them seem to solve the problem

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.