Freenove ESP32-WROVER Camera

Hi Everyone,

I have been struggling with the quality of the stream in ESPHome when I integrate the camera. With Arduino IDE, if I upload a sketch (CameraWebServer or VideoWebServer) and set the xclk frequency to 23hz, the camera runs perfectly. I can even stream at SVGA without any issues and get roughly 20fps. However, in ESPHOME, I can only set the xclk to 20hz and the stream is very laggy.

Any help would be greatly appreciated.

Cheers!

Code for your device?

There is a hack to get esphome to run at another speed, with good results. If I find the thread, I’ll let you know. In the meantime, search away.

EDIT: here ESP32 Camera Buffer Space / API disconnects - #5 by diplix

Alas, I saw that post in my previous search and tried it… Doesn’t seems to applied to the board I’m using, which utilize the esp32-wrover-kit. Only when I bump the xclk above 23Hz that it perform with a decent frame rate (done through Arduino IDE instead of ESPHome).

By code, do you mean ESP32-WROVER-E?

Here’s a summary of the board:

  • ESP32-Wrover-E Chip with 4MB PSRAM
  • Built-in USB-to-UART (CH340C drivers) — no need for an FTDI programmer
  • Camera OV2640 2 Megapixel
  • BOOT and RST buttons
  • LED indicators (RX/TX ON/OFF, and built-in LED (GPIO2))
  • Onboard antenna

Freenove ESP32-WROVER Board (bought mine without the SIM card as I didn’t need it for my project).

By code I think he meant your yaml which generated your firmware.

To which I’d add your logs…

Good catch! I’ll post it up…

esphome:
  name: esp32-cam
  friendly_name: ESP32 Cam

esp32:
  board: esp-wrover-kit
  framework:
    type: arduino
    version: recommended

# Example configuration entry
esp32_camera:
  name: "ESP32 Camera"
  external_clock:
    pin: GPIO21
    frequency: 16MHz
  i2c_pins:
    sda: GPIO26
    scl: GPIO27
  data_pins: [GPIO4, GPIO5, GPIO18, GPIO19, GPIO36, GPIO39, GPIO34, GPIO35]
  vsync_pin: GPIO25
  href_pin: GPIO23
  pixel_clock_pin: GPIO22

  # Image Quality
  resolution: VGA
  jpeg_quality: 10
#  aec2: True
#  aec_mode: AUTO
#  max_framerate: 6 fps
#  idle_framerate: 0.1 fps
#  wb_mode: home
#  agc_gain_ceiling: 8x
#  vertical_flip: False
#  horizontal_mirror: False

esp32_camera_web_server:
  - port: 8080
    mode: Stream
  - port: 8081
    mode: snapshot

Currently at 16Hz on xclk, but tried from 8Hz up to 20Hz and the experience is the same…