good evening I have a problem with an esp32 cam. the cam is an ov2640 module and the esp32-s but I can’t see anything if it hasn’t commanded the led. Does anyone have this cam module and can you give me an example of code?
Thank
i have tried all the sample templates but none work
You don’t give much any information about which module that could be
So you are aware that there is a lot of different modules
Maybe start reading here
And then try to ask a good question with as much useful information you can deliver
mine was just a question, I know very well that it is not a help desk. I have tried all the examples but none work I can only control the flash I have looked at there are many cam modules and all of the examples are different from mine. now I have ordered other modules when they arrive I do other tests. Thank you
Hi ,
I have the ov2640 Module in Use.
This is my yaml configuration:
esphome:
name: espcam-ov2640
friendly_name: espCam-Test1
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
level: VERBOSE
tx_buffer_size: 256
# Enable Home Assistant API
api:
encryption:
key: "xxx="
services: # change camera parameters on-the-fly
- service: camera_set_param
variables:
name: stringa
value: int
then:
- lambda:
bool state_return = false;
if (("contrast" == name) && (value >= -2) && (value <= 2)) { id(espcam).set_contrast(value); state_return = true; }
if (("brightness" == name) && (value >= -2) && (value <= 2)) { id(espcam).set_brightness(value); state_return = true; }
if (("saturation" == name) && (value >= -2) && (value <= 2)) { id(espcam).set_saturation(value); state_return = true; }
if (("special_effect" == name) && (value >= 0U) && (value <= 6U)) { id(espcam).set_special_effect((esphome::esp32_camera::ESP32SpecialEffect)value); state_return = true; }
if (("aec_mode" == name) && (value >= 0U) && (value <= 1U)) { id(espcam).set_aec_mode((esphome::esp32_camera::ESP32GainControlMode)value); state_return = true; }
if (("aec2" == name) && (value >= 0U) && (value <= 1U)) { id(espcam).set_aec2(value); state_return = true; }
if (("ae_level" == name) && (value >= -2) && (value <= 2)) { id(espcam).set_ae_level(value); state_return = true; }
if (("aec_value" == name) && (value >= 0U) && (value <= 1200U)) { id(espcam).set_aec_value(value); state_return = true; }
if (("agc_mode" == name) && (value >= 0U) && (value <= 1U)) { id(espcam).set_agc_mode((esphome::esp32_camera::ESP32GainControlMode)value); state_return = true; }
if (("agc_value" == name) && (value >= 0U) && (value <= 30U)) { id(espcam).set_agc_value(value); state_return = true; }
if (("agc_gain_ceiling" == name) && (value >= 0U) && (value <= 6U)) { id(espcam).set_agc_gain_ceiling((esphome::esp32_camera::ESP32AgcGainCeiling)value); state_return = true; }
if (("wb_mode" == name) && (value >= 0U) && (value <= 4U)) { id(espcam).set_wb_mode((esphome::esp32_camera::ESP32WhiteBalanceMode)value); state_return = true; }
if (("test_pattern" == name) && (value >= 0U) && (value <= 1U)) { id(espcam).set_test_pattern(value); state_return = true; }
if (true == state_return) {
id(espcam).update_camera_parameters();
}
else {
ESP_LOGW("esp32_camera_set_param", "Error in name or data range");
}
ota:
- platform: esphome
password: "xxx"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Espcam Fallback Hotspot"
password: "FL5VEdqFICLZ"
esp32_camera:
id: espcam
name: esp-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
resolution: 800x600
jpeg_quality: 10 # max. 63
max_framerate: 1.0fps
idle_framerate: 0.2fps
vertical_flip: true
horizontal_mirror: false
brightness: 2 # -2 to 2
contrast: 1 # -2 to 2
special_effect: none
# exposure settings
aec_mode: auto
aec2: false
ae_level: 0
aec_value: 300
# gain settings
agc_mode: auto
agc_gain_ceiling: 2x
agc_value: 0
# white balance setting
wb_mode: auto
output:
# white LED
- platform: ledc
channel: 2
pin: GPIO4
id: espCamLED
# red status light
- platform: gpio
pin:
number: GPIO33
inverted: True
id: gpio_33
light:
- platform: monochromatic
output: espCamLED
name: esp-cam light
- platform: binary
output: gpio_33
name: esp-cam led
switch:
- platform: restart
name: esp-cam restart
binary_sensor:
- platform: status
name: esp-cam status
# http server setting
esp32_camera_web_server:
- port: 8080
mode: stream
- port: 8081
mode: snapshot
captive_portal:
.Hope, this is helpfull for you
We don’t even know which specific board or YAML you are using. Do you expect us to mind-read you?
Help us help you.
You can post the ESPHome logs. Also check that the camera cable is properly inserted into the module.
Hi, thanks for your reply.
I did not expect an answer.
I only wanted to answer to the inital post of Roberto, where a valid configuration for cam modul ov2640 was asked for.
On my side this module works with the esp home yaml file I have posted.