ESP32 Cam - working!

Looks out of focus.

Yes it is! This was the first ESPHome device I’ve used and I spent a long time flashing and re-flashing thinking there was a problem when it wouldn’t connect.

Have you found one and tried it? I had a quick search on aliexpress but probably had the wrong search search words as I found nothing

Basically you are looking for a U-FL connector and something that works for 2.4GHz.

1 Like

I have not really used it much I got it as it was cheap to play with.
The only thing I changed from default was 8 FPS.
This is a screen grab from it.

What’s max reliable frame rate ?

I have not tried it above 8 FPS as that would be ample for what I need such as a door bell. I run quite a few cameras for watching wildlife in the garden they are not connected to HA but are all running at 8 FPS and I get quite good results.

Hi, I installed the cam correctly and wanted to know if can turn it on and off and what is the procedure from Home Assitant. Thank you

1 Like

my cam, when it arrived it had the protective plastic on the lens, did you look?

that was it :frowning:

thanks!
now works fine, running it 800x600.

My camera also came with a small heatsink which i put on esp32 chip.
Currently running @ 10fps streaming, 0.1fps loading and had no issue: I must admit I never used “streaming” for more than 30-40s though

The current requirements are large and difficult to meet with a battery.
My esp32-cam runs hot to the touch. Perhaps with solar charging?

My esp32 cam arrived, unfortunately its not the ai thinker mode. I managed to flash it with FTL232 and my laptop, and ESPHOMEFLASHER, everything went well,
With 3,3 V does not connect to WiFi, with 5V yes, but I have this error

[E][esp32_camera:092]: Setup Failed: ERROR

The flash and the LED works fine but the camera shows nothing

Any clue?

esphome:
  name: cam
  platform: ESP32
  board: esp32dev

wifi:
  ssid: "xxxx"
  password: "xxxx"
  manual_ip:
    static_ip: 192.168.1.21
    gateway: 192.168.1.253
    subnet: 255.255.255.0

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:


esp32_camera:
  name: My Camera
  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
  
  



    
output:
#flashlight
  - platform: gpio
    pin: GPIO4
    id: gpio_4
#statuslight
  - platform: gpio
    pin:
      number: GPIO33
      inverted: True
    id: gpio_33
light:
#flashlight
  - platform: binary
    output: gpio_4
    name: $hostname flash
#statuslight
  - platform: binary   
    output: gpio_33
    name: $hostname status

I changed to these values but same error

  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

Is there any documentation on which pins are connected to what?

Finally I managed with the below code to not have any errors … everything works … but no cmera stream

esp32_camera:
  name: My Camera
  external_clock:
    pin: GPIO0
    frequency: 20MHz
  i2c_pins:
    sda: GPIO26
    scl: GPIO27
  data_pins: [GPIO35, GPIO34, GPIO39, GPIO36, GPIO19, GPIO21, GPIO5, GPIO18]
  vsync_pin: GPIO25
  href_pin: GPIO23
  pixel_clock_pin: GPIO22
  power_down_pin: GPIO32

This in lovelace

  - id: camera_esp
    type: picture-entity
    title: Cam
    show_header_toggle: false
    aspect_ratio: 16x9
    entity: camera.my_camera
    camera_view: live
1 Like

Log seems ok to me. Does ESPHome store the JPG somewhere, where I can check if they are produced or not?

[09:26:59][I][application:097]: esphome-core version 1.12.2 compiled on May 29 2019, 21:35:27
[09:26:59][C][wifi:371]: WiFi:
[09:26:59][C][wifi:253]:   SSID: [redacted]
[09:26:59][C][wifi:254]:   IP Address: 192.168.1.211
[09:26:59][C][wifi:256]:   BSSID: [redacted]
[09:26:59][C][wifi:257]:   Hostname: 'cam'
[09:26:59][C][wifi:261]:   Signal strength: -72 dB ▂▄▆█
[09:26:59][C][wifi:262]:   Channel: 6
[09:26:59][C][wifi:263]:   Subnet: 255.255.255.0
[09:26:59][C][wifi:264]:   Gateway: 192.168.1.253
[09:26:59][C][wifi:265]:   DNS1: 1.1.1.1
[09:26:59][C][wifi:266]:   DNS2: 1.0.0.1
[09:26:59][C][output.gpio:025]: GPIO Binary Output:
[09:26:59][C][output.gpio:026]:   Pin: GPIO4 (Mode: OUTPUT)
[09:26:59][C][output.gpio:025]: GPIO Binary Output:
[09:26:59][C][output.gpio:026]:   Pin: GPIO33 (Mode: OUTPUT, INVERTED)
[09:26:59][C][logger:142]: Logger:
[09:26:59][C][logger:143]:   Level: DEBUG
[09:26:59][C][logger:144]:   Log Baud Rate: 115200
[09:26:59][C][logger:145]:   Hardware UART: UART0
[09:26:59][C][light.state:225]: Light 'Cam flash'
[09:27:00][C][light.state:225]: Light 'Cam status'
[09:27:00][C][esp32_camera:044]: ESP32 Camera:
[09:27:00][C][esp32_camera:045]:   Name: My Camera
[09:27:00][C][esp32_camera:046]:   Board Has PSRAM: YES
[09:27:00][C][esp32_camera:048]:   Data Pins: D0:35 D1:34 D2:39 D3:36 D4:19 D5:21 D6:5 D7:18
[09:27:00][C][esp32_camera:049]:   VSYNC Pin: 25
[09:27:00][C][esp32_camera:050]:   HREF Pin: 23
[09:27:00][C][esp32_camera:051]:   Pixel Clock Pin: 22
[09:27:00][C][esp32_camera:052]:   External Clock: Pin:0 Frequency:20000000
[09:27:00][C][esp32_camera:053]:   I2C Pins: SDA:26 SCL:27
[09:27:00][C][esp32_camera:054]:   Reset Pin: -1
[09:27:00][C][esp32_camera:075]:   Resolution: 640x480 (VGA)
[09:27:00][C][esp32_camera:098]:   JPEG Quality: 10
[09:27:00][C][esp32_camera:100]:   Contrast: 0
[09:27:00][C][esp32_camera:101]:   Brightness: 0
[09:27:00][C][esp32_camera:102]:   Saturation: 0
[09:27:00][C][esp32_camera:103]:   Vertical Flip: ON
[09:27:00][C][esp32_camera:104]:   Horizontal Mirror: ON
[09:27:00][C][esp32_camera:121]:   Test Pattern: NO
[09:27:00][C][text_sensor.version:027]: Version Text Sensor 'Cam ESPHome Version'
[09:27:00][C][text_sensor.version:027]:   Icon: 'mdi:new-box'
[09:27:00][C][sensor.wifi_signal:027]: WiFi Signal 'Cam WiFi Signal'
[09:27:00][C][sensor.wifi_signal:027]:   Unit of Measurement: 'dB'
[09:27:00][C][sensor.wifi_signal:027]:   Accuracy Decimals: 0
[09:27:00][C][sensor.wifi_signal:027]:   Icon: 'mdi:wifi'
[09:27:00][C][web_server:126]: Web Server:
[09:27:00][C][web_server:127]:   Address: 192.168.1.211:80
[09:27:00][C][api:101]: API Server:
[09:27:00][C][api:102]:   Address: 192.168.1.211:6053
[09:27:00][C][ota:127]: Over-The-Air Updates:
[09:27:00][C][ota:128]:   Address: 192.168.1.211:3232
[09:27:19][I][ota:152]: Boot seems successful, resetting boot loop counter.

You don’t mention adding it via the configurations page in HA?

Mmhh yes I added it, everything is there: the LED turns ON and also the flash turns ON, the CAM symbol, its there, when I click on it … shows no feed

Cattura

Cattura

The log will show you if images are being created.

I have already asked, but “Is there any documentation on which pins are connected to what?”

Exactly what device did you buy (link to the web page please).

  1. Ok
  2. No, searched but could not find, only the below

OV2640 ESP32-CAM Wireless WiFi Bluetooth Module Camera Development Board ESP32 DC 5V Dual-core 32-bit CPU 2MP TF card OV7670

Ok, on some website they say to use the AI thinker mode: BTW when they say RESET mode GPIO -1, what is -1, GPIO1?

EDIT: well its the pinout that I am using right now … I rechecked my code with the below code, and seems to me to be the same (RESETcode its not in the ESPhome code)

#elif defined(CAMERA_MODEL_AI_THINKER)
  #define PWDN_GPIO_NUM     32
  #define RESET_GPIO_NUM    -1
  #define XCLK_GPIO_NUM      0
  #define SIOD_GPIO_NUM     26
  #define SIOC_GPIO_NUM     27
  #define Y9_GPIO_NUM       35
  #define Y8_GPIO_NUM       34
  #define Y7_GPIO_NUM       39
  #define Y6_GPIO_NUM       36
  #define Y5_GPIO_NUM       21
  #define Y4_GPIO_NUM       19
  #define Y3_GPIO_NUM       18
  #define Y2_GPIO_NUM        5
  #define VSYNC_GPIO_NUM    25
  #define HREF_GPIO_NUM     23
  #define PCLK_GPIO_NUM     22