Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[E][esp32_camera:099]: Setup Failed: ESP_FAIL #3908

Closed
Herzblut21 opened this issue Dec 14, 2022 · 158 comments
Closed

[E][esp32_camera:099]: Setup Failed: ESP_FAIL #3908

Herzblut21 opened this issue Dec 14, 2022 · 158 comments

Comments

@Herzblut21
Copy link

The problem

Nach dem Update auf Current version: 2022.12.0, bekomme ich im Log der ESP32-Cam folgenden Fehler (Log):

INFO Starting log output from esp_cam_yt.local using esphome API
INFO Successfully connected to esp_cam_yt.local
[13:57:34][I][app:102]: ESPHome version 2022.12.0 compiled on Dec 14 2022, 12:30:16
[13:57:34][C][wifi:504]: WiFi:
[13:57:34][C][wifi:362]: Local MAC: EC:62:60:76:BB:94
[13:57:34][C][wifi:363]: SSID: [redacted]
[13:57:34][C][wifi:364]: IP Address: 192.168.1.67
[13:57:34][C][wifi:366]: BSSID: [redacted]
[13:57:34][C][wifi:367]: Hostname: 'esp_cam_yt'
[13:57:34][C][wifi:369]: Signal strength: -29 dB ▂▄▆█
[13:57:34][C][wifi:373]: Channel: 13
[13:57:34][C][wifi:374]: Subnet: 255.255.255.0
[13:57:34][C][wifi:375]: Gateway: 192.168.1.2
[13:57:34][C][wifi:376]: DNS1: 192.168.1.2
[13:57:34][C][wifi:377]: DNS2: 0.0.0.0
[13:57:34][C][logger:293]: Logger:
[13:57:34][C][logger:294]: Level: DEBUG
[13:57:34][C][logger:295]: Log Baud Rate: 115200
[13:57:34][C][logger:296]: Hardware UART: UART0
[13:57:34][C][gpio.output:010]: GPIO Binary Output:
[13:57:34][C][gpio.output:011]: Pin: GPIO4
[13:57:34][C][light:104]: Light 'ESP32Cam light'
[13:57:34][C][esp32_camera:048]: ESP32 Camera:
[13:57:34][C][esp32_camera:049]: Name: esp32_cam
[13:57:34][C][esp32_camera:050]: Internal: NO
[13:57:34][C][esp32_camera:052]: Data Pins: D0:5 D1:18 D2:19 D3:21 D4:36 D5:39 D6:34 D7:35
[13:57:34][C][esp32_camera:053]: VSYNC Pin: 25
[13:57:34][C][esp32_camera:054]: HREF Pin: 23
[13:57:34][C][esp32_camera:055]: Pixel Clock Pin: 22
[13:57:34][C][esp32_camera:056]: External Clock: Pin:0 Frequency:10000000
[13:57:34][C][esp32_camera:060]: I2C Pins: SDA:26 SCL:27
[13:57:34][C][esp32_camera:062]: Reset Pin: -1
[13:57:34][C][esp32_camera:080]: Resolution: 640x480 (VGA)
[13:57:34][E][esp32_camera:099]: Setup Failed: ESP_FAIL
[13:57:34][C][status:034]: Status Binary Sensor 'ESP32Cam status'
[13:57:34][C][status:034]: Device Class: 'connectivity'
[13:57:34][C][psram:020]: PSRAM:
[13:57:34][C][psram:021]: Available: NO
[13:57:34][C][captive_portal:088]: Captive Portal:
[13:57:34][C][mdns:103]: mDNS:
[13:57:34][C][mdns:104]: Hostname: esp_cam_yt
[13:57:34][C][ota:093]: Over-The-Air Updates:
[13:57:34][C][ota:094]: Address: esp_cam_yt.local:3232
[13:57:34][C][ota:097]: Using Password.
[13:57:34][C][api:138]: API Server:
[13:57:34][C][api:139]: Address: esp_cam_yt.local:6053
[13:57:34][C][api:143]: Using noise encryption: NO
[13:57:34][C][wifi_signal.sensor:009]: WiFi Signal 'ESP32Cam WiFi Signal'
[13:57:34][C][wifi_signal.sensor:009]: Device Class: 'signal_strength'
[13:57:34][C][wifi_signal.sensor:009]: State Class: 'measurement'
[13:57:34][C][wifi_signal.sensor:009]: Unit of Measurement: 'dBm'
[13:57:34][C][wifi_signal.sensor:009]: Accuracy Decimals: 0

Which version of ESPHome has the issue?

2022.12.0

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

Home Assistant 2022.12.5 Supervisor 2022.11.2 Operating System 9.4 Frontend 20221213.0 - latest

What platform are you using?

ESP32

Board

ESP-32 Cam mit MB / ESP32-CAM-MB WIFI Bluetooth-Entwicklungsboard OV2640 Kameramodul CH340G

Component causing the issue

No response

Example YAML snippet

esphome:
  name: esp_cam
  platform: ESP32
  board: esp32dev

wifi:
  ssid: "3OG-EXT"
  password: "**************"

# Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "3OG"
    password: "*************"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "***************"

ota:
  password: "***************"

esp32_camera:
  name: esp32_cam
  external_clock:
    pin: GPIO0
    frequency: 10MHz
  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

output:
  - platform: gpio
    pin: GPIO4
    id: gpio_4

binary_sensor:
  - platform: status
    name: "ESP32Cam status"
    
sensor:
  - platform: wifi_signal
    name: "ESP32Cam WiFi Signal"
    update_interval: 30s
    
light:
  - platform: binary
    output: gpio_4
    name: "ESP32Cam light"

Anything in the logs that might be useful for us?

INFO Reading configuration /config/esphome/test.yaml...
WARNING 'esp_cam_yt': Using the '_' (underscore) character in the hostname is discouraged as it can cause problems with some DHCP and local name services. For more information, see https://esphome.io/guides/faq.html#why-shouldn-t-i-use-underscores-in-my-device-name
WARNING GPIO0 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
WARNING GPIO4 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Starting log output from esp_cam_yt.local using esphome API
INFO Successfully connected to esp_cam_yt.local
[14:00:51][I][app:102]: ESPHome version 2022.12.0 compiled on Dec 14 2022, 12:30:16
[14:00:51][C][wifi:504]: WiFi:
[14:00:51][C][wifi:362]:   Local MAC: EC:62:60:76:BB:94
[14:00:51][C][wifi:363]:   SSID: [redacted]
[14:00:51][C][wifi:364]:   IP Address: 192.168.1.67
[14:00:51][C][wifi:366]:   BSSID: [redacted]
[14:00:51][C][wifi:367]:   Hostname: 'esp_cam_yt'
[14:00:51][C][wifi:369]:   Signal strength: -31 dB ▂▄▆█
[14:00:51][C][wifi:373]:   Channel: 13
[14:00:51][C][wifi:374]:   Subnet: 255.255.255.0
[14:00:51][C][wifi:375]:   Gateway: 192.168.1.2
[14:00:51][C][wifi:376]:   DNS1: 192.168.1.2
[14:00:51][C][wifi:377]:   DNS2: 0.0.0.0
[14:00:51][C][logger:293]: Logger:
[14:00:51][C][logger:294]:   Level: DEBUG
[14:00:51][C][logger:295]:   Log Baud Rate: 115200
[14:00:51][C][logger:296]:   Hardware UART: UART0
[14:00:51][C][gpio.output:010]: GPIO Binary Output:
[14:00:51][C][gpio.output:011]:   Pin: GPIO4
[14:00:51][C][light:104]: Light 'ESP32Cam light'
[14:00:51][C][esp32_camera:048]: ESP32 Camera:
[14:00:51][C][esp32_camera:049]:   Name: esp32_cam
[14:00:51][C][esp32_camera:050]:   Internal: NO
[14:00:51][C][esp32_camera:052]:   Data Pins: D0:5 D1:18 D2:19 D3:21 D4:36 D5:39 D6:34 D7:35
[14:00:51][C][esp32_camera:053]:   VSYNC Pin: 25
[14:00:51][C][esp32_camera:054]:   HREF Pin: 23
[14:00:51][C][esp32_camera:055]:   Pixel Clock Pin: 22
[14:00:51][C][esp32_camera:056]:   External Clock: Pin:0 Frequency:10000000
[14:00:51][C][esp32_camera:060]:   I2C Pins: SDA:26 SCL:27
[14:00:51][C][esp32_camera:062]:   Reset Pin: -1
[14:00:51][C][esp32_camera:080]:   Resolution: 640x480 (VGA)
[14:00:51][E][esp32_camera:099]:   Setup Failed: ESP_FAIL
[14:00:52][C][status:034]: Status Binary Sensor 'ESP32Cam status'
[14:00:52][C][status:034]:   Device Class: 'connectivity'
[14:00:52][C][psram:020]: PSRAM:
[14:00:52][C][psram:021]:   Available: NO
[14:00:52][C][captive_portal:088]: Captive Portal:
[14:00:52][C][mdns:103]: mDNS:
[14:00:52][C][mdns:104]:   Hostname: esp_cam_yt
[14:00:52][C][ota:093]: Over-The-Air Updates:
[14:00:52][C][ota:094]:   Address: esp_cam_yt.local:3232
[14:00:52][C][ota:097]:   Using Password.
[14:00:52][C][api:138]: API Server:
[14:00:52][C][api:139]:   Address: esp_cam_yt.local:6053
[14:00:52][C][api:143]:   Using noise encryption: NO
[14:00:52][C][wifi_signal.sensor:009]: WiFi Signal 'ESP32Cam WiFi Signal'
[14:00:52][C][wifi_signal.sensor:009]:   Device Class: 'signal_strength'
[14:00:52][C][wifi_signal.sensor:009]:   State Class: 'measurement'
[14:00:52][C][wifi_signal.sensor:009]:   Unit of Measurement: 'dBm'
[14:00:52][C][wifi_signal.sensor:009]:   Accuracy Decimals: 0

Additional information

Vor dem Update auf 2022.12.0 hat noch alles funktioniert. War vor dem Update noch auf dem Kamera-Bild, alles OK. Der Fehler taucht nur nach dem Update auf 2022.12.0 bei der ESP32-Cam auf, meine 16 Stück ESP8266 funktionieren ohne Probleme.

@theggz
Copy link

theggz commented Dec 15, 2022

Same problem here since updating ESPHome to version 2022.12.0. Any idea how to solve this ?

@Herzblut21
Copy link
Author

I unfortunately not yet.

@migsun
Copy link

migsun commented Dec 15, 2022

same here, after update the cam/webserver can't start.

[E][esp32_camera:099]: Setup Failed: ESP_ERR_NOT_FOUND
[E][esp32_camera_web_server:097]: Setup Failed

@Herzblut21
Copy link
Author

even after the update to version 2022.12.1 the error is still there.

@frustreermeneer
Copy link

frustreermeneer commented Dec 16, 2022

Same problem here.

esphome:
  name: esp32cam
  comment: Living Room - Aquarium Camera

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
  
# Enable Home Assistant API
api:

ota:
  password: "xxxxxxxxxx"

wifi:
  networks:
  - ssid: !secret wifi_ssid_1
    password: !secret wifi_password_1
  - ssid: !secret wifi_ssid_2
    password: !secret wifi_password_2
  domain: ".local"
  ap:
    ssid: "ESP32Cam Fallback Hotspot"

  manual_ip:
    static_ip: 192.168.0.97
    gateway: 192.168.0.1
    subnet: 255.255.255.0
    
mqtt:
  broker: 192.168.0.2
  
captive_portal:

# Example configuration entry
esp32_camera:
  name: ESP32CAM1
  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
  resolution: 640x480
  jpeg_quality: 20
  brightness: 2

i2c:
  sda: GPIO14
  scl: GPIO13

font:
  - file: "fonts/ubuntu.ttf"
    id: ubuntu
    size: 12
    
text_sensor:
  - platform: mqtt_subscribe
    name: "Display text line 1"
    id: displaytext1
    topic: esp32cam/displaytext1
    
  - platform: mqtt_subscribe
    name: "Display text line 2"
    id: displaytext2
    topic: esp32cam/displaytext2
    
display:
  - platform: ssd1306_i2c
    model: "SSD1306 128x32"
    address: 0x3C
    lambda: |-
      it.printf(0,  0, id(ubuntu), "%s", id(displaytext1).state.c_str());
      it.printf(0, 16, id(ubuntu), "%s", id(displaytext2).state.c_str());    
      
[10:24:47][C][esp32_camera:048]: ESP32 Camera:
[10:24:47][C][esp32_camera:049]:   Name: ESP32CAM1
[10:24:47][C][esp32_camera:050]:   Internal: NO
[10:24:47][C][esp32_camera:052]:   Data Pins: D0:17 D1:35 D2:34 D3:5 D4:39 D5:18 D6:36 D7:19
[10:24:47][C][esp32_camera:053]:   VSYNC Pin: 22
[10:24:47][C][esp32_camera:054]:   HREF Pin: 26
[10:24:47][C][esp32_camera:055]:   Pixel Clock Pin: 21
[10:24:47][C][esp32_camera:056]:   External Clock: Pin:27 Frequency:20000000
[10:24:47][C][esp32_camera:060]:   I2C Pins: SDA:25 SCL:23
[10:24:47][C][esp32_camera:062]:   Reset Pin: -1
[10:24:48][C][esp32_camera:080]:   Resolution: 640x480 (VGA)
[10:24:48][E][esp32_camera:099]:   Setup Failed: ESP_FAIL

@Herzblut21
Copy link
Author

Herzblut21 commented Dec 16, 2022

I don't understand why something keeps popping up, you can't test it before publication. Today's update (version 2022.12.1) didn't help either, still the same error. Could it be that someone from Microsoft is working there, it's always the case with them that after an update it works less than before the update. :-)

@migsun
Copy link

migsun commented Dec 16, 2022

Update installed, same behavior.

@theggz
Copy link

theggz commented Dec 17, 2022

Is there a way to specify the version to use the one before the update that caused the error ?
I have two camera and both are now unusable since I made the update...

@Herzblut21
Copy link
Author

Unfortunately I don't know, because there was probably a firmware update.

@errorkallu
Copy link

same issue for me on 2022.12.3

@diginfo
Copy link

diginfo commented Dec 17, 2022

Same here, on 2022.12.1, I restored back to 2022.12.0 and same problem with that, I dont have any older backups

@diginfo
Copy link

diginfo commented Dec 18, 2022

Is there a way to specify the version to use the one before the update that caused the error ? I have two camera and both are now unusable since I made the update...

Depends how long your backups go back, you can do a partial restore on the backup that was done by the esphome update, unfortunately mine are 7 days rolling only and I dont have older versions.

Not aure if it would be possible to restore a partial backup from someone else's backup who may have an older working version

@davidmikulik
Copy link

davidmikulik commented Dec 19, 2022

The same issue here:
esphome:
name: xxx

esp32:
board: esp32dev
framework:
type: arduino

Enable logging

logger:

Enable Home Assistant API

api:
encryption:
key: "cccc"

ota:
password: "c"

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password

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

ap:
ssid: "xxxFallback Hotspot"
password: "xxxx"

captive_portal:

#bluetooth_proxy:

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

Image settings

name: camkladno

resolution: 640x480
jpeg_quality: 10

[13:30:31][C][wifi:504]: WiFi:
[13:30:31][C][wifi:362]: Local MAC: FC:F5:C4:01:6E:F4
[13:30:31][C][wifi:363]: SSID: [redacted]
[13:30:31][C][wifi:364]: IP Address: 10.0.0.248
[13:30:31][C][wifi:366]: BSSID: [redacted]
[13:30:31][C][wifi:367]: Hostname: 'xxxx'
[13:30:31][C][wifi:369]: Signal strength: -76 dB ▂▄▆█
[13:30:31][C][wifi:373]: Channel: 11
[13:30:31][C][wifi:374]: Subnet: 255.255.255.0
[13:30:31][C][wifi:375]: Gateway: 10.0.0.1
[13:30:31][C][wifi:376]: DNS1: 10.0.0.1
[13:30:31][C][wifi:377]: DNS2: 0.0.0.0
[13:30:31][C][logger:293]: Logger:
[13:30:31][C][logger:294]: Level: DEBUG
[13:30:31][C][logger:295]: Log Baud Rate: 115200
[13:30:31][C][logger:296]: Hardware UART: UART0
[13:30:31][C][esp32_camera:048]: ESP32 Camera:
[13:30:31][C][esp32_camera:049]: Name: xxx
[13:30:31][C][esp32_camera:050]: Internal: NO
[13:30:31][C][esp32_camera:052]: Data Pins: D0:17 D1:35 D2:34 D3:5 D4:39 D5:18 D6:36 D7:19
[13:30:31][C][esp32_camera:053]: VSYNC Pin: 22
[13:30:31][C][esp32_camera:054]: HREF Pin: 26
[13:30:31][C][esp32_camera:055]: Pixel Clock Pin: 21
[13:30:31][C][esp32_camera:056]: External Clock: Pin:27 Frequency:20000000
[13:30:31][C][esp32_camera:060]: I2C Pins: SDA:25 SCL:23
[13:30:31][C][esp32_camera:062]: Reset Pin: -1
[13:30:31][C][esp32_camera:080]: Resolution: 640x480 (VGA)
[13:30:31][E][esp32_camera:099]: Setup Failed: ESP_FAIL
[13:30:31][C][psram:020]: PSRAM:
[13:30:31][C][psram:021]: Available: NO
[13:30:31][C][captive_portal:088]: Captive Portal:
[13:30:31][C][mdns:103]: mDNS:
[13:30:31][C][mdns:104]: Hostname: xxxx
[13:30:31][C][ota:093]: Over-The-Air Updates:
[13:30:31][C][ota:094]: Address: xxxx.local:3232
[13:30:31][C][ota:097]: Using Password.
[13:30:31][C][api:138]: API Server:
[13:30:31][C][api:139]: Address: xxxx.local:6053
[13:30:31][C][api:141]: Using noise encryption: YES
[13:30:32][W][api.connection:081]: Home Assistant 2022.12.7 (::FFFF:10.0.0.192): Connection reset

@diginfo
Copy link

diginfo commented Dec 20, 2022

Is there a way to specify the version to use the one before the update that caused the error ? I have two camera and both are now unusable since I made the update...

Depends how long your backups go back, you can do a partial restore on the backup that was done by the esphome update, unfortunately mine are 7 days rolling only and I dont have older versions.

Not aure if it would be possible to restore a partial backup from someone else's backup who may have an older working version

Fortunately I installed a stand-alone esphome on proxmox back in October, I updated to the 2022.11.5 version and the camera is working again.

@hulleyg
Copy link

hulleyg commented Dec 20, 2022

I have the same issue on Home Assistant 2022.12.7 and ESPHome 2022.12.2. I don't have a backup from Home Assistant 2022.11.5

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

INFO Starting log output from camera-1.local using esphome API
INFO Successfully connected to camera-1.local
[18:48:15][I][app:102]: ESPHome version 2022.12.2 compiled on Dec 20 2022, 18:39:31
[18:48:15][C][wifi:504]: WiFi:
[18:48:15][C][wifi:362]: Local MAC: 40:22:D8:F0:C5:B4
[18:48:15][C][wifi:363]: SSID: [redacted]
[18:48:15][C][wifi:364]: IP Address:
[18:48:15][C][wifi:366]: BSSID: [redacted]
[18:48:15][C][wifi:367]: Hostname: 'camera-1'
[18:48:15][C][wifi:369]: Signal strength: -65 dB ▂▄▆█
[18:48:15][C][wifi:373]: Channel: 8
[18:48:15][C][wifi:374]: Subnet: 255.255.255.0
[18:48:15][C][wifi:375]: Gateway:
[18:48:15][C][wifi:376]: DNS1:
[18:48:15][C][wifi:377]: DNS2: 0.0.0.0
[18:48:15][C][logger:293]: Logger:
[18:48:15][C][logger:294]: Level: DEBUG
[18:48:15][C][logger:295]: Log Baud Rate: 115200
[18:48:15][C][logger:296]: Hardware UART: UART0
[18:48:15][C][esp32_camera:048]: ESP32 Camera:
[18:48:15][C][esp32_camera:049]: Name: Camera 1
[18:48:15][C][esp32_camera:050]: Internal: NO
[18:48:15][C][esp32_camera:052]: Data Pins: D0:5 D1:18 D2:19 D3:21 D4:36 D5:39 D6:34 D7:35
[18:48:15][C][esp32_camera:053]: VSYNC Pin: 25
[18:48:15][C][esp32_camera:054]: HREF Pin: 23
[18:48:15][C][esp32_camera:055]: Pixel Clock Pin: 22
[18:48:15][C][esp32_camera:056]: External Clock: Pin:0 Frequency:20000000
[18:48:15][C][esp32_camera:060]: I2C Pins: SDA:26 SCL:27
[18:48:15][C][esp32_camera:062]: Reset Pin: -1
[18:48:15][C][esp32_camera:080]: Resolution: 640x480 (VGA)
[18:48:15][E][esp32_camera:099]: Setup Failed: ESP_FAIL
[18:48:15][C][psram:020]: PSRAM:
[18:48:15][C][psram:021]: Available: NO
[18:48:15][C][captive_portal:088]: Captive Portal:
[18:48:15][C][mdns:103]: mDNS:
[18:48:15][C][mdns:104]: Hostname: camera-1
[18:48:15][C][ota:093]: Over-The-Air Updates:
[18:48:15][C][ota:094]: Address: camera-1.local:3232
[18:48:15][C][ota:097]: Using Password.
[18:48:15][C][api:138]: API Server:
[18:48:15][C][api:139]: Address: camera-1.local:6053
[18:48:15][C][api:141]: Using noise encryption: YES

@Herzblut21
Copy link
Author

Even after the update to 2022.12.2 no improvement.

@migsun
Copy link

migsun commented Dec 20, 2022

I replaced my both ESP32Cams. The new devices work as designed. The old ones seems to been killed by the update. I will try to make a clean reset/erase and try it again.

@diginfo
Copy link

diginfo commented Dec 20, 2022

2022.12.3 just released, same problem and this issue is not resolved.

I also tried clean build and that did not resolve it either.

@diginfo
Copy link

diginfo commented Dec 21, 2022

Hmmm, I wonder why there have been no comments from the dev team regarding this ?

@jlt24
Copy link

jlt24 commented Dec 21, 2022

Same issue here. I have two ESP32Cam boards in my garage and both are giving the following error.
[E][esp32_camera_web_server:097]: Setup Failed

@benceBalazs
Copy link

Same here, it would be helpful to not just get an "esp_fail" error but more details on why or what happened ...

@migsun
Copy link

migsun commented Dec 23, 2022

I was able to revive my two modules. Reflashing by wire (MB board) and ESPHome Flasher was successfully. Now both devices can also updates via OTA again.

@benceBalazs
Copy link

I'm going to try your method and post my results in a few hours

@jlt24
Copy link

jlt24 commented Dec 23, 2022

I was able to revive my two modules. Reflashing by wire (MB board) and ESPHome Flasher was successfully. Now both devices can also updates via OTA again.

Did you downgrade ESPHOME or just reflash with the same version?

@davidmikulik
Copy link

I was able to revive my two modules. Reflashing by wire (MB board) and ESPHome Flasher was successfully. Now both devices can also updates via OTA again.

I've tried it and no success - the same result as before :( ([15:47:01][E][esp32_camera:099]: Setup Failed: ESP_FAIL), please could you share your config with us?

@Herzblut21
Copy link
Author

I would also be interested in how you did it, I also braided all the boards again but without success.

@migsun
Copy link

migsun commented Dec 23, 2022

I did not change anything of my original configuration. OTA fails, image to file and flashing by wire works.

@davidmikulik
Copy link

I did not change anything of my original configuration. OTA fails, image to file and flashing by wire works.

It was probably different issue - this decribed issue was - OTA works, but the cam start failures in setup phase: Setup Failed: ESP_FAIL.

@jlt24
Copy link

jlt24 commented Dec 23, 2022

I did not change anything of my original configuration. OTA fails, image to file and flashing by wire works.

It was probably different issue - this decribed issue was - OTA works, but the cam start failures in setup phase: Setup Failed: ESP_FAIL.

Agree, I have no issue at all with OTA

@migsun
Copy link

migsun commented Dec 23, 2022

For me OTA works too, but then the cam sever fails. Only a wired update let start the cam as designed.

@ianustec
Copy link

ianustec commented Mar 5, 2023

HI,

I'm a little frustrated...

I have 4 esp32-cams, all the same.
2 work and 2 don't
I've noticed that the ones that work have

PSRAM:
[09:34:40][C][psram:021]: Available: YES

This is the log with ESPHOME-Flaher for the ones that don't work

Using '/dev/cu.usbserial-1410' as serial port.
Connecting...[09:34:12]ets Jul 29 2019 12:21:46
[09:34:12]
[09:34:12]rst:0x1 (POWERON_RESET),boot:0x2 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_FEO_V2))
[09:34:12]waiting for download
.Serial port closed!

Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
Connecting....

Chip Info:
 - Chip Family: ESP32
 - Chip Model: ESP32-D0WD-V3 (revision 3)
 - Number of Cores: 2
 - Max CPU Frequency: 240MHz
 - Has Bluetooth: YES
 - Has Embedded Flash: NO
 - Has Factory-Calibrated ADC: YES
 - MAC Address: *****
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
 - Flash Size: 4MB
 - Flash Mode: dio
 - Flash Frequency: 40MHz
Erasing flash (this may take a while)...
Chip erase completed successfully in 2.5s
Flash will be erased from 0x00001000 to 0x00004fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x0010afff...
Compressed 15872 bytes to 10319...
Writing at 0x00001000... (100 %)Wrote 15872 bytes (10319 compressed) at 0x00001000 in 0.4 seconds (effective 339.2 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 144...
Writing at 0x00008000... (100 %)Wrote 3072 bytes (144 compressed) at 0x00008000 in 0.0 seconds (effective 860.9 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 1328.3 kbit/s)...
Hash of data verified.
Compressed 1026912 bytes to 672633...
Writing at 0x0010a655... (100 %)Wrote 1026912 bytes (672633 compressed) at 0x00010000 in 16.9 seconds (effective 485.9 kbit/s)...
Hash of data verified.

Leaving...
Hard Resetting...
Hard resetting via RTS pin...
Done! Flashing is complete!

Showing logs:
[09:34:36]E (287) psram: PSRAM ID read error: 0xffffffff
[09:34:36][I][logger:258]: Log initialized
[09:34:36][C][ota:469]: There have been 0 suspected unsuccessful boot attempts.
[09:34:36][D][esp32.preferences:113]: Saving 1 preferences to flash...
[09:34:36][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[09:34:36][I][app:029]: Running through setup()...
[09:34:36][C][light:036]: Setting up light 'LED cam3'...
[09:34:36][D][light:035]: 'LED cam3' Setting:
[09:34:36][D][light:040]:   Color mode: 
[09:34:37][D][esp-idf:000]: E (451) cam_hal: cam_dma_config(306): frame buffer malloc failed
[09:34:37]
[09:34:37][D][esp-idf:000]: E (451) cam_hal: cam_config(390): cam_dma_config failed
[09:34:37]
[09:34:37][D][esp-idf:000]: E (461) camera: Camera config failed with error 0xffffffff
[09:34:37]
[09:34:37][E][esp32_camera:024]: esp_camera_init failed: ESP_FAIL
[09:34:37][E][component:113]: Component esp32_camera was marked as failed.
[09:34:37][C][wifi:037]: Setting up WiFi...
[09:34:37][C][wifi:038]:   Local MAC: ******
[09:34:37][I][wifi:257]: WiFi Connecting to '*****'...
[09:34:37][D][esp32.preferences:113]: Saving 1 preferences to flash...
[09:34:37][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[09:34:40][I][wifi:518]: WiFi Connected!
[09:34:40][C][wifi:362]:   Local MAC: ****
[09:34:40][C][wifi:363]:   SSID: '*****'
[09:34:40][C][wifi:364]:   IP Address: 192.168.1.140
[09:34:40][C][wifi:366]:   BSSID: 20:B0:01:9D:D1:F7
[09:34:40][C][wifi:367]:   Hostname: 'cam3'
[09:34:40][C][wifi:369]:   Signal strength: -61 dB ▂▄▆█
[09:34:40][C][wifi:373]:   Channel: 11
[09:34:40][C][wifi:374]:   Subnet: 255.255.255.0
[09:34:40][C][wifi:375]:   Gateway: 192.168.1.1
[09:34:40][C][wifi:376]:   DNS1: 192.168.1.1
[09:34:40][C][wifi:377]:   DNS2: 0.0.0.0
[09:34:40][D][wifi:527]: Disabling AP...
[09:34:40][C][ota:093]: Over-The-Air Updates:
[09:34:40][C][ota:094]:   Address: cam3.local:3232
[09:34:40][C][api:025]: Setting up Home Assistant API server...
[09:34:40][I][app:062]: setup() finished successfully!
[09:34:40][I][app:102]: ESPHome version 2023.2.4 compiled on Mar  5 2023, 09:30:57
[09:34:40][C][wifi:504]: WiFi:
[09:34:40][C][wifi:362]:   Local MAC: ****
[09:34:40][C][wifi:363]:   SSID: '****'
[09:34:40][C][wifi:364]:   IP Address: 192.168.1.140
[09:34:40][C][wifi:366]:   BSSID: *****
[09:34:40][C][wifi:367]:   Hostname: 'cam3'
[09:34:40][C][wifi:369]:   Signal strength: -59 dB ▂▄▆█
[09:34:40][C][wifi:373]:   Channel: 11
[09:34:40][C][wifi:374]:   Subnet: 255.255.255.0
[09:34:40][C][wifi:375]:   Gateway: 192.168.1.1
[09:34:40][C][wifi:376]:   DNS1: 192.168.1.1
[09:34:40][C][wifi:377]:   DNS2: 0.0.0.0
[09:34:40][C][logger:293]: Logger:
[09:34:40][C][logger:294]:   Level: DEBUG
[09:34:40][C][logger:295]:   Log Baud Rate: 115200
[09:34:40][C][logger:296]:   Hardware UART: UART0
[09:34:40][C][gpio.output:010]: GPIO Binary Output:
[09:34:40][C][gpio.output:011]:   Pin: GPIO4
[09:34:40][C][template.sensor:023]: Template Sensor 'Luminosità rilevata cam3'
[09:34:40][C][template.sensor:023]:   Device Class: 'illuminance'
[09:34:40][C][template.sensor:023]:   State Class: 'measurement'
[09:34:40][C][template.sensor:023]:   Unit of Measurement: 'lx'
[09:34:40][C][template.sensor:023]:   Accuracy Decimals: 1
[09:34:40][C][template.sensor:024]:   Update Interval: 60.0s
[09:34:40][C][light:104]: Light 'LED cam3'
[09:34:40][C][esp32_camera:048]: ESP32 Camera:
[09:34:40][C][esp32_camera:049]:   Name: cam3
[09:34:40][C][esp32_camera:050]:   Internal: NO
[09:34:40][C][esp32_camera:052]:   Data Pins: D0:5 D1:18 D2:19 D3:21 D4:36 D5:39 D6:34 D7:35
[09:34:40][C][esp32_camera:053]:   VSYNC Pin: 25
[09:34:40][C][esp32_camera:054]:   HREF Pin: 23
[09:34:40][C][esp32_camera:055]:   Pixel Clock Pin: 22
[09:34:40][C][esp32_camera:056]:   External Clock: Pin:0 Frequency:20000000
[09:34:40][C][esp32_camera:060]:   I2C Pins: SDA:26 SCL:27
[09:34:40][C][esp32_camera:062]:   Reset Pin: -1
[09:34:40][C][esp32_camera:086]:   Resolution: 1024x768 (XGA)
[09:34:40][E][esp32_camera:099]:   Setup Failed: ESP_FAIL
[09:34:40][C][restart:076]: Restart Switch 'Restart cam3'
[09:34:40][C][restart:078]:   Icon: 'mdi:restart'
[09:34:40][C][restart:099]:   Restore Mode: restore defaults to OFF
[09:34:40][C][psram:020]: PSRAM:
[09:34:40][C][psram:021]:   Available: NO
[09:34:40][C][captive_portal:088]: Captive Portal:
[09:34:41][C][mdns:108]: mDNS:
[09:34:41][C][mdns:109]:   Hostname: cam3
[09:34:41][C][ota:093]: Over-The-Air Updates:
[09:34:41][C][ota:094]:   Address: cam3.local:3232
[09:34:41][C][api:138]: API Server:
[09:34:41][C][api:139]:   Address: cam3.local:6053
[09:34:41][C][api:141]:   Using noise encryption: YES

@benkwyan
Copy link

benkwyan commented Mar 12, 2023

If you want to try if the

this->config_.fb_location = CAMERA_FB_IN_DRAM;

fixes the problem for you (as it DOES for me!) you could add the following snippet to your .yaml configuration.

external_components:
  - source:
      type: git
      url: https://github.com/MichaKersloot/esphome_custom_components
    components: [ esp32_camera ]

this solves the problem. Thanks!!

@ianustec
Copy link

ianustec commented Mar 15, 2023

If you want to try if the
this->config_.fb_location = CAMERA_FB_IN_DRAM;
fixes the problem for you (as it DOES for me!) you could add the following snippet to your .yaml configuration.

external_components:
  - source:
      type: git
      url: https://github.com/MichaKersloot/esphome_custom_components
    components: [ esp32_camera ]

this solves the problem. Thanks!!

Unfortunately it doesn't work for me.
I received psram: PSRAM ID read error: 0xffffffff with PSRAM Available NO

@pksoft585
Copy link

I have also remarked this line:
#AUTO_LOAD = ["psram"]
in __init__.py file. You can find it in my external component above. Maybe it can help.

@ianustec
Copy link

I have also remarked this line:
#AUTO_LOAD = ["psram"]
in __init__.py file. You can find it in my external component above. Maybe it can help.

Hi, thank you.

I've tried with and without comment but unfortunately it doesn't work.

@homonto
Copy link

homonto commented Mar 22, 2023

it does not work for me either - my 5 cameras are gone now - why did I upgrade? eh...

@tedenda

This comment was marked as spam.

@byxil
Copy link

byxil commented Mar 25, 2023

hi, I have two cams TTGO T-Journal ESP32 Camera that don't work after the home assistant update three months ago.
I've tried applying the (external_components) solutions I've seen posted here, but to no avail.
Does anyone know what I could try? or can I wait because there will be an update that will solve this problem?

This is the error:
INFO Reading configuration /config/esphome/esterno.yaml...
INFO Starting log output from esterno.local using esphome API
INFO Successfully connected to esterno.local
[16:40:36][I][app:102]: ESPHome version 2023.3.1 compiled on Mar 22 2023, 07:54:07
[16:40:36][C][wifi:504]: WiFi:
[16:40:36][C][wifi:362]: Local MAC: 44:17:93:89:91:D0
[16:40:36][C][wifi:363]: SSID: [redacted]
[16:40:36][C][wifi:364]: IP Address: 192.168.1.104
[16:40:36][C][wifi:366]: BSSID: [redacted]
[16:40:36][C][wifi:367]: Hostname: 'esterno'
[16:40:36][C][wifi:369]: Signal strength: -77 dB ▂▄▆█
[16:40:36][C][wifi:373]: Channel: 11
[16:40:36][C][wifi:374]: Subnet: 255.255.255.0
[16:40:36][C][wifi:375]: Gateway: 192.168.1.1
[16:40:36][C][wifi:376]: DNS1: 192.168.1.1
[16:40:36][C][wifi:377]: DNS2: 0.0.0.0
[16:40:36][C][logger:293]: Logger:
[16:40:36][C][logger:294]: Level: DEBUG
[16:40:36][C][logger:295]: Log Baud Rate: 115200
[16:40:36][C][logger:296]: Hardware UART: UART0
[16:40:36][C][esp32_camera:048]: ESP32 Camera:
[16:40:36][C][esp32_camera:049]: Name: esterno
[16:40:36][C][esp32_camera:050]: Internal: NO
[16:40:36][C][esp32_camera:052]: Data Pins: D0:17 D1:35 D2:34 D3:5 D4:39 D5:18 D6:36 D7:19
[16:40:36][C][esp32_camera:053]: VSYNC Pin: 22
[16:40:36][C][esp32_camera:054]: HREF Pin: 26
[16:40:36][C][esp32_camera:055]: Pixel Clock Pin: 21
[16:40:36][C][esp32_camera:056]: External Clock: Pin:27 Frequency:20000000
[16:40:36][C][esp32_camera:060]: I2C Pins: SDA:25 SCL:23
[16:40:36][C][esp32_camera:062]: Reset Pin: -1
[16:40:36][C][esp32_camera:083]: Resolution: 800x600 (SVGA)
[16:40:36][E][esp32_camera:099]: Setup Failed: ESP_FAIL
[16:40:36][C][psram:020]: PSRAM:
[16:40:36][C][psram:021]: Available: NO
[16:40:36][C][captive_portal:088]: Captive Portal:
[16:40:36][C][mdns:108]: mDNS:
[16:40:36][C][mdns:109]: Hostname: esterno
[16:40:36][C][ota:093]: Over-The-Air Updates:
[16:40:36][C][ota:094]: Address: esterno.local:3232
[16:40:36][C][api:138]: API Server:
[16:40:36][C][api:139]: Address: esterno.local:6053
[16:40:36][C][api:143]: Using noise encryption: NO
[16:40:36][C][esp32_camera_web_server:088]: ESP32 Camera Web Server:
[16:40:36][C][esp32_camera_web_server:089]: Port: 8080
[16:40:36][C][esp32_camera_web_server:091]: Mode: stream
[16:40:36][E][esp32_camera_web_server:097]: Setup Failed
[16:40:36][C][esp32_camera_web_server:088]: ESP32 Camera Web Server:
[16:40:36][C][esp32_camera_web_server:089]: Port: 8081
[16:40:36][C][esp32_camera_web_server:093]: Mode: snapshot
[16:40:36][E][esp32_camera_web_server:097]: Setup Failed

@MichaKersloot
Copy link

I'm also using a TTGO T-Journal ESP32. It looks like the external_component didn't work for you? I did alter my T-Journal a little follwing: https://sf.own-it.nl/projects/engelseruiter/wiki/Esphome . My working configuration looks like:

substitutions:
  device_name: "cam01"

esphome:
  name: '${device_name}'

esp32:
 board: esp32dev
 framework:
   type: arduino

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxxxxxxxx"

ota:
  password: "xxxxxxxxxxxxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "cam01 Fallback Hotspot"
    password: "xxxxxxx"

captive_portal:

external_components:
  - source:
      type: git
      url: https://github.com/MichaKersloot/esphome_custom_components
    components: [ ip5306, esp32_camera ]

i2c:
  - id: bus_a
    sda: 14
    scl: 13
    frequency: 400kHz
    scan: true    

ip5306:
  battery_level:   # sensor
    name: '${device_name} - Battery Level'
  charger_connected:  # binary_sensor
    id: connected
    on_press:
      then:
        - lambda: ESP_LOGD("TEST", "charging");
    on_release:
      then:
        - lambda: ESP_LOGD("TEST", "not charging");
  charge_full:  # binary_sensor
    id: full
    on_press:
      then:
        - lambda: ESP_LOGD("TEST", "fully charged");
    on_release:
      then:
        - lambda: ESP_LOGD("TEST", "still charging");

esp32_camera:
  name: '${device_name} - 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
  agc_gain_ceiling: 8x
  # jpeg_quality: 16
  # max_framerate: 25Hz
  contrast: 0
  brightness: 1
  saturation: 0
  ae_level: 2
  # aec2: True
  horizontal_mirror: false
  vertical_flip: false
  resolution: 800x600

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

@byxil
Copy link

byxil commented Mar 27, 2023

Thanks Micha for your invaluable advice, by copying your code I managed to get both my cameras working.

@bjkiting
Copy link

bjkiting commented Apr 9, 2023

I got mine working by removing any additional resolution and framerate specifications and adding in the following:

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

@MichaKersloot
Copy link

As the default still doesn't work "for me" I've updated my repository to be compatible with 2023.4.4

@Rubquila
Copy link

I'm still with the same issue :(

@8none1
Copy link

8none1 commented Jul 20, 2023

Setting the framework to arduino:

esp32:
  board: esp32dev
  framework:
    type: arduino

was enough to resolve this error for me on 2023.7.0

@upamanyudas
Copy link

This issue still persists in ESPHome 2023.7.0. I'm using an AiThinker camera.

@lerra
Copy link

lerra commented Jul 26, 2023

Don't work for me either with esphome 2023.7.0 (it worked fine with an older version from 2022), worked with the custom component from https://github.com/MichaKersloot/esphome_custom_components and the hw is a m5stack camera, mostl likely a pirate version, this is what I got from the logs regarding PSRAM,

[x][C][psram:020]: PSRAM:
[x][C][psram:021]:   Available: NO

@frustreermeneer
Copy link

Got the same error again with 2023.7.1.
It worked before with the repository of @MichaKersloot .

Turned out a power cycle made it work again.

@fs34a
Copy link

fs34a commented Aug 12, 2023

Got the same error again with 2023.8.13, but never mind, power cycle resolved the problem.
Plus, even with web server still works fine.

esp32_camera_web_server:

  • port: 8080
    mode: stream
  • port: 8081
    mode: snapshot

@ilkersevli
Copy link

ilkersevli commented Sep 18, 2023

I was having the same problem, it was due to the wrong pins, use the codes below.

source: https://esphome.io/components/esp32_camera.html

Configuration for Ai-Thinker Camera

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

@lethuer
Copy link

lethuer commented Nov 1, 2023

issue still persists in ESPHome 2023.10.5 but behavior is annoying...

if example code is just copied and this is the only thing inside the yaml code then camera is working.
if anything else comes in problems begin and I observe several things which can happen:

  • error like in initial post
    image
  • esp error on boot, status led blinks quickly which inicates ESPHome has found an error while setting up. then the log can't connect after flashing
    image
  • no error message but camera stream preview not available, even if there is a working connection in the log
    image

@weisserd
Copy link

weisserd commented Jan 9, 2024

For me it works with ESPHome 2023.12 by pinning the arduino framework version to 2.0.8 and using the external repo from @MichaKersloot

esp32:
  board: esp32dev
  framework:
    type: arduino
    version: 2.0.8

...

external_components:
  - source:
      type: git
      url: https://github.com/MichaKersloot/esphome_custom_components
    components: [ esp32_camera ]


esp32_camera:
  name: esp32_cam
  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
  resolution: 800x600

@MichaKersloot
Copy link

hi @weisserd was pinning the android version really necessary? I personally have no problems to compile and use the defaults as set in esphome 2023.12.5 with my repository.

@weisserd
Copy link

weisserd commented Jan 12, 2024

Yes, it is necessary.

I also tried to pin the version to arduino 2.0.9

esp32:
  board: esp32dev # esp32cam
  framework:
    type: arduino
    version: 2.0.9 # 2.0.8 works

But with 2.0.9 im running into compile problems. However I didn't dig deeper once it worked for me.

INFO ESPHome 2023.12.5
INFO Reading configuration /config/esphome/bird-cam.yaml...
WARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
WARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
WARNING GPIO0 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
WARNING GPIO5 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Generating C++ source...
INFO Compiling app...
Processing bird-cam (board: esp32dev; framework: arduino; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Dependency Graph
|-- WiFi @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- Update @ 2.0.0
|-- noise-c @ 0.1.4
Compiling .pioenvs/bird-cam/src/esphome/components/api/api_connection.cpp.o
Compiling .pioenvs/bird-cam/src/esphome/components/api/api_frame_helper.cpp.o
Compiling .pioenvs/bird-cam/src/esphome/components/api/api_pb2.cpp.o
Compiling .pioenvs/bird-cam/src/esphome/components/api/api_pb2_service.cpp.o
In file included from src/esphome/components/api/proto.h:4,
                 from src/esphome/components/api/api_pb2.h:5,
                 from src/esphome/components/api/api_pb2.cpp:3:
src/esphome/core/log.h:14:10: fatal error: esp_err.h: No such file or directory

*****************************************************************
* Looking for esp_err.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:esp_err.h"
* Web  > https://registry.platformio.org/search?q=header:esp_err.h
*
*****************************************************************

 #include <esp_err.h>
          ^~~~~~~~~~~
In file included from src/esphome/components/api/proto.h:4,
                 from src/esphome/components/api/api_pb2.h:5,
                 from src/esphome/components/api/api_pb2_service.h:5,
                 from src/esphome/components/api/api_pb2_service.cpp:3:
src/esphome/core/log.h:14:10: fatal error: esp_err.h: No such file or directory

*****************************************************************
* Looking for esp_err.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:esp_err.h"
* Web  > https://registry.platformio.org/search?q=header:esp_err.h
*
*****************************************************************

 #include <esp_err.h>
          ^~~~~~~~~~~
compilation terminated.
compilation terminated.
In file included from src/esphome/components/socket/socket.h:6,
                 from src/esphome/components/api/api_frame_helper.h:14,
                 from src/esphome/components/api/api_frame_helper.cpp:1:
src/esphome/components/socket/headers.h:156:10: fatal error: sys/ioctl.h: No such file or directory
 #include <sys/ioctl.h>
          ^~~~~~~~~~~~~
compilation terminated.
In file included from src/esphome/components/socket/socket.h:6,
                 from src/esphome/components/api/api_frame_helper.h:14,
                 from src/esphome/components/api/api_connection.h:3,
                 from src/esphome/components/api/api_connection.cpp:1:
src/esphome/components/socket/headers.h:156:10: fatal error: sys/ioctl.h: No such file or directory
 #include <sys/ioctl.h>
          ^~~~~~~~~~~~~
compilation terminated.
*** [.pioenvs/bird-cam/src/esphome/components/api/api_connection.cpp.o] Error 1
*** [.pioenvs/bird-cam/src/esphome/components/api/api_frame_helper.cpp.o] Error 1
*** [.pioenvs/bird-cam/src/esphome/components/api/api_pb2_service.cpp.o] Error 1
*** [.pioenvs/bird-cam/src/esphome/components/api/api_pb2.cpp.o] Error 1
========================== [FAILED] Took 6.25 seconds ==========================

@MichaKersloot
Copy link

Hi,

I don't use any pinning, just updated esphome today and it seems 2.0.5 is used. A quick scan on my sources shows no reference to esp_err.h directly. For now I'm not able to help you.

@MaxWinterstein
Copy link

MaxWinterstein commented Jan 12, 2024

Working for me with the latest HA OS, HA Version and ESPHome Add-on:

  name: esphome-web-e3d944
  friendly_name: OctoCam

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxx"

ota:


wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-E3D944"
    password: "xxx"

captive_portal:
    

external_components:
  - source:
      type: git
      url: https://github.com/MichaKersloot/esphome_custom_components
    components: [ esp32_camera ]


esp32_camera:
  name: esp32_cam
  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
  resolution: 800x600
  # name: OctoCam

output:
  - platform: gpio
    pin: GPIO4
    id: gpio_4
light:
  - platform: binary
    output: gpio_4
    name: OctoCam light

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

Using a cheap aliexpress module

@mortenx
Copy link

mortenx commented Jan 25, 2024

Working for me with the latest HA OS, HA Version and ESPHome Add-on:

  name: esphome-web-e3d944
  friendly_name: OctoCam

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxx"

ota:


wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-E3D944"
    password: "xxx"

captive_portal:
    

external_components:
  - source:
      type: git
      url: https://github.com/MichaKersloot/esphome_custom_components
    components: [ esp32_camera ]


esp32_camera:
  name: esp32_cam
  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
  resolution: 800x600
  # name: OctoCam

output:
  - platform: gpio
    pin: GPIO4
    id: gpio_4
light:
  - platform: binary
    output: gpio_4
    name: OctoCam light

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

Using a cheap aliexpress module

this is working solution

@somik321
Copy link

somik321 commented Mar 19, 2024

Not working in esphome 2024.2.2 and home assistant 2024.3.1 in docker desktop

substitutions:
  devicename: test-esp32-cam2
  upper_devicename: test-ESP2_CAM2

esphome:
  name: $devicename
  friendly_name: $upper_devicename
#  compile_process_limit: 1

esp32:
  board: esp32dev
  framework:
    type: arduino
    version: 2.0.8

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  manual_ip:
    static_ip: 192.168.0.105
    gateway: 192.168.0.1
    subnet: 255.255.255.0
  
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "TestESP-CAM Fallback Hotspot"
    password: "xxx"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: !secret api_key

ota:
  password: "xxx"

external_components:
  - source:
      type: git
      url: https://github.com/MichaKersloot/esphome_custom_components
    components: [ esp32_camera ]


esp32_camera:
  name: esp32_cam
  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
  resolution: 800x600
  # name: OctoCam

output:
  - platform: gpio
    pin: GPIO4
    id: gpio_4
light:
  - platform: binary
    output: gpio_4
    name: OctoCam light

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

log:

[20:43:22][C][esp32_camera:048]: ESP32 Camera:
[20:43:22][C][esp32_camera:049]:   Name: esp32_cam
[20:43:22][C][esp32_camera:050]:   Internal: NO
[20:43:22][C][esp32_camera:052]:   Data Pins: D0:5 D1:18 D2:19 D3:21 D4:36 D5:39 D6:34 D7:35
[20:43:22][C][esp32_camera:053]:   VSYNC Pin: 25
[20:43:22][C][esp32_camera:054]:   HREF Pin: 23
[20:43:22][C][esp32_camera:055]:   Pixel Clock Pin: 22
[20:43:22][C][esp32_camera:056]:   External Clock: Pin:0 Frequency:20000000
[20:43:22][C][esp32_camera:060]:   I2C Pins: SDA:26 SCL:27
[20:43:22][C][esp32_camera:062]:   Reset Pin: -1
[20:43:22][C][esp32_camera:083]:   Resolution: 800x600 (SVGA)
[20:43:22][E][esp32_camera:123]:   Setup Failed: ESP_ERR_NOT_FOUND
[20:43:22][C][psram:020]: PSRAM:
[20:43:22][C][psram:021]:   Available: YES
[20:43:22][C][psram:024]:   Size: 4095 KB
...
[20:43:22][C][esp32_camera_web_server:088]: ESP32 Camera Web Server:
[20:43:22][C][esp32_camera_web_server:089]:   Port: 8080
[20:43:22][C][esp32_camera_web_server:091]:   Mode: stream
[20:43:22][E][esp32_camera_web_server:097]:   Setup Failed
[20:43:22][C][esp32_camera_web_server:088]: ESP32 Camera Web Server:
[20:43:22][C][esp32_camera_web_server:089]:   Port: 8081
[20:43:22][C][esp32_camera_web_server:093]:   Mode: snapshot
[20:43:22][E][esp32_camera_web_server:097]:   Setup Failed

@MichaKersloot
Copy link

@somik321 My version is made specific for boards without PSRAM. I suggest to go back to the default component. You also don't tell the board you are using.

@Warm-rain
Copy link

Warm-rain commented Apr 8, 2024

@somik321我的版本是专门针对没有 PSRAM 的主板而设计的。我回到建议默认组件。您也不会告诉您正在使用的主板。

我在esp32-cam上使用了确实没有报错,可是摄像头出来的画面是这样的是为什么
8121fbd76e3bdb847579b91d7d5aad8.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.