Metainformationen zur Seite
  •  

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
digitales:hardware:esp:esp32-cam [05.04.2025] – [Basis-Konfiguration] csdigitales:hardware:esp:esp32-cam [25.05.2025] (aktuell) – [ESP32-CAM Dokumentation] cs
Zeile 3: Zeile 3:
 ====== ESP32-CAM Dokumentation ====== ====== ESP32-CAM Dokumentation ======
  
-{{..:..:esp32cam.jpg?400&direct|esp32cam.jpg}}+{{..:esp32cam.jpg?400&direct|esp32cam.jpg}} 
 + 
 +{{..:esp32cam_programming.png?632x353&direct}}
  
-{{..:..:esp32cam_programming.png?632x353&direct}} 
  
 ===== Übersicht ===== ===== Übersicht =====
Zeile 39: Zeile 40:
  
 ===== Integration in Home Assistant mit ESPHome ===== ===== Integration in Home Assistant mit ESPHome =====
 +
 +[[digitales:hardware:esp:erlaeuterungen_zum_code_esp32_cam]]
 +
  
 ==== Basis-Konfiguration ==== ==== Basis-Konfiguration ====
Zeile 106: Zeile 110:
 </code> </code>
  
-==== Kamera-Konfiguration ==== 
- 
-<code yaml> 
-esp32_camera: 
-  name: $upper_devicename 
-  id: my_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 
-  idle_framerate: 0.1fps 
-  max_framerate: 10fps 
- 
-  # Bildeinstellungen 
-  contrast: 0 
-  special_effect: none 
-  # Belichtungseinstellungen 
-  aec_mode: auto 
-  aec2: false 
-  ae_level: 0 
-  aec_value: 300 
-  # Verstärkungseinstellungen 
-  agc_mode: auto 
-  agc_gain_ceiling: 2x 
-  agc_value: 0 
-  # Weißabgleich-Einstellung 
-  wb_mode: auto 
-  # Ausrichtung 
-  vertical_flip: False 
-  horizontal_mirror: False 
-</code> 
  
 ==== Webserver und LED-Steuerung ==== ==== Webserver und LED-Steuerung ====
Zeile 190: Zeile 156:
 </code> </code>
  
-===== Code ===== 
- 
-<code yaml esp32-cam-01.yaml> 
-substitutions: 
-  devicename: esp-cam 
-  upper_devicename: ESP32-Cam 
- 
-esphome: 
-  name: $devicename 
-  friendly_name: $upper_devicename 
- 
-esp32: 
-  board: esp32dev 
-  framework: 
-    type: arduino 
- 
-# Enable logging 
-logger: 
-  level: WARN 
- 
-packages: 
-  wifi: !include packages/wifi.yaml 
-  mqtt: !include packages/mqtt.yaml 
-  ota:  !include packages/ota.yaml 
- 
-# Enable Home Assistant API 
-# Für ESP32 Camera Component siehe: https://esphome.io/components/esp32_camera.html 
-# Für lambda siehe: https://github.com/esphome/esphome/pull/3090 
-api: 
-  services: 
-    # change camera parameters on-the-fly 
-    - service: camera_set_param 
-      variables: 
-        name: string 
-        value: int 
-      then: 
-        - lambda: |- 
-            bool state_return = false; 
-            if (("contrast" == name) && (value>= -2) && (value <= 2)) { id(my_camera).set_contrast(value); state_return = true; } 
-            if (("brightness" == name) && (value>= -2) && (value <= 2)) { id(my_camera).set_brightness(value); state_return = true; } 
-            if (("saturation" == name) && (value>= -2) && (value <= 2)) { id(my_camera).set_saturation(value); state_return = true; } 
-            if (("special_effect" == name) && (value>= 0U) && (value <= 6U)) { id(my_camera).set_special_effect((esphome::esp32_camera::ESP32SpecialEffect)value); state_return = true; } 
-            if (("aec_mode" == name) && (value>= 0U) && (value <= 1U)) { id(my_camera).set_aec_mode((esphome::esp32_camera::ESP32GainControlMode)value); state_return = true; } 
-            if (("aec2" == name) && (value>= 0U) && (value <= 1U)) { id(my_camera).set_aec2(value); state_return = true; } 
-            if (("ae_level" == name) && (value>= -2) && (value <= 2)) { id(my_camera).set_ae_level(value); state_return = true; } 
-            if (("aec_value" == name) && (value>= 0U) && (value <= 1200U)) { id(my_camera).set_aec_value(value); state_return = true; } 
-            if (("agc_mode" == name) && (value>= 0U) && (value <= 1U)) { id(my_camera).set_agc_mode((esphome::esp32_camera::ESP32GainControlMode)value); state_return = true; } 
-            if (("agc_value" == name) && (value>= 0U) && (value <= 30U)) { id(my_camera).set_agc_value(value); state_return = true; } 
-            if (("agc_gain_ceiling" == name) && (value>= 0U) && (value <= 6U)) { id(my_camera).set_agc_gain_ceiling((esphome::esp32_camera::ESP32AgcGainCeiling)value); state_return = true; } 
-            if (("wb_mode" == name) && (value>= 0U) && (value <= 4U)) { id(my_camera).set_wb_mode((esphome::esp32_camera::ESP32WhiteBalanceMode)value); state_return = true; } 
-            if (("test_pattern" == name) && (value>= 0U) && (value <= 1U)) { id(my_camera).set_test_pattern(value); state_return = true; } 
-            if (("vertical_flip" == name) && (value>= 0U) && (value <= 1U)) { id(my_camera).set_vertical_flip(value); state_return = true; } 
-            if (("horizontal_mirror" == name) && (value>= 0U) && (value <= 1U)) { id(my_camera).set_horizontal_mirror(value); state_return = true; } 
-            if (("jpeg_quality" == name) && (value>= 10U) && (value <= 63U)) { id(my_camera).set_jpeg_quality(value); state_return = true; } 
- 
-            if (true == state_return) { 
-              id(my_camera).update_camera_parameters(); 
-            } 
-            else { 
-              ESP_LOGW("esp32_camera_set_param", "Error in name or data range"); 
-            } 
-wifi: 
-  manual_ip: 
-    # Set this to the IP of the ESP 
-    static_ip: 192.168.178.40 
-    # Set this to the IP address of the router. Often ends with .1 
-    gateway: 192.168.178.1 
-    # The subnet of the network. 255.255.255.0 works for most home networks. 
-    subnet: 255.255.255.0 
- 
-captive_portal: 
- 
-time: 
-  - platform: homeassistant 
-    id: esptime 
- 
-esp32_camera: 
-  name: $upper_devicename 
-  id: my_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 
-  idle_framerate: 0.1fps 
-  max_framerate: 10fps 
- 
-  # Image settings 
-  contrast: 0 
-  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 
-  # orientation 
-  vertical_flip: False 
-  horizontal_mirror: False 
- 
-  on_stream_start: 
-    light.turn_on: cam_streaming 
-  on_stream_stop: 
-    light.turn_off: cam_streaming 
- 
-# camera webserver 
-esp32_camera_web_server: 
-  - port: 80 
-    mode: stream 
-  - port: 81 
-    mode: snapshot 
- 
-output: 
-  - platform: ledc 
-    pin: GPIO4 
-    id: gpio_4 
-    channel: 2 
-    frequency: 500Hz 
- 
-light: 
-  # For the white LED. 
-  - platform: monochromatic 
-    output: gpio_4 
-    name: $upper_devicename Flash LED 
-  # For the red status LED. 
-  - platform: status_led 
-    name: $upper_devicename Status LED 
-    id: cam_streaming 
-    pin: 
-      number: GPIO33 
-      inverted: true 
- 
-switch: 
-  - platform: restart 
-    name: $upper_devicename Restart 
- 
-binary_sensor: 
-  - platform: status 
-    name: $upper_devicename Status 
-</code> 
  
 ===== Kamera-Zugriff ===== ===== Kamera-Zugriff =====
Zeile 363: Zeile 178:
     * Versuchen Sie eine Firmware-Aktualisierung     * Versuchen Sie eine Firmware-Aktualisierung
  
 +{{:digitales:esp32cam_antistatische-folie.jpg?direct&400|Abschirmung des IO0-Pins mit antistatischer Folie}}
 ===== Nützliche Links ===== ===== Nützliche Links =====