esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
294 stars 38 forks source link

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

Closed Herzblut21 closed 1 year ago

Herzblut21 commented 1 year ago

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: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: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: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][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:021]: Available: NO [13:57:34][C][captive_portal:088]: Captive Portal:

[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.

Herzblut21 commented 1 year ago

It seems that one is only being put off here, it cannot be that there should only be this solution. I've lost the desire to worry about when something isn't working. Apparently the problem is not big enough to change anything. Letting me write here that the programmers don't get paid for their work and therefore a solution may take some time. Why isn't it not tested before release? Or the version is withdrawn with an auto downgrade. I don't want to do this anymore so I closed the thread. If the troubleshooting recommended here is not sufficient, simply open your own thread.

thiesmoeller commented 1 year ago

Hi, @Herzblut21 the good thing about open source is, that we all can help in fixing this issue. Now that 2022.11.5 is found as good, next step could be bisecting all commits up to first failure one to find the problematic commit.

Herzblut21 commented 1 year ago

good luck

Smilebags commented 1 year ago

Hi, I'm new to ESPHome and found this from an error message when trying to get an ESP32 camera working. It has been an impressively simple process so far and it's great to see that the volunteer devs are receptive to bug reports and looking into issues so quickly. It's awesome that the known good version is only 25 days old.

Keep up the great work, the project is a complete godsend.

pksoft585 commented 1 year ago

M5Stack Camera DiY Kit -> same error (ESP Fail) with ESPhome 12.3. Version 11.5 works without problems. I tried to compare sources 11.5 and 12.3 but with no luck. There are only small changes in sources. It looks as a problem with framework?

Version 12.3: _// esp32: // board: esp32cam // framework: // version: 2.0.5 // source: ~3.20005.0 // platformversion: platformio/espressif32 @ 5.2.0 // type: arduino // variant: ESP32

Version 11.5: _// esp32: // board: esp32cam // framework: // version: 1.0.6 // source: ~3.10006.0 // platformversion: platformio/espressif32 @ 3.5.0 // type: arduino // variant: ESP32

There are also chages in GPIO definitions: 12.3: esp32_esp32internalgpiopin = new esp32::ESP32InternalGPIOPin(); 11.5: esp32_arduinointernalgpiopin = new esp32::ArduinoInternalGPIOPin();

I don't know what I need to looking for...

tiimsvk commented 1 year ago

Any solution? tried my new esp32 wrover kit board and no success: https://community.home-assistant.io/t/esphome-esp32-wrover-e-camera-failed/496863

tedenda commented 1 year ago

@jesserockz Have you any input on this problem, any idea on why esp32_camera component is fails for many? I made a diff between 2022.11.5 and 2022.12.3 and looked around to find what changed regarding the camera component, but don't see any thing that I think breaks this.

tiimsvk commented 1 year ago

Today I tried the TTGO-Camera with the display and it works without problems .. the others didn't work for me

MichaKersloot commented 1 year ago

Does the TTGO-Camera have PSRAM? I've also found I needed to disable PSRAM in the Arduino IDE to get the CameraWebServer example working.

stiw47 commented 1 year ago

I can confirm that my camera is working with dev branch of ESPHome. I'm using whole stack of Home Assistant and other related software from docker. I simply changed:

image: esphome/esphome

to:

image: esphome/esphome:dev,

re-downloaded ESPHome container and compiled ESP32 Camera firmware from ESPHome v2023.1.0-dev Nothing changed in .yaml, compared to previous. Below you can find my basic code, so these are good news, cause we should expect that everything is working in the next official release. Didn't played so much, cause I'm on job currently and have no time, but it seems to me that performance are not so special, but hey, it is working and this is something for beginning.

esphome:
  name: camera-hall

esp32:
  board: esp32cam
  framework:
    type: arduino

logger:

api:

ota:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    ssid: "Camera-Hall Fallback Hotspot"
    password: "<some password here>"

captive_portal:

web_server:
  port: 80

esp32_camera:
  name: Camera Hall
  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: 640x480
  jpeg_quality: 10

esp32_camera_web_server:
  - port: 8080
    mode: stream
  - port: 8081
    mode: snapshot
tedenda commented 1 year ago

I installed the ESPHome Dev to and tried, same config as @stiw47 here, here is my result:


[21:10:21][I][app:102]: ESPHome version 2023.1.0-dev compiled on Jan 13 2023, 21:08:12
[21:10:21][C][wifi:504]: WiFi:
[21:10:21][C][wifi:362]:   Local MAC: C8:F0:9E:XX:XX:XX
[21:10:21][C][wifi:363]:   SSID: [redacted]
[21:10:21][C][wifi:364]:   IP Address: 192.168.XX.XX
[21:10:21][C][wifi:366]:   BSSID: [redacted]
[21:10:21][C][wifi:367]:   Hostname: 'esp-cam-test'
[21:10:21][C][wifi:369]:   Signal strength: -75 dB ▂▄▆█
[21:10:21][C][wifi:373]:   Channel: 6
[21:10:21][C][wifi:374]:   Subnet: 255.255.255.0
[21:10:21][C][wifi:375]:   Gateway: 192.168.XX.XX
[21:10:21][C][wifi:376]:   DNS1: 192.168.XX.XX
[21:10:21][C][wifi:377]:   DNS2: X.X.X.X
[21:10:21][C][logger:293]: Logger:
[21:10:21][C][logger:294]:   Level: DEBUG
[21:10:21][C][logger:295]:   Log Baud Rate: 115200
[21:10:21][C][logger:296]:   Hardware UART: UART0
[21:10:21][C][esp32_camera:048]: ESP32 Camera:
[21:10:21][C][esp32_camera:049]:   Name: ESPHome Cam Test
[21:10:21][C][esp32_camera:050]:   Internal: NO
[21:10:21][C][esp32_camera:052]:   Data Pins: D0:5 D1:18 D2:19 D3:21 D4:36 D5:39 D6:34 D7:35
[21:10:21][C][esp32_camera:053]:   VSYNC Pin: 25
[21:10:21][C][esp32_camera:054]:   HREF Pin: 23
[21:10:21][C][esp32_camera:055]:   Pixel Clock Pin: 22
[21:10:21][C][esp32_camera:056]:   External Clock: Pin:0 Frequency:20000000
[21:10:21][C][esp32_camera:060]:   I2C Pins: SDA:26 SCL:27
[21:10:21][C][esp32_camera:062]:   Reset Pin: -1
[21:10:21][C][esp32_camera:080]:   Resolution: 640x480 (VGA)
[21:10:21][E][esp32_camera:099]:   Setup Failed: ESP_FAIL
[21:10:21][C][psram:020]: PSRAM:
[21:10:21][C][psram:021]:   Available: NO
[21:10:21][C][captive_portal:088]: Captive Portal:
[21:10:21][C][web_server:150]: Web Server:
[21:10:21][C][web_server:151]:   Address: esp-cam-test.local:80
[21:10:21][C][mdns:103]: mDNS:
[21:10:21][C][mdns:104]:   Hostname: esp-cam-test
[21:10:21][C][ota:093]: Over-The-Air Updates:
[21:10:21][C][ota:094]:   Address: esp-cam-test.local:3232
[21:10:21][C][api:138]: API Server:
[21:10:21][C][api:139]:   Address: esp-cam-test.local:6053
[21:10:21][C][api:143]:   Using noise encryption: NO
[21:10:21][C][esp32_camera_web_server:088]: ESP32 Camera Web Server:
[21:10:21][C][esp32_camera_web_server:089]:   Port: 8080
[21:10:21][C][esp32_camera_web_server:091]:   Mode: stream
[21:10:21][E][esp32_camera_web_server:097]:   Setup Failed
[21:10:21][C][esp32_camera_web_server:088]: ESP32 Camera Web Server:
[21:10:21][C][esp32_camera_web_server:089]:   Port: 8081
[21:10:21][C][esp32_camera_web_server:093]:   Mode: snapshot
[21:10:21][E][esp32_camera_web_server:097]:   Setup Failed
tiimsvk commented 1 year ago

Fix my problem on wrover kit cam https://community.home-assistant.io/t/esphome-esp32-wrover-e-camera-failed-solved/496863/5?u=tiimsvk

sgottscho commented 1 year ago

Having the same issue. Following

pksoft585 commented 1 year ago

I think two different cases have come together here. The original problem was that the camera worked with the previous version of ESPHOME and not with the new one. And now there is a problem where the camera is not working from the beginning and according to the forum link it is a HW problem. I think they are different things and unfortunately they have merged here, because I don't think it is the same problem in both cases. I guess in the original case it is not a HW problem. That would be the previous version of ESPHOME (at least a year ago) would have had to solve this HW problem with some SW hack. And besides, this problem appears on different cameras. For me personally on the classic kit and on the M5stack DIY Camera Kit and it is a completely different board wiring. So it would be good to separate these problems.

stiw47 commented 1 year ago

Completely agree. If you read the issue from beginning, you can see that some types of ESP32 camera board stopped working with the ESPHome 2022.12.x update, when ESPHome team updated the version of Arduino framework. Then, I saw that my cameras are working with dev branch of ESPHome (2023.something). Waiting for next official release to check, but I expect they will work. I also strongly believe that hardware modification problem isn't related with this issue here, cause I didn't touched anything regarding hardware and I was able to see that my cameras are working with official ESPHome 2022.11.5 and lower, working with dev branch of ESPHome 2023.+, and not working with official ESPHome 2022.12.x

tiimsvk commented 1 year ago

I didn't want to mix topics here, but to write how I solved my problem with the camera and the Wrover kit Cam board.

sgottscho commented 1 year ago

My issue is definitely software. It was working fine until the update to 2022.12.3. I have tried the current dev branch and the issue still persist for me.

jlt24 commented 1 year ago

Yeah, it's a software issue, for me, for sure. After I first had the issue I remembered I had backed up some old bin files. I flashed that old bin (about a year old) file back onto the board and it works just fine.

sgottscho commented 1 year ago

So after doing some testing, I have determined that GPIO16 was causing my error. Yes it was working fine on 2022.11.5, so something changed in software on 2022.12.3 to cause the issue. I was using GPIO16 as an input, once I changed to GPIO14 everything is working properly. GPIO16 in connected to PSRAM as mentioned earlier as possibly being the cause of the problem.

ianustec commented 1 year ago

Hi,

same error here.

I'm not more able to add new esp32cam into my HA istance. But I can update the existing ones.

jlt24 commented 1 year ago

GPIO16 Seems to have been causing my issue as well. I removed the reed switch I had attached to GPIO16,removed the configuration, and the re-flashed it. It's working fine now.

pksoft585 commented 1 year ago

I don't use GPIO 16 in any of my 4 installations...

ianustec commented 1 year ago

I don't use GPIO 16 in any of my 4 installations...

There is no GPIO16 in my configuration

Is also tried switching through esp32cam and esp32dev board and putting and removing arduino_version: latest

esphome:
  name: ${hostname}
  platform: ESP32
  board: esp32cam
  arduino_version: latest

api:
  password: !secret api_password 
  encryption:
    key: !secret api_encryption_key
  reboot_timeout: 0s
ota:
logger:

# ESP32-CAM
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: ${hostname}
  resolution: 800x600

output:
  - platform: gpio
    pin: GPIO4
    id: gpio_4
light:
  - platform: binary
    output: gpio_4
    name: LED ${hostname}
    id: led_${hostname}
pksoft585 commented 1 year ago

Problem persists even new version 2022.12.5. 11.5 is still last working version. :-(

ianustec commented 1 year ago

Thank you

I've quickly compare the two version and for camera module and the issue could be here:

https://github.com/esphome/esphome/compare/2022.11.5...2022.12.5#diff-f205e83b01167d6f78e8280705d21898142c784d9c33670888b95c2c553ac3dc

silentgecko commented 1 year ago

had the same issue yesterday after upgrading to 2023.1 luckily i'm using docker images to flash my devies, so i could easily use the old tag 2022.11.0

niceboygithub commented 1 year ago

The issue was occurred after ardunio platform upgraded to 5.2.0. I have two esp32-cam, One works great at 2022.12.x, another one have the same issue.

ianustec commented 1 year ago

Hi,

I see. Is there a way to downgrade the esphome HA add-on?

MichaKersloot commented 1 year ago

If you have an backup, you can restore only the esphome add-on from that.

MichaKersloot commented 1 year ago

The issue was occurred after ardunio platform upgraded to 5.2.0. I have two esp32-cam, One works great at 2022.12.x, another one have the same issue.

Do you know what the difference could be between those devices?

frustreermeneer commented 1 year ago

Hi,

I see. Is there a way to downgrade the esphome HA add-on?

You can download an old version here: https://github.com/esphome/home-assistant-addon/releases

Upload and unzip that in your add-on folder. Restart and then it should become visible as Local Add-on in the Add-on Store. Enable it there. Make sure to make a backup of your projects first, just to be sure.

nonzod commented 1 year ago

Problem persist even new version v2022.12.7 but seems solved in dev branch

pksoft585 commented 1 year ago

I don't think so, unfortunately. I tried to install the dev version (in HA via plugins) - ESPHome version 2023.1.0-dev. The error remained the same...

JordiGrasvi commented 1 year ago

Unplug camera, wait for 5 seconds and plug. This works for me

pksoft585 commented 1 year ago

I'd like to try that. But the cameras are 60 km away. The interesting thing is that when version 11.5 is loaded into the camera (with bugged esphome version), there is no need to do anything and the camera starts working normally. No unplug/plug.

JordiGrasvi commented 1 year ago

I'm agree with you, but my cameras are 18km away too, when I arrive I listen a small noise in all cameras, I think that is necesary to unplug them.

frassefraze commented 1 year ago

I just tried it, to be honest I didn't believe in it the slightest. Why would a full reboot by pulling the cable fix the code. But I was wrong, after I disconnected mine and reconnected it is working just fine. I even tested to reflash it afterwards and it still works (running ESPHome version 2022.12.8) Not saying its a good solution, but for those who have the possibility it is a workaround.

JordiGrasvi commented 1 year ago

A full reboot does not cut the power, and some electronic components are still blocked. Sometimes the simplest solution is the effective one. Yes running ESPHome version 2022.12.8 a and next uploads works ok

MichaKersloot commented 1 year ago

It's not a solution for me. I was able to connect the CAM to my computer and got the following errors (2022.12.8)

[D][esp-idf:000]: E (452) cam_hal: cam_dma_config(306): frame buffer malloc failed

[D][esp-idf:000]: E (453) cam_hal: cam_config(390): cam_dma_config failed

[D][esp-idf:000]: E (463) camera: Camera config failed with error 0xffffffff

[E][esp32_camera:024]: esp_camera_init failed: ESP_FAIL
MichaKersloot commented 1 year ago

Found in 'dev' commit https://github.com/esphome/esphome/pull/4182/ , so maybe that one can be tagged for release and solve it 'for now'

pksoft585 commented 1 year ago

I tried disconnecting the camera from power after the update. I tried versions 2022.12.8 and 2023.1.0-dev. And still the same errors. There was even another error:

[18:56:30][C][esp32_camera:083]: Resolution: 800x600 (SVGA) [18:56:30][E][esp32_camera:099]: Setup Failed: ESP_FAIL

[18:56:30][C][psram:021]: Available: NO

[18:56:30][C][esp32_camera_web_server:088]: ESP32 Camera Web Server: [18:56:30][C][esp32_camera_web_server:089]: Port: 8081 [18:56:30][C][esp32_camera_web_server:093]: Mode: snapshot [18:56:30][E][esp32_camera_web_server:097]: Setup Failed

In version 11.5, the disconnection does not have to be done at all.

sloncek commented 1 year ago

Hi, I see. Is there a way to downgrade the esphome HA add-on?

You can download an old version here: https://github.com/esphome/home-assistant-addon/releases

Upload and unzip that in your add-on folder. Restart and then it should become visible as Local Add-on in the Add-on Store. Enable it there. Make sure to make a backup of your projects first, just to be sure.

tried, 2 cameras are working as expected, one throws the error 👎 [esp32_camera:099]: Setup Failed: ESP_FAIL and there is no video output. the other two with exactly same code work.

Zelforacle commented 1 year ago

Hi, I see. Is there a way to downgrade the esphome HA add-on?

You can download an old version here: https://github.com/esphome/home-assistant-addon/releases Upload and unzip that in your add-on folder. Restart and then it should become visible as Local Add-on in the Add-on Store. Enable it there. Make sure to make a backup of your projects first, just to be sure.

tried, 2 cameras are working as expected, one throws the error 👎 [esp32_camera:099]: Setup Failed: ESP_FAIL and there is no video output. the other two with exactly same code work.

I gave it a try too with ESPHome 11.5. There was a setup failure error. I guess due to the bad camera connection. After reinserting and restarting, it seems to work again. The connection seems to be bad, disconnecting sometimes. But I guess it's due to connecting without a pigtail antenna.

morenod commented 1 year ago

Tried v2023.2.0b3, it seems to be fixed on it

pksoft585 commented 1 year ago

Tried v2023.2.0b3 and also v2023.2.0-dev. Still ESP_FAIL on both cameras. One is some common ESP32-CAM module and second one is M5stack DIY Camera Kit. But both cameras have no PSRAM. Could the lack of PSRAM be the problem?

HelixX23 commented 1 year ago

Tried v2023.2.0b3 and also v2023.2.0-dev. Still ESP_FAIL on both cameras. One is some common ESP32-CAM module and second one is M5stack DIY Camera Kit. But both cameras have no PSRAM. Could the lack of PSRAM be the problem?

Hi, i have this problem on my ESP32-CAM Dev module this is my log:

[01:45:08][C][esp32_camera:048]: ESP32 Camera: [01:45:08][C][esp32_camera:049]: Name: ESP-CAM 02 [01:45:08][C][esp32_camera:050]: Internal: NO [01:45:08][C][esp32_camera:052]: Data Pins: D0:5 D1:18 D2:19 D3:21 D4:36 D5:39 D6:34 D7:35 [01:45:08][C][esp32_camera:053]: VSYNC Pin: 25 [01:45:08][C][esp32_camera:054]: HREF Pin: 23 [01:45:08][C][esp32_camera:055]: Pixel Clock Pin: 22 [01:45:08][C][esp32_camera:056]: External Clock: Pin:0 Frequency:20000000 [01:45:08][C][esp32_camera:060]: I2C Pins: SDA:26 SCL:27 [01:45:08][C][esp32_camera:062]: Reset Pin: -1 [01:45:08][C][esp32_camera:086]: Resolution: 1024x768 (XGA) [01:45:08][E][esp32_camera:099]: Setup Failed: ESP_ERR_NOT_FOUND

[01:45:08][C][psram:021]: Available: YES [01:45:08][C][psram:024]: Size: 3 MB

its mentioning 3MB PSRAM

maybe it has something to do with OTA firmware uploads

eli-aka-andre commented 1 year ago

I got Setup Failed: ESP_ERR_NOT_FOUND after removing the fallback hotspot it works

hulleyg commented 1 year ago

Installed the latest official version of ESPHome, v2023.2.1 and the camera works now.

pksoft585 commented 1 year ago

Two cameras with PSRAM now work with ESPHome v2023.2.2. Two cameras without PSRAM don't work with ESPHome v2023.2.2 (Setup Failed: ESP_FAIL) but work with ESPHome v2022.11.5. It looks the problem is in no existing PSRAM.

Yoshi325 commented 1 year ago

I was able to fix my non-PSRAM camera (MakerHawk ESP32 Camera Module; looks like a clone of the TTGO T-Journal) by adding a line here: https://github.com/esphome/esphome/blob/dev/esphome/components/esp32_camera/esp32_camera.cpp#L190

I added:

  this->config_.fb_location = CAMERA_FB_IN_DRAM;

after I found the value here: https://github.com/espressif/esp32-camera/blob/56119890f5ca01bade9980d2abfe568e1d5f34a8/driver/include/esp_camera.h#L92

which is used in the driver here: https://github.com/espressif/esp32-camera/blob/master/driver/cam_hal.c#L283

I would gladly submit a pull request, but I believe that the enum value used should be dependent on if the target board has access to PSRAM. And I do not know how to determine that. @jesserockz if you are able to give me some guidance on how to determine if a board has PSRAM, I would love to contribute.