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] 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 38: Zeile 39:
   - Drücken Sie erneut den RST-Button, um das Board neu zu starten   - Drücken Sie erneut den RST-Button, um das Board neu zu starten
  
-===== Code =====+===== Integration in Home Assistant mit ESPHome =====
  
-<code yaml esp32-cam-01.yaml>+[[digitales:hardware:esp:erlaeuterungen_zum_code_esp32_cam]] 
 + 
 + 
 +==== Basis-Konfiguration ==== 
 + 
 +<code yaml>
 substitutions: substitutions:
   devicename: esp-cam   devicename: esp-cam
Zeile 54: Zeile 60:
     type: arduino     type: arduino
  
-Enable logging+Aktiviere Logging
 logger: logger:
   level: WARN   level: WARN
  
 +# Externe Pakete einbinden
 packages: packages:
   wifi: !include packages/wifi.yaml   wifi: !include packages/wifi.yaml
   mqtt: !include packages/mqtt.yaml   mqtt: !include packages/mqtt.yaml
   ota:  !include packages/ota.yaml   ota:  !include packages/ota.yaml
 +</code>
  
-# Enable Home Assistant API +==== Kamera-Konfiguration ====
-# 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+
  
 +<code yaml>
 esp32_camera: esp32_camera:
   name: $upper_devicename   name: $upper_devicename
Zeile 131: Zeile 91:
   max_framerate: 10fps   max_framerate: 10fps
  
-  # Image settings+  # Bildeinstellungen
   contrast: 0   contrast: 0
   special_effect: none   special_effect: none
-  # exposure settings+  # Belichtungseinstellungen
   aec_mode: auto   aec_mode: auto
   aec2: false   aec2: false
   ae_level: 0   ae_level: 0
   aec_value: 300   aec_value: 300
-  # gain settings+  # Verstärkungseinstellungen
   agc_mode: auto   agc_mode: auto
   agc_gain_ceiling: 2x   agc_gain_ceiling: 2x
   agc_value: 0   agc_value: 0
-  # white balance setting+  # Weißabgleich-Einstellung
   wb_mode: auto   wb_mode: auto
-  # orientation+  # Ausrichtung
   vertical_flip: False   vertical_flip: False
   horizontal_mirror: False   horizontal_mirror: False
 +</code>
 +
  
-  on_stream_start: +==== Webserver und LED-Steuerung ====
-    light.turn_on: cam_streaming +
-  on_stream_stop: +
-    light.turn_off: cam_streaming+
  
-camera webserver+<code yaml> 
 +Kamera-Webserver
 esp32_camera_web_server: esp32_camera_web_server:
   - port: 80   - port: 80
Zeile 169: Zeile 129:
  
 light: light:
-  # For the white LED.+  # Für die weiße LED
   - platform: monochromatic   - platform: monochromatic
     output: gpio_4     output: gpio_4
     name: $upper_devicename Flash LED     name: $upper_devicename Flash LED
-  # For the red status LED.+  # Für die rote Status-LED
   - platform: status_led   - platform: status_led
     name: $upper_devicename Status LED     name: $upper_devicename Status LED
Zeile 180: Zeile 140:
       number: GPIO33       number: GPIO33
       inverted: true       inverted: true
 +</code>
  
-switch: +==== WLAN-Konfiguration (Beispiel) ====
-  platform: restart +
-    name: $upper_devicename Restart+
  
-binary_sensor+<code yaml> 
-  - platformstatus +wifi
-    name$upper_devicename Status+  # Feste IP-Adresse (passen Sie diese an Ihr Netzwerk an) 
 +  manual_ip
 +    static_ip: 192.168.178.40 
 +    gateway: 192.168.178.1 
 +    subnet: 255.255.255.0 
 +  # Alternative: Dynamische IP 
 +  # ssid: "IHR_WLAN_NAME" 
 +  # password"IHR_WLAN_PASSWORT"
 </code> </code>
 +
 +
 +===== Kamera-Zugriff =====
 +
 +Nach erfolgreicher Einrichtung können Sie auf die Kamera zugreifen:
 +
 +  * Livestream: ''[[http://[KAMERA-IP]:80/]]''
 +  * Einzelbild: ''[[http://[KAMERA-IP]:81/]]''
 +  * In MotionEye einbinden: ''[[http://[KAMERA-IP]:81/]]''
 +
 +===== Troubleshooting =====
 +
 +==== Bekannte Probleme ====
 +
 +  - **Niedrige Bildrate (FPS)**
 +    * Mögliche Ursache: Interferenzen zwischen IO0 und der WLAN-Antenne
 +    * Lösung: Abschirmung des IO0-Pins mit antistatischer Folie oder durch Berührung
 +    * Alternativ: Positionierung des Boards entfernt von Störquellen
 +  - **Verbindungsprobleme**
 +    * Überprüfen Sie die Stromversorgung (mindestens 5V/1A empfohlen)
 +    * Stellen Sie sicher, dass sich das Board in Reichweite des WLAN-Routers befindet
 +    * Versuchen Sie eine Firmware-Aktualisierung
 +
 +{{:digitales:esp32cam_antistatische-folie.jpg?direct&400|Abschirmung des IO0-Pins mit antistatischer Folie}}
 +===== Nützliche Links =====
 +
 +  * [[https://ai-thinker.com/product/esp32-cam/|ESP32-CAM AI-Thinker Datenblatt]]
 +  * [[https://esphome.io/components/esp32_camera.html|ESPHome Dokumentation für ESP32-Camera]]
 +  * [[https://github.com/espressif/esp32-camera|GitHub Repository mit Beispielcode]]
 +  * [[https://randomnerdtutorials.com/esp32-cam-camera-pin-gpios/|Pinout-Diagramm und technische Details]]