ESP32-CAM Got invalid frame from camera!

I tried that to no avail, sadly. Would love to know other tricks.

I know I am a little late but having just spent the morning solving this problem, I thought Iā€™d share a (janky) solution that worked for. (This thread is also one of the highest google results for me when I tried googling this error, so I figure more people looking for a solution might end up here). In my case, after my 10th (maybe more) attempt at reseating the ribbon cable, I finally got a good connection with the following approach:

I cut a piece of plastic (from one of those bags that sensors are often shipped in) to the width of the ribbon cable. I then opened the ribbon clip on the PCB, placed this plastic piece on top of the ribbon cable and squeezed it shut resulting in more pressure, pushing the ribbon into the connectors. This is more art than technique I thinkā€¦ actually its probably just luck. Nevertheless, I had this problem and this is what solved it for me.

The whole kit does seem very budget oriented so I wouldnā€™t be surprised if some people just have defective units, but you could give this a try and see if it also works for you too. Overall I wouldnā€™t recommend this setup for any serious use case as itā€™s far too unreliable.
(For me itā€™s just a toy to familiarize myself with cameras in ESPHome. Itā€™s also nice to have a temporary camera stream input into HA that I can use to test some of the AI image processing tools I might want to eventually use for presence detection of cars in the driveway etcā€¦).

Again, sorry for reopening an old chat. (I had a quick look through guidelines but couldnā€™t find anything on when to respond to old vs starting a new topic. Please let me know if I missed something and or where I could find information to avoid making a similar mistake (if it is one) in the future.)

1 Like

7 months since last post is not a problem. And thanks for your input.

1 Like

Iā€™d like to confirm that it si indeed a HW problem with these cams. If you have and idle cam status everything should work and the problem is the camera connector or the camera.

# Example configuration entry
esp32_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

  # Image settings
  name: ESP32 Camera
  icon: mdi:camera
  idle_framerate: 1 fps
  max_framerate: 15 fps
  resolution: 800x600
  jpeg_quality: 20
  vertical_flip: true

#Stream
esp32_camera_web_server:
- port: 8080
  mode: stream

# Flashlight
output:
  - platform: ledc
    pin: GPIO4
    id: gpio_4
    channel: 2
light:
  - platform: binary
    output: gpio_4
    name: ESP32 Camera Light
switch:
  - platform: restart
    name: "ESP32 Camera Restart"

sensor:
  - platform: uptime
    name: "ESP32 Camera Uptime Sensor"
    
  - platform: wifi_signal
    name: "ESP32 Camera WiFi Signal"
    update_interval: 60s