ESP32 camera with ESPhome and i cant get a picture

Hello form Germany,
I´ve got Home Assistant running on a Raspberry Pi 3 with ESPhome installed. Today my ESP32 Camera with a little mainboard arrived and I try to get it to work.
https://www.amazon.de/gp/product/B097Y2KDBZ/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1

I can see the camera in the ESPhome section and when i klick on “validate” I get this:

INFO Reading configuration /config/esphome/esp-cam1.yaml...
INFO Configuration is valid!
esphome:
  name: esp-cam1
  platform: ESP32
  board: esp32dev
  arduino_version: platformio/[email protected]
  build_path: esp-cam1
  platformio_options: {}
  includes: []
  libraries: []
  name_add_mac_suffix: false
logger:
  baud_rate: 115200
  tx_buffer_size: 512
  deassert_rts_dtr: false
  hardware_uart: UART0
  level: DEBUG
  logs: {}
api:
  password: -------------------------
  port: 6053
  reboot_timeout: 15min
ota:
  password: ------------------------------------
  safe_mode: true
  port: 3232
  reboot_timeout: 5min
  num_attempts: 10
wifi:
  ap:
    ssid: Esp-Cam1 Fallback Hotspot
    password: --------------------------
    ap_timeout: 1min
  enable_mdns: true
  domain: .local
  reboot_timeout: 15min
  power_save_mode: LIGHT
  fast_connect: false
  networks:
  - ssid: ----------------------------
    password: '----------------------'
    priority: 0.0
  use_address: esp-cam1.local
captive_portal: {}
esp32_camera:
  external_clock:
    pin: 0
    frequency: 20000000.0
  i2c_pins:
    sda: 26
    scl: 27
  data_pins:
  - 5
  - 18
  - 19
  - 21
  - 36
  - 39
  - 34
  - 35
  vsync_pin: 25
  href_pin: 23
  pixel_clock_pin: 22
  power_down_pin: 32
  name: esp-cam1
  disabled_by_default: false
  max_framerate: 10.0
  idle_framerate: 0.1
  resolution: 640X480
  jpeg_quality: 10
  contrast: 0
  brightness: 0
  saturation: 0
  vertical_flip: true
  horizontal_mirror: true
  test_pattern: false

I can ping the camera with the command line from windows. But i can´t get a picture/ video out of it. I tried to add a picture to the dashboard, with the IP as the source of the picture.

type: picture
image: //192.168.0.20
tap_action:
  action: none
hold_action:
  action: none

Is there something wrong with the code or did I mess up the installion of my ESP32 Cam?
And a maybe dump question: Can I let the CAM connected to the ESP flasher Board to run it or do
I have to use 5v GND on the Pins? Can´t find anything about it but I tried both ways. All the videos and tutorials that I found were about a little USB flasher and no one used this board that i´ve got.
I hope anyone can help :slight_smile:

What does the log say?

INFO Reading configuration /config/esphome/esp-cam1.yaml...
INFO Starting log output from esp-cam1.local using esphome API
INFO Connecting to esp-cam1.local:6053 (192.168.0.20)
INFO Successfully connected to esp-cam1.local
[22:42:14][I][app:106]: ESPHome version 2021.8.2 compiled on Sep  1 2021, 19:44:34
[22:42:14][C][wifi:499]: WiFi:
[22:42:14][C][wifi:359]:   SSID: [redacted]
[22:42:14][C][wifi:360]:   IP Address: 192.168.0.20
[22:42:14][C][wifi:362]:   BSSID: [redacted]
[22:42:14][C][wifi:363]:   Hostname: 'esp-cam1'
[22:42:14][C][wifi:367]:   Signal strength: -53 dB ▂▄▆█
[22:42:14][C][wifi:371]:   Channel: 1
[22:42:14][C][wifi:372]:   Subnet: 255.255.255.0
[22:42:14][C][wifi:373]:   Gateway: 192.168.0.1
[22:42:14][C][wifi:374]:   DNS1: 192.168.0.1
[22:42:14][C][wifi:375]:   DNS2: 0.0.0.0
[22:42:14][C][logger:189]: Logger:
[22:42:14][C][logger:190]:   Level: DEBUG
[22:42:14][C][logger:191]:   Log Baud Rate: 115200
[22:42:14][C][logger:192]:   Hardware UART: UART0
[22:42:14][C][esp32_camera:043]: ESP32 Camera:
[22:42:14][C][esp32_camera:044]:   Name: esp-cam1
[22:42:14][C][esp32_camera:045]:   Board Has PSRAM: YES
[22:42:14][C][esp32_camera:047]:   Data Pins: D0:5 D1:18 D2:19 D3:21 D4:36 D5:39 D6:34 D7:35
[22:42:14][C][esp32_camera:048]:   VSYNC Pin: 25
[22:42:14][C][esp32_camera:049]:   HREF Pin: 23
[22:42:14][C][esp32_camera:050]:   Pixel Clock Pin: 22
[22:42:14][C][esp32_camera:051]:   External Clock: Pin:0 Frequency:20000000
[22:42:14][C][esp32_camera:052]:   I2C Pins: SDA:26 SCL:27
[22:42:14][C][esp32_camera:053]:   Reset Pin: -1
[22:42:14][C][esp32_camera:071]:   Resolution: 640x480 (VGA)
[22:42:14][E][esp32_camera:090]:   Setup Failed: ERROR
[22:42:14][C][captive_portal:148]: Captive Portal:
[22:42:14][C][ota:029]: Over-The-Air Updates:
[22:42:14][C][ota:030]:   Address: esp-cam1.local:3232
[22:42:14][C][ota:032]:   Using Password.
[22:42:14][C][api:095]: API Server:
[22:42:14][C][api:096]:   Address: esp-cam1.local:6053

thanks for the reply. just found out about the log…

Keep going…

Missed this, where did you get your pin assignments from?

I got them from tutorials. In three different tutorials they all had the same pinout so i tought that must be safe.

ok so the pins I used are for the Ai-Thinker Camera. Now i´ve got them for the ESP32 Camera Component form the ESPhome Homepage. But still the the error…

INFO Reading configuration /config/esphome/esp-cam1.yaml...
INFO Starting log output from esp-cam1.local using esphome API
INFO Connecting to esp-cam1.local:6053 (192.168.0.20)
INFO Successfully connected to esp-cam1.local
[23:44:20][I][app:106]: ESPHome version 2021.8.2 compiled on Sep  1 2021, 23:32:28
[23:44:20][C][wifi:499]: WiFi:
[23:44:20][C][wifi:359]:   SSID: [redacted]
[23:44:20][C][wifi:360]:   IP Address: 192.168.0.20
[23:44:20][C][wifi:362]:   BSSID: [redacted]
[23:44:20][C][wifi:363]:   Hostname: 'esp-cam1'
[23:44:20][C][wifi:367]:   Signal strength: -48 dB ▂▄▆█
[23:44:20][C][wifi:371]:   Channel: 1
[23:44:20][C][wifi:372]:   Subnet: 255.255.255.0
[23:44:20][C][wifi:373]:   Gateway: 192.168.0.1
[23:44:20][C][wifi:374]:   DNS1: 192.168.0.1
[23:44:20][C][wifi:375]:   DNS2: 0.0.0.0
[23:44:20][C][logger:189]: Logger:
[23:44:20][C][logger:190]:   Level: DEBUG
[23:44:20][C][logger:191]:   Log Baud Rate: 115200
[23:44:20][C][logger:192]:   Hardware UART: UART0
[23:44:20][C][esp32_camera:043]: ESP32 Camera:
[23:44:20][C][esp32_camera:044]:   Name: esp-cam1
[23:44:20][C][esp32_camera:045]:   Board Has PSRAM: YES
[23:44:20][C][esp32_camera:047]:   Data Pins: D0:17 D1:35 D2:34 D3:5 D4:39 D5:18 D6:36 D7:19
[23:44:20][C][esp32_camera:048]:   VSYNC Pin: 22
[23:44:20][C][esp32_camera:049]:   HREF Pin: 26
[23:44:20][C][esp32_camera:050]:   Pixel Clock Pin: 21
[23:44:20][C][esp32_camera:051]:   External Clock: Pin:27 Frequency:20000000
[23:44:20][C][esp32_camera:052]:   I2C Pins: SDA:25 SCL:23
[23:44:20][C][esp32_camera:053]:   Reset Pin: 15
[23:44:20][C][esp32_camera:071]:   Resolution: 640x480 (VGA)
[23:44:20][E][esp32_camera:090]:   Setup Failed: ERROR
[23:44:20][C][captive_portal:148]: Captive Portal:
[23:44:20][C][ota:029]: Over-The-Air Updates:
[23:44:21][C][ota:030]:   Address: esp-cam1.local:3232
[23:44:21][C][ota:032]:   Using Password.
[23:44:21][C][api:095]: API Server:
[23:44:21][C][api:096]:   Address: esp-cam1.local:6053

You need to ask your seller for the pinout of that particular board.

Send the seller a message via Amazon. They have 100% positive rating, maybe you’re lucky and they can at least give you a link. :slight_smile:

ok thank you guys. I´ll give it a try. If I get it to work I will post it here.

1 Like

You are missing the image server part, add this to your yaml:

esp32_camera_web_server:

– – – – – – – –

  • port: 81
    mode: stream
  • port: 82
    mode: snapshot

Then use IP with the port number:

image: //192.168.0.20:82 for picture or

image: //192.168.0.20:81 for a stream.

That is not needed. You get a camera entity in home assistant without using esp_camera_web_server.

1 Like

Thanks for the response … was thinking for access for third parties.
Also, I am extending this and want to publish the camera.image to mqtt.
Trying to keep it within ESPhome, something like this:

on_image:
then:
- mqtt.publish:
topic: ${devicename}/image/data
payload: !lambda |-
return id(esp32cam_voorhek_camera);

but no luck.

Other sensors publish automatically to mqtt but not the actual image.

Any ideas / help please?

Please post your yaml properly.