diff --git a/cat-feeder-cam.yaml b/cat-feeder-cam.yaml new file mode 100644 index 0000000..60e7c65 --- /dev/null +++ b/cat-feeder-cam.yaml @@ -0,0 +1,45 @@ +# To bootstrap and then use OTA to flash firmware. + +esp32: + board: esp32doit-devkit-v1 + +esphome: + name: cat-feeder-cam + friendly_name: "Cat feeder cam" + area: Kitchen + +packages: + device_base: !include templates/esp32-cam.yaml + +psram: + +i2c: +- id: camera_i2c + sda: GPIO26 + scl: GPIO27 + +esp32_camera: # Ai-Thinker + external_clock: + pin: GPIO0 + frequency: 20MHz + i2c_id: camera_i2c + 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: Camera + resolution: 800x600 # Max 1600x1200. + idle_framerate: 0.1fps + +output: +- platform: ledc + pin: GPIO4 + channel: 2 # PWM channel 1 is used for esp32_camera. + id: led + +light: +- platform: monochromatic + output: led + name: Flash diff --git a/empty/empty32-cam.yaml b/empty/empty32-cam.yaml index fa6d121..c30dae9 100644 --- a/empty/empty32-cam.yaml +++ b/empty/empty32-cam.yaml @@ -11,6 +11,8 @@ packages: wifi: !include ../templates/wifi.yaml ota: !include ../templates/ota.yaml +psram: + esp32_camera: external_clock: pin: GPIO0 diff --git a/reflash.sh b/reflash.sh index 6be1973..2f255be 100755 --- a/reflash.sh +++ b/reflash.sh @@ -45,6 +45,7 @@ for config in \ attic-central.yaml \ office-rack.yaml \ radiation.yaml \ + cat-feeder-cam.yaml \ tools-power.yaml; do flash+=("${command?} ${config?}") done diff --git a/templates/esp32-cam.yaml b/templates/esp32-cam.yaml new file mode 100644 index 0000000..6ff3e9b --- /dev/null +++ b/templates/esp32-cam.yaml @@ -0,0 +1,20 @@ +esp32: + board: esp32doit-devkit-v1 + framework: + type: esp-idf + +packages: + # Can not use esp32.yaml, GPIO2 (status LED) is used by SD Card. + wifi: !include wifi.yaml + ota: !include ota.yaml + mqtt: !include mqtt.yaml + uptime: !include uptime.yaml + restart: !include restart.yaml + syslog: !include syslog.yaml + api: !include api.yaml + +mqtt: + # API should be sufficient + enable_on_boot: false + +logger: