diplix
(felix schwenzel)
April 8, 2023, 7:11pm
5
actually there is a solution described here:
opened 12:40PM - 17 Feb 23 UTC
closed 05:53PM - 27 Nov 23 UTC
### The problem
Hello all,
First of all: I'm not sure if this is a bug or a … feature request, but since the software generates malfunctions because of the default clock setting, I classified it as a bug, I hope that's right.
it's about the esp32_camera class, with the ESP32-CAM-MB board it doesn't work, it has an extremely bad performance. After some research I found a GiHub post where users have found a solution, it is a hardware problem where probably interferences are generated that occur at a clock frequency above 10MHZ. One user added a ground plane with aluminum foil, and another user reduced the clock frequency to 8MHZ in Arduino Studio, eliminating the interference.
This is the post: https://github.com/espressif/arduino-esp32/issues/4655#issuecomment-1374509367
I have been able to reconstruct this using the Esp32CameraWebserver example in the Arduino Studio as well, at 10MHZ and 20MHZ the camera is virtually useless, once you reduce the clock frequency to 8MHZ the board works flawlessly.
The problem is that ESPHome only accepts 10 MHZ and 20 MHZ in the esp32_camera class, at 8 MHZ this error message appears:
esp32_camera: [source /config/esphome/esp-cam.yaml:35]
name: espcam
external_clock:
pin: GPIO0
Unknown value '8000000.0', did you mean '20000000.0', '10000000.0'?.
frequency: 8 MHZ
My suggestion for this is to allow the clock frequency 8 MHZ as a valid value.
I hope I could help with this
### Which version of ESPHome has the issue?
2023.2.1
### What type of installation are you using?
Home Assistant Add-on
### Which version of Home Assistant has the issue?
2023.2.5
### What platform are you using?
ESP32
### Board
esp32cam
### Component causing the issue
esp32_camera
### Example YAML snippet
_No response_
### Anything in the logs that might be useful for us?
```txt
esp32_camera: [source /config/esphome/esp-cam.yaml:35]
name: espcam
external_clock:
pin: GPIO0
Unknown value '8000000.0', did you mean '20000000.0', '10000000.0'?.
frequency: 8 MHZ
```
### Additional information
8 MHZ Clock suggestion
https://github.com/espressif/arduino-esp32/issues/4655#issuecomment-1374509367
Alufoil-hack:
https://www.reddit.com/r/esp32/comments/r9g5jc/fixing_ymmv_the_poor_frame_rate_on_the_esp32cam/
in a nutshell: clock frequencies above 8 MHz create interferences that lead to a range of problems. setting it to 8 MHz solved all my connectivity problems i had with my esp32 cams.
there needed to be some esphome code changes to be made (already merged), since only clock speeds between 10 and 20 were allowed. i don’t know if the patch is included in the latest esphome release, i patched it manually, and like i said, my esp32 cams work quite reliably now with a camera clock speed of 8 MHz.