TTGO T-Camera (with PIR) - Camera setup failed

Hi guys

I have a TTGO T-Camera with OLED / PIR onboard. I had this working fine a few months ago when i was testing, but for some reason now the camera isnt working. I noticed no camera entity in HA first then saw the error in the logs. I know this config was valid before so im guessing something changed but not able to work out what yet.

This is in the log when running.

 [18:06:01][C][esp32_camera:046]: ESP32 Camera:
 [18:06:01][C][esp32_camera:047]:   Name: doorbelcam
 [18:06:01][C][esp32_camera:048]:   Internal: NO
 [18:06:01][C][esp32_camera:050]:   Board Has PSRAM: YES
 [18:06:01][C][esp32_camera:053]:   Data Pins: D0:5 D1:14 D2:4 D3:15 D4:18 D5:23 D6:36 D7:39
 [18:06:01][C][esp32_camera:054]:   VSYNC Pin: 27
 [18:06:01][C][esp32_camera:055]:   HREF Pin: 25
 [18:06:01][C][esp32_camera:056]:   Pixel Clock Pin: 19
 [18:06:01][C][esp32_camera:057]:   External Clock: Pin:32 Frequency:20000000
 [18:06:01][C][esp32_camera:058]:   I2C Pins: SDA:13 SCL:12
 [18:06:01][C][esp32_camera:059]:   Reset Pin: -1
 [18:06:01][C][esp32_camera:077]:   Resolution: 640x480 (VGA)
 [18:06:01][E][esp32_camera:096]:   Setup Failed: ERROR

Also when i was compiling with some changed i saw some SPI related errors, not sure if they were there before.

/data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-spi.c: In function 'spiTransferBytesNL':
/data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-spi.c:922:39: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
                 uint8_t * last_out8 = &result[c_longs-1];
                                       ^
/data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-spi.c:923:40: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
                 uint8_t * last_data8 = &last_data;
                                        ^

My Camera config is:

esphome:
  name: doorbell
  platform: ESP32
  board: esp-wrover-kit
 ...
esp32_camera:
  name: "doorcam"
  external_clock:
    pin: 32
    frequency: 20MHz
  i2c_pins:
    sda: 13
    scl: 12
  data_pins:
    - 5
    - 14
    - 4
    - 15
    - 18
    - 23
    - 36
    - 39
  vsync_pin: 27
  href_pin: 25
  pixel_clock_pin: 19
#  resolution: 800x600
  resolution: 640x480

Anyone else seeing this issue?

Hello Tom,

In a word, yes. I have been having this kind of problem with 3 boards out of a total of 4. One has been ok all along and three started giving trouble after an update. Sadly, I have no Idea which update but it was late spring, I think. Cameras that work on the ‘good’ setup won’t on the other. I had all 4 working for a short while in early spring.

[23:34:47][E][camera.c:1113] camera_probe(): Detected camera not supported.
[23:34:47][E][camera.c:1379] esp_camera_init(): Camera probe failed with error 0x20004
[23:34:47][E][esp32_camera:020]: esp_camera_init failed: ERROR
[23:34:47][E][component:112]: Component esp32_camera was marked as failed.

considering the source of these boards and cameras perhaps there should be a way to ‘force’ the software to “do it anyway”. Perhaps there is but I don’t know it…

My working and non-working configs are identical:

esp32_camera:
  name: Camera
  external_clock:
    pin: 32
    frequency: 20MHz
  i2c_pins:
    sda: 13
    scl: 12
  data_pins:
    - 5
    - 14
    - 4
    - 15
    - 18
    - 23
    - 36
    - 39
  vsync_pin: 27
  href_pin: 25
  pixel_clock_pin: 19
#  resolution: 640x480 # Can be higher, I think, but this has a pretty good framerate
  max_framerate: 5.0 fps

  idle_framerate: 1.0 fps
  
  resolution: XGA
#  resolution: UXGA

I have continued staying up to date in the vain hope that a fix will materialize - to no avail. I have since moved my supervised install on a NanoPI Core2 to an RPI4 8G running Deb11 and everything is up-to-date.

I haven’t been able to spend a lot of time on this problem and what I have spent was of course ineffective.

I am sorry I can’t offer a solution. Hopefully, someone will pass by, notice, and take pity on us!

Merry Christmas!

Q

1 Like

@Quanta I have a solution :slight_smile:

I added this to my camera config:

  power_down_pin: GPIO26

@tstill.1988 Thanks for the info. I will test this soon. My assumption is that it is a non-breaking change as well as an un-breaking change. That is to say, it shouldn’t hurt anything, operating on the assumption that GPIO26 is not in use for something else.

I have ben awfully busy with the holidays, a network meltdown and completing the transfer of HA to a RPI4-8G for the past month or so. Intermittent problems with my router and 24 port Gb switch forced me to transition to a 24 port POE switch (have 3 - 1 for spare) and accelerate some other changes. Appx 240 cat 5e runs were awaiting termination in my MDF. Will be done with that this weekend.

All that to get to reporting that when I transitioned to the new ESPHome framework and re-loaded firmware compiled on new system, the issue seems to have gone away for me. I wanted to report this earlier but domestic operational priorities superseded administrative reports…

I intend to add this change to all cameras as I imagine it helps assure proper startup of the camera which seemed to me to be the problem I was experiencing.

Thanks again,

Q