ESP32 Cam - working!

Because they are cheap and mass produced in a certain country which has poor manufacturing standards.

Hi folks, I bought another module and I successfully flash it

The cam remains in IDLE and I see this error in the log

[E][esp32_camera:123]: Setup Failed: ESP_ERR_NOT_FOUND

I tried different configs

esp32_camera:
  name: ${friendly_name}
  external_clock:
    pin: GPIO3 #GPIO13
    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
# Image settings
  max_framerate: 1 fps
  resolution: SXGA
  jpeg_quality: 20
  contrast: 2
  saturation: 2

or

esp32_camera:
  name: ${friendly_name}
  external_clock:
    pin: GPIO27
    frequency: 20MHz
  i2c_pins:
    sda: GPIO25
    scl: GPIO23
  data_pins: [GPIO17, GPIO35, GPIO34, GPIO5, GPIO39, GPIO18, GPIO36, GPIO19]
  vsync_pin: GPIO22
  href_pin: GPIO26
  pixel_clock_pin: GPIO21
  reset_pin: GPIO15
  resolution: 640x480
  jpeg_quality: 10

same result

image

this is the pinout

any ideas?

No logs, no issue.

ops

[21:17:45][C][esp32_camera:048]: ESP32 Camera:
[21:17:45][C][esp32_camera:049]:   Name: cam
[21:17:45][C][esp32_camera:050]:   Internal: NO
[21:17:45][C][esp32_camera:052]:   Data Pins: D0:5 D1:18 D2:19 D3:21 D4:36 D5:39 D6:34 D7:35
[21:17:45][C][esp32_camera:053]:   VSYNC Pin: 25
[21:17:45][C][esp32_camera:054]:   HREF Pin: 23
[21:17:45][C][esp32_camera:055]:   Pixel Clock Pin: 22
[21:17:45][C][esp32_camera:056]:   External Clock: Pin:0 Frequency:10000000
[21:17:45][C][esp32_camera:060]:   I2C Pins: SDA:26 SCL:27
[21:17:45][C][esp32_camera:062]:   Reset Pin: -1
[21:17:45][C][esp32_camera:080]:   Resolution: 640x480 (VGA)
[21:17:45][E][esp32_camera:123]:   Setup Failed: ESP_ERR_NOT_FOUND
[21:17:45][C][psram:020]: PSRAM:
[21:17:45][C][psram:021]:   Available: YES
[21:17:45][C][psram:024]:   Size: 4095 KB

Try cleaning and making sure the connector is properly seated.

done, but I still get the same error

Almost,

now I get this error message

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

Full log

FBets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:4
load:0x3fff0034,len:6968
load:0x40078000,len:13072
ho 0 tail 12 room 4
load:0x40080400,len:3896
entry 0x40080688
I (31) boot: ESP-IDF v4.1-dirty 2nd stage bootloader
I (31) boot: compile time 16:15:01
I (31) boot: chip revision: 3
I (34) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (42) boot.esp32: SPI Speed      : 40MHz
I (46) boot.esp32: SPI Mode       : DIO
I (51) boot.esp32: SPI Flash Size : 4MB
I (55) boot: Enabling RNG early entropy source...
I (60) boot: Partition Table:
I (64) boot: ## Label            Usage          Type ST Offset   Length
I (71) boot:  0 nvs              WiFi data        01 02 00009000 00005000
I (79) boot:  1 otadata          OTA data         01 00 0000e000 00002000
I (86) boot:  2 app0             OTA app          00 10 00010000 00300000
I (94) boot:  3 spiffs           Unknown data     01 82 00310000 000f0000
I (101) boot: End of partition table
I (106) boot_comm: chip revision: 3, min. application chip revision: 0
I (113) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x1d2048 (1908808) map
I (849) esp_image: segment 1: paddr=0x001e2070 vaddr=0x3ffbdb60 size=0x04d3c ( 19772) load
I (857) esp_image: segment 2: paddr=0x001e6db4 vaddr=0x40080000 size=0x00400 (  1024) load
I (858) esp_image: segment 3: paddr=0x001e71bc vaddr=0x40080400 size=0x08e54 ( 36436) load
I (880) esp_image: segment 4: paddr=0x001f0018 vaddr=0x400d0018 size=0x9df74 (647028) map
I (1127) esp_image: segment 5: paddr=0x0028df94 vaddr=0x40089254 size=0x0b6a0 ( 46752) load
I (1159) boot: Loaded app from partition at offset 0x10000
I (1159) boot: Disabling RNG early entropy source...
E (60) psram: PSRAM ID read error: 0xffffffff

E (114) sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107
Card Mount Failed
PSRAM Initialization Failure
[E][camera.c:1113] camera_probe(): Detected camera not supported.
[E][camera.c:1379] esp_camera_init(): Camera probe failed with error 0x20004

anyone can point me in the right direction?

And what camera module (OV....) you got on your esp32 board? I also have two camera modules (the ones connected to the esp32 board via flex cable) that I can’t got to work. Switching the module from another working esp32cam made the not working board detecting the camera immediately :camera_flash:

HI, the connected module with the flex cable is OV2640.

I have 2 esp32 too, one is giving me the error

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

the other shows

[C][esp32_camera:048]: ESP32 Camera:
[C][esp32_camera:049]:   Name: cam
[C][esp32_camera:050]:   Internal: NO
[C][esp32_camera:052]:   Data Pins: D0:5 D1:18 D2:19 D3:21 D4:36 D5:39 D6:34 D7:35
[C][esp32_camera:053]:   VSYNC Pin: 25
[C][esp32_camera:054]:   HREF Pin: 23
[C][esp32_camera:055]:   Pixel Clock Pin: 22
[C][esp32_camera:056]:   External Clock: Pin:0 Frequency:10000000
[C][esp32_camera:060]:   I2C Pins: SDA:26 SCL:27
[C][esp32_camera:062]:   Reset Pin: -1
[C][esp32_camera:080]:   Resolution: 640x480 (VGA)
[E][esp32_camera:123]:   Setup Failed: ESP_ERR_NOT_FOUND

[V][esp-idf:000]: E (569) camera: Camera probe failed with error 0x105(ESP_ERR_NOT_FOUND)

[E][esp32_camera:024]: esp_camera_init failed: ESP_ERR_NOT_FOUND
[E][component:113]: Component esp32_camera was marked as failed

I’m going crazy :crazy_face:

I want to share back an update here.
I bought another esp32 cam and it works like a charm, probably both of my previous cam are broken

this one worked for me

esp32_camera:
  external_clock:
    pin: GPIO0
    frequency: 20MHz
  i2c_pins:
    sda: GPIO26
    scl: GPIO27
  data_pins: [GPIO5, GPIO18, GPIO19, GPIO21, GPIO36, GPIO39, GPIO34, GPIO35]

  # the order of the data_pins is significant, don't mix up the order

  vsync_pin: GPIO25
  href_pin: GPIO23
  pixel_clock_pin: GPIO22
  power_down_pin: GPIO32
  resolution: 800x600
  name: boiler-temperature-cam
  idle_framerate: 0.1fps

output:
  - platform: ledc
    pin: GPIO4
    channel: 2 # channel 1 is used for esp32_camera
    id: led
light:
  - platform: monochromatic
    output: led
    name: espcam_02 light

Just wondering what sort of lag people are seeing with these cameras. I’m seeing about 7 seconds at the moment and wondering if that is usual or if there is an easy fix? I do have a mm wave sensor also plugged into it.

2 Likes

Unfortunately has not helped my issue. I’m still only seeing one frame every 7 seconds or so. I will try my other one without the mm wave sensor attached and see if that is any faster.

Yeah my other cam is working ok so could the mm wave sensor be maxing out the chip?

Edit: Setup here

esphome:
  name: camera02
  platform: esp32
  board: esp32dev

# Enable logging
logger:
  baud_rate: 0

# Enable Home Assistant API
api:
  encryption:
    key: "<SECRET>"

ota:
  password: "<SECRET>"


wifi:
  ssid: "<SECRET>"
  password: "<SECRET>"

  manual_ip:
    static_ip: 192.168.1.121
    gateway: 192.168.1.254
    dns1: 192.168.1.206
    dns2: 192.168.1.165
    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Camera02 Fallback Hotspot"
    password: "<SECRET>"

captive_portal:

#esp32_ble_tracker:
#  scan_parameters:
#    interval: 1100ms
#    window: 1100ms
#    active: true

#bluetooth_proxy:
#  active: True

esp32_camera:
  external_clock:
    pin: GPIO0
    frequency: 8MHz
  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
  vertical_flip: false
  horizontal_mirror: false
  name: camera02

#esp32_camera_web_server:
 # - port: 8080
 #   mode: stream
#  - port: 8081
#    mode: snapshot

uart:
  tx_pin: 1
  rx_pin: 3
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

ld2410:

binary_sensor:
  - platform: ld2410
    has_target:
      name: Camera2 Presence
    has_moving_target:
      name: Camera2 Moving Target
    has_still_target:
      name: Camera2 Still Target

sensor:
  - platform: ld2410
    light:
      name: light
    moving_distance:
      name : Moving Distance
    still_distance:
      name: Still Distance
    moving_energy:
      name: Move Energy
    still_energy:
      name: Still Energy
    detection_distance:
      name: Detection Distance
    g0:
      move_energy:
        name: g0 move energy
      still_energy:
        name: g0 still energy
    g1:
      move_energy:
        name: g1 move energy
      still_energy:
        name: g1 still energy
    g2:
      move_energy:
        name: g2 move energy
      still_energy:
        name: g2 still energy
    g3:
      move_energy:
        name: g3 move energy
      still_energy:
        name: g3 still energy
    g4:
      move_energy:
        name: g4 move energy
      still_energy:
        name: g4 still energy
    g5:
      move_energy:
        name: g5 move energy
      still_energy:
        name: g5 still energy
    g6:
      move_energy:
        name: g6 move energy
      still_energy:
        name: g6 still energy
    g7:
      move_energy:
        name: g7 move energy
      still_energy:
        name: g7 still energy
    g8:
      move_energy:
        name: g8 move energy
      still_energy:
        name: g8 still energy

switch:
  - platform: ld2410
    engineering_mode:
      name: "engineering mode"
    bluetooth:
      name: "control bluetooth"

number:
  - platform: ld2410
    timeout:
      name: timeout
    light_threshold:
      name: light threshold
    max_move_distance_gate:
      name: max move distance gate
    max_still_distance_gate:
      name: max still distance gate
    g0:
      move_threshold:
        name: g0 move threshold
      still_threshold:
        name: g0 still threshold
    g1:
      move_threshold:
        name: g1 move threshold
      still_threshold:
        name: g1 still threshold
    g2:
      move_threshold:
        name: g2 move threshold
      still_threshold:
        name: g2 still threshold
    g3:
      move_threshold:
        name: g3 move threshold
      still_threshold:
        name: g3 still threshold
    g4:
      move_threshold:
        name: g4 move threshold
      still_threshold:
        name: g4 still threshold
    g5:
      move_threshold:
        name: g5 move threshold
      still_threshold:
        name: g5 still threshold
    g6:
      move_threshold:
        name: g6 move threshold
      still_threshold:
        name: g6 still threshold
    g7:
      move_threshold:
        name: g7 move threshold
      still_threshold:
        name: g7 still threshold
    g8:
      move_threshold:
        name: g8 move threshold
      still_threshold:
        name: g8 still threshold

Wow. That greatly improved the performance. Thanks. :smiley:

Had the same problem but found the below GPIO mapping and that works at least for me…worth trying