ESP32 Cam - working!

Best tip I can give you is connect the espcam to your serial and monitor the output…

Meanwhile I have succeeded in soldering the tiny 0-ohm resistor to accept my external antenna > no small feat considering I really need some glasses :eyeglasses:

Have ordered some more camera’s from our chinese friends, mostly OV2640 adjusted for night vision (dual use 650nm & 850nm) and a OV7725 one for comparison…

Would really like a solution for recording though. I know these camera’s are not meant for recording video, but I can get them streaming quite stable around 10fps. I’d be happy with pictures at lower fps too…

Hi, I can’t find anything usable on the serial monitor… as soon as I “enable” the LED, it works but there is no more cam stream (idle) and when I remove the LED code it streams again…

The LED code:

light:
  - platform: monochromatic
    output: espCamLED
    name: "${esp_name} light"

output:
  - platform: ledc
    channel: 2
    pin: 4
    id: espCamLED

Some serial logging with LED:

[10:21:57][C][wifi:443]: WiFi:
[10:21:57][C][wifi:303]:   SSID: 'ssid'
[10:21:57][C][wifi:304]:   IP Address: 192.168.30.103
[10:21:57][C][wifi:306]:   BSSID: A2:6C:AC:42:C4:ED
[10:21:57][C][wifi:307]:   Hostname: 'esp32_cam_01'
[10:21:57][C][wifi:311]:   Signal strength: -64 dB ▂▄▆█
[10:21:57][C][wifi:315]:   Channel: 6
[10:21:57][C][wifi:316]:   Subnet: 255.255.255.0
[10:21:57][C][wifi:317]:   Gateway: 192.168.30.254
[10:21:57][C][wifi:318]:   DNS1: 1.1.1.1
[10:21:57][C][wifi:319]:   DNS2: 1.0.0.1
[10:21:57][C][ledc.output:032]: LEDC Output:
[10:21:57][C][ledc.output:033]:   Pin GPIO4 (Mode: OUTPUT)
[10:21:57][C][ledc.output:034]:   LEDC Channel: 2
[10:21:57][C][ledc.output:035]:   Frequency: 1000.0 Hz
[10:21:57][C][logger:185]: Logger:
[10:21:57][C][logger:186]:   Level: DEBUG
[10:21:57][C][logger:187]:   Log Baud Rate: 115200
[10:21:57][C][logger:188]:   Hardware UART: UART0
[10:21:57][C][light:178]: Light 'esp32_cam_01 light'
[10:21:57][C][light:180]:   Default Transition Length: 1.0s
[10:21:57][C][light:181]:   Gamma Correct: 2.80
[10:21:57][C][esp32_camera:043]: ESP32 Camera:
[10:21:57][C][esp32_camera:044]:   Name: esp32_cam_01 Camera
[10:21:57][C][esp32_camera:045]:   Board Has PSRAM: YES
[10:21:57][C][esp32_camera:047]:   Data Pins: D0:5 D1:18 D2:19 D3:21 D4:36 D5:39 D6:34 D7:35
[10:21:57][C][esp32_camera:048]:   VSYNC Pin: 25
[10:21:57][C][esp32_camera:049]:   HREF Pin: 23
[10:21:57][C][esp32_camera:050]:   Pixel Clock Pin: 22
[10:21:57][C][esp32_camera:051]:   External Clock: Pin:0 Frequency:20000000
[10:21:57][C][esp32_camera:052]:   I2C Pins: SDA:26 SCL:27
[10:21:57][C][esp32_camera:053]:   Reset Pin: -1
[10:21:57][C][esp32_camera:086]:   Resolution: 1600x1200 (UXGA)
[10:21:57][C][esp32_camera:099]:   JPEG Quality: 10
[10:21:57][C][esp32_camera:101]:   Contrast: 0
[10:21:57][C][esp32_camera:102]:   Brightness: 0
[10:21:57][C][esp32_camera:103]:   Saturation: 0
[10:21:57][C][esp32_camera:104]:   Vertical Flip: OFF
[10:21:57][C][esp32_camera:105]:   Horizontal Mirror: OFF
[10:21:57][C][esp32_camera:122]:   Test Pattern: NO
[10:21:57][C][restart:021]: Restart Switch 'esp32_cam_01 - ESP Restart'
[10:21:57][C][restart:021]:   Icon: 'mdi:restart'
[10:21:57][C][homeassistant.time:010]: Home Assistant Time:
[10:21:57][C][homeassistant.time:011]:   Timezone: 'CET-1CEST-2,M3.4.0/2,M10.5.0/3'
[10:21:58][C][wifi_info:012]: WifiInfo Mac Address 'esp32_cam_01 Mac Wifi Address'
[10:21:58][C][captive_portal:169]: Captive Portal:
[10:21:58][C][web_server:132]: Web Server:
[10:21:58][C][web_server:133]:   Address: 192.168.30.103:80
[10:21:58][C][ota:029]: Over-The-Air Updates:
[10:21:58][C][ota:030]:   Address: 192.168.30.103:3232
[10:21:58][C][api:095]: API Server:
[10:21:58][C][api:096]:   Address: 192.168.30.103:6053
[10:21:58][C][wifi_signal.sensor:009]: WiFi Signal 'esp32_cam_01 WiFi Signal'
[10:21:58][C][wifi_signal.sensor:009]:   Unit of Measurement: 'dB'
[10:21:58][C][wifi_signal.sensor:009]:   Accuracy Decimals: 0
[10:21:58][C][wifi_signal.sensor:009]:   Icon: 'mdi:wifi'
[10:21:58][C][wifi_info:009]: WifiInfo IPAddress 'esp32_cam_01 IP Address'
[10:21:58][C][wifi_info:010]: WifiInfo SSID 'esp32_cam_01 Connected SSID'
[10:21:58][C][wifi_info:011]: WifiInfo BSSID 'esp32_cam_01 Connected BSSID'
[10:22:19][D][api:067]: Disconnecting ESPHome v1.16.2 (192.168.30.10)
[10:22:33][D][sensor:092]: 'esp32_cam_01 WiFi Signal': Sending state -69.00000 dB with 0 decimals of accuracy
[10:22:51][D][api.connection:604]: Client 'Home Assistant 2021.2.3 (192.168.30.10)' connected successfully!
[10:22:51][D][time:040]: Synchronized time: Sun Feb 28 10:22:49 2021
[10:22:56][D][light:265]: 'esp32_cam_01 light' Setting:
[10:22:56][D][light:274]:   State: ON
[10:22:56][D][light:304]:   Transition Length: 1.0s
[10:22:58][D][light:265]: 'esp32_cam_01 light' Setting:
[10:22:58][D][light:274]:   State: OFF
[10:22:58][D][light:304]:   Transition Length: 1.0s
[10:23:02][D][light:265]: 'esp32_cam_01 light' Setting:
[10:23:02][D][light:274]:   State: ON
[10:23:02][D][light:304]:   Transition Length: 1.0s
[10:23:04][D][light:265]: 'esp32_cam_01 light' Setting:
[10:23:04][D][light:274]:   State: OFF
[10:23:04][D][light:304]:   Transition Length: 1.0s
[10:23:33][D][sensor:092]: 'esp32_cam_01 WiFi Signal': Sending state -70.00000 dB with 0 decimals of accuracy

And without LED:

[10:27:56][D][api.connection:604]: Client 'ESPHome v1.16.2 (192.168.30.10)' connected successfully!
[10:27:56][D][time:040]: Synchronized time: Sun Feb 28 10:27:54 2021
[10:27:56][I][app:105]: ESPHome version 1.16.2 compiled on Feb 28 2021, 10:27:17
[10:27:56][C][wifi:443]: WiFi:
[10:27:56][C][wifi:303]:   SSID: 'ssid'
[10:27:56][C][wifi:304]:   IP Address: 192.168.30.103
[10:27:56][C][wifi:306]:   BSSID: A2:6C:AC:42:C4:ED
[10:27:56][C][wifi:307]:   Hostname: 'esp32_cam_01'
[10:27:56][C][wifi:311]:   Signal strength: -71 dB ▂▄▆█
[10:27:56][C][wifi:315]:   Channel: 6
[10:27:56][C][wifi:316]:   Subnet: 255.255.255.0
[10:27:56][C][wifi:317]:   Gateway: 192.168.30.254
[10:27:56][C][wifi:318]:   DNS1: 1.1.1.1
[10:27:56][C][wifi:319]:   DNS2: 1.0.0.1
[10:27:56][C][logger:185]: Logger:
[10:27:56][C][logger:186]:   Level: DEBUG
[10:27:56][C][logger:187]:   Log Baud Rate: 115200
[10:27:56][C][logger:188]:   Hardware UART: UART0
[10:27:56][C][esp32_camera:043]: ESP32 Camera:
[10:27:56][C][esp32_camera:044]:   Name: esp32_cam_01 Camera
[10:27:56][C][esp32_camera:045]:   Board Has PSRAM: YES
[10:27:56][C][esp32_camera:047]:   Data Pins: D0:5 D1:18 D2:19 D3:21 D4:36 D5:39 D6:34 D7:35
[10:27:56][C][esp32_camera:048]:   VSYNC Pin: 25
[10:27:56][C][esp32_camera:049]:   HREF Pin: 23
[10:27:56][C][esp32_camera:050]:   Pixel Clock Pin: 22
[10:27:56][C][esp32_camera:051]:   External Clock: Pin:0 Frequency:20000000
[10:27:56][C][esp32_camera:052]:   I2C Pins: SDA:26 SCL:27
[10:27:56][C][esp32_camera:053]:   Reset Pin: -1
[10:27:56][C][esp32_camera:086]:   Resolution: 1600x1200 (UXGA)
[10:27:56][C][esp32_camera:099]:   JPEG Quality: 10
[10:27:56][C][esp32_camera:101]:   Contrast: 0
[10:27:56][C][esp32_camera:102]:   Brightness: 0
[10:27:56][C][esp32_camera:103]:   Saturation: 0
[10:27:56][C][esp32_camera:104]:   Vertical Flip: OFF
[10:27:56][C][esp32_camera:105]:   Horizontal Mirror: OFF
[10:27:56][C][esp32_camera:122]:   Test Pattern: NO
[10:27:56][C][restart:021]: Restart Switch 'esp32_cam_01 - ESP Restart'
[10:27:56][C][restart:021]:   Icon: 'mdi:restart'
[10:27:56][C][homeassistant.time:010]: Home Assistant Time:
[10:27:56][C][homeassistant.time:011]:   Timezone: 'CET-1CEST-2,M3.4.0/2,M10.5.0/3'
[10:27:56][C][wifi_info:012]: WifiInfo Mac Address 'esp32_cam_01 Mac Wifi Address'
[10:27:56][C][captive_portal:169]: Captive Portal:
[10:27:56][C][web_server:132]: Web Server:
[10:27:56][C][web_server:133]:   Address: 192.168.30.103:80
[10:27:56][C][ota:029]: Over-The-Air Updates:
[10:27:56][C][ota:030]:   Address: 192.168.30.103:3232
[10:27:56][C][api:095]: API Server:
[10:27:56][C][api:096]:   Address: 192.168.30.103:6053
[10:27:56][C][wifi_signal.sensor:009]: WiFi Signal 'esp32_cam_01 WiFi Signal'
[10:27:56][C][wifi_signal.sensor:009]:   Unit of Measurement: 'dB'
[10:27:56][C][wifi_signal.sensor:009]:   Accuracy Decimals: 0
[10:27:56][C][wifi_signal.sensor:009]:   Icon: 'mdi:wifi'
[10:27:56][C][wifi_info:009]: WifiInfo IPAddress 'esp32_cam_01 IP Address'
[10:27:56][C][wifi_info:010]: WifiInfo SSID 'esp32_cam_01 Connected SSID'
[10:27:56][C][wifi_info:011]: WifiInfo BSSID 'esp32_cam_01 Connected BSSID'
[10:27:57][D][api.connection:604]: Client 'Home Assistant 2021.2.3 (192.168.30.10)' connected successfully!
[10:27:57][D][time:040]: Synchronized time: Sun Feb 28 10:27:55 2021
[10:27:57][D][esp32_camera:159]: Got Image: len=98985
[10:27:59][D][esp32_camera:159]: Got Image: len=91447
[10:28:01][D][esp32_camera:159]: Got Image: len=91296
[10:28:03][D][esp32_camera:159]: Got Image: len=88786
[10:28:05][D][esp32_camera:159]: Got Image: len=74993
[10:28:07][D][esp32_camera:159]: Got Image: len=74984
[10:28:09][D][esp32_camera:159]: Got Image: len=74861
[10:28:11][D][esp32_camera:159]: Got Image: len=74695
[10:28:13][D][esp32_camera:159]: Got Image: len=74696
[10:28:15][D][esp32_camera:159]: Got Image: len=74892
[10:28:17][D][esp32_camera:159]: Got Image: len=75161
[10:28:19][D][esp32_camera:159]: Got Image: len=74901
[10:28:21][D][esp32_camera:159]: Got Image: len=74867
[10:28:23][D][esp32_camera:159]: Got Image: len=73918
[10:28:25][D][esp32_camera:159]: Got Image: len=74012
[10:28:27][D][esp32_camera:159]: Got Image: len=73605
[10:28:29][D][esp32_camera:159]: Got Image: len=73842

I vaguely recall there being something about the LED.

I suspect it uses a lot of current and bad stuff happens [1]

[1] technical term

Hm… that would be weird. The led is not even on when not working. It’s only a matter of and the led code…

It is March 15, 2021, and I just got my new ESP32-cam board with a board that is labeled ESP32-Cam-MB. The second board is just a shield carrying the USB to serial support. No need to press any buttons during upload via serial upload.
So far I used the YAML file at ESPhome.io and it worked just fine by that I mean I can see a slightly delayed video in my Dashboard.
This is my second day searching for how to snap a photo or video manually. Later I can search how to have motion trigger both photo or video. Unfortunately, the search for “how-to” to get a video or picture taken is rare. If you know of a tutorial that is clear and concise for doing so please post. I will continue to search for such a tutorial and if I find one will post it herein.

Try this Record Vidéo from ESP32_Cam (config with EspHome) in hassio works great!

EDIT or Not working to do snapshot or recording using ESP32 CAM

1 Like

Thank you will have a look and see what I find.

Hello, can you tell me how you did that ? thanks.

Wel, technically I didn’t… the camera’s have arrived, but the 7725 are not supported by esphome, so have been looking at the examples straight from esspressif

but I haven’t done much with them. Ik was hoping for recording as well and everybody tells me it won’t work. So I bought a few Raspberry’s to continue, I have one MotionEyeos since a few years, just never integrated it in HA…

KR,
Kurt

Just a quick question - can be the ‘microSD card’ used to record stream?
I looked in earlier posts - but could not find any answer…

Does anyone here have deep sleep working correctly?

I have a test setup here, where a solar panel (5v output) charges a 3.7v battery. The battery then send power to camera using a step up board, that outputs 5v to power the camera. This works fine for a couple of hours when the sun shines. However, at night the camera drains the battery pretty quickly and the camera dies. So, I want to put the camera in deep sleep at night and wake it in the morning.

Does anyone here have experience with something like that?

Can you provide more details on how you did it? Which pins did you connect with each other?

I don’t use the esp32-cam anymore and have lost that config:) But it will be something like this. This is for D1 mini so pins will prob be different.

# ##########################################################################################
# # Light Sensor - Needs i2c and the data/clock pins
# ##########################################################################################
i2c:
  sda: 4
  #D1 Data D2/GPIO4 > Green >  BH1750 SDA
  scl: 5
  #D1 Clock D1/GPIO5 > blue >  BH1750 SCL
  scan: True 
  id: bus_b
sensor:
  - platform: bh1750
    name: "Illuminance Shed Window"
    address: 0x23
    update_interval: 60s
    filters:
      - median:
          window_size: 3
          send_every: 3

I have a M5stack ESP32cam (which I shall have in a totally dark rom snapshotting a meter periodically. This part of my set up work fine without Led on from Node Red).

The status Led on this board is probably enough for the dark room for getting a very close-up image - but I can not seem to get it configured or activated in ESPHome. I have managed to address the Pin (16) in Micropython - but since this perticular board is in a conflict in ESPHome the HA setup of the Led is not done yet.

  1. board listed in - ESP32 Camera Component — ESPHome - as compatible and

  2. is not accepted as board type, generic board type selected!!!

  3. and Pin addressing is not allowed for the M5 ESPCam boards led pin

I have been forced to use the generic board esp-wrover-kit as board reference and tailor the pins according to bullet 1 above. When following the guide under -GPIO Output — ESPHome -with my boards Led pin ESPHome report not able to do so for the generic board.

Puh. If anyone have been able to turn on the staus led for this M5stack ESP32cam in ESPHome could you please guide me - I feel lost…

I have no idea what this means, please provide your code and exactly what is not working.

Will do tomorrow morning :sleeping:

This code adapted from ESPHome ESP32 guide generic board type works. as is

esphome:
name: .,.,.,.,.,
platform: ESP32
board: esp-wrover-kit

wifi:
ssid: «.,.,…,.,»
password: «.,.,.,…,…,»

Enable fallback hotspot (captive portal) in case wifi connection fails

ap:
ssid: «,.,…,.,.,…,
password: «,…,.,.,.,…,.,.,»

captive_portal:

Enable logging

logger:

Enable Home Assistant API

api:
password: «.-.-.-«
ota:
password: «.-.-.-«

standard fra ESPHome.io

esp32_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: 800x600
jpeg_quality: 10

Image settings

name: My Camera

When adding code as described in GPIO Output — ESPHome

Example configuration entry

output:

  • platform: gpio
    pin: D1
    id: gpio_d1

and tailor to this board:

Example configuration entry

output:
platform: gpio
pin: 16
id: gpio_16

I get this when saving the yaml I get this message.

The code looks like this:

It was in an earlier attempt a red x on the lines telling the pin 16 could not be addressed. Can not reproduce that.

this is the board by the way.

Please learn to post your code properly. See How to help us help you - or How to ask a good question

I have tested to setup esp32-cam Ai thinker variant using esphome and it was very slow. Then flashed it with Arduinoes example esp32 camera web server and streaming and that was very fast up to 0.8 sec delay at 1024 resolution.

I wonde why and if it is possible to tune esp32 components settings in esphome to get it faster?