ESP32 Cam - working!

hi,
i got a m5stack camera working but can’t add it to motion eye. did anyone besides MrUkleja get a esp32cam working in the motioneye add-on? what do you have to enter in the config-window when adding a camera?
thanks!

That device on aliexpress does not look exactly like the one shown in your photos.

If it is an ai thinker, the config for them can be copied from the esphome page.

it’s not written on it, but on the aliexpress page, a reviewer says to use the AI THINKER code. Actually is the only code not producing an error, so I thought is/was the correct code … nevertheless is not working.

p.s. to me it seems the same model from the picture, but who knows

Different text on the camera side, but that may be a false alert.

Note the order of the items in data_pins: is important, and yours do not match ai-thinker.

Oh, didn’t think the ORDER was important, trying now
data_pins: [GPIO35, GPIO34, GPIO39, GPIO36, GPIO21, GPIO19, GPIO18, GPIO5]

EDIT: same, no stream, :frowning:

As it says in the docs, and my config at the near top of the page

data_pins: [GPIO5, GPIO18, GPIO19, GPIO21, GPIO36, GPIO39, GPIO34, GPIO35]
1 Like

yes!!
That was it, thanks a lot

1 Like

@Klagio I’ve recently received a few of the diymore.cc devices as you pictured. Can you please tell me the source of the ESP32-Cam sketch you have working with this device? I’ve been unable to get anything functioning on the device, yet. It continues to say “camera not recognized”. Many thanks!

below a working config

esphome:
  name: cam
  platform: ESP32
  board: esp32dev

substitutions:
  # Modify variables based on your settings
  hostname: 'Cam'

wifi:
  networks:
  - ssid: "xx"
    password: "xx"
  - ssid: xxx
    password: xxx
  manual_ip:
    static_ip: 192.168.1.21
    gateway: 192.168.1.253
    subnet: 255.255.255.0

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

web_server:
  port: 80


esp32_camera:
  name: 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
  


output:
#flashlight
  - platform: gpio
    pin: GPIO4
    id: gpio_4
#statuslight
  - platform: gpio
    pin:
      number: GPIO33
      inverted: True
    id: gpio_33
light:
#flashlight
  - platform: binary
    output: gpio_4
    name: $hostname flash
#statuslight
  - platform: binary   
    output: gpio_33
    name: $hostname status
    
    
    
sensor:
  - platform: wifi_signal
    name: $hostname WiFi Signal
    update_interval: 60s
  - platform: uptime
    name: $hostname Uptime

    
text_sensor:
  - platform: version
    name: $hostname ESPHome Version
  - platform: wifi_info
    ssid:
      name: $hostname WiFi

switch:      
  - platform: restart
    name: $hostname restart
    
binary_sensor:
  - platform: status
    name: $hostname status

this in lovelace

  - id: camera_esp
    type: picture-glance
    title: Cam
    entities:
      - light.cam_flash
      - light.cam_status
      - switch.cam_restart
      - binary_sensor.cam_status
    camera_image: camera.my_camera
    camera_view: live
    show_header_toggle: false
    aspect_ratio: 16x9
7 Likes

Finally got my camera working tonight. It seems I needed to drop the flash write frequency from 80 MHz to 40 MHz and then everything worked as expected. :slight_smile:

I flash it with ESPHOMEFLASHER the first time, and later OTA, never a problem

Is it possible to do an automation INSIDE ESPhome that when the status is available the camera has the LED on, and LED off otherwise?

The below gives error

binary_sensor:
  - platform: status
    name: $hostname status
    on_state:
      then:
        - light.turn_on: light.cam_status    
    off_state:
      then:
        - light.turn_off: light.cam_status

I have the TTGO-Camera w/Microphone board and this was the PIR code that worked for me. The pinouts are different for the Mic version.

binary_sensor:
  - platform: gpio
    device_class: motion
    name: "PIR Sensor"
    pin: GPIO19
1 Like

I have got problems in dimming the LED from the AI-Thinker Modul. This is my code but i can only turn the led on and off no dimming at all.

output:
  - platform: ledc
    pin: GPIO4
    id: gpio_d4

light:
  - platform: monochromatic
    name: "esp_cam1"
    output: gpio_d4

Any hints?

Still struggling with this ESP32 module ( amazon )

I have configured the code as follows in ESPHome

esphome:
  name: espcam1
  platform: ESP32
  board: m5stack-core-esp32

wifi:
  ssid: "Franks"
  password: "xxxxx"
  manual_ip:
    static_ip: 192.168.5.170
    gateway: 192.168.5.252
    subnet: 255.255.255.0


# Enable logging
logger:

# Enable Home Assistant API
api:
  password: 'xxxxx'

ota:
  password: 'xxxxx'

esp32_camera:
  external_clock:
    pin: GPIO27
    frequency: 20MHz
  i2c_pins:
    sda: GPIO25
    scl: GPIO23
  data_pins: [GPIO17, GPIO35, GPIO34, GPIO5, GPIO39, GPIO18, GPIO36, GPIO19]
  vsync_pin: GPIO22
  href_pin: GPIO26
  pixel_clock_pin: GPIO21
  reset_pin: GPIO15

  # Image settings
  name: My Camera

I use the following settings in the flash tool, flash states ok when done.

Anybody any ideas, cant ping it once rebooted?

thanks

The url is available in the attributes of the camera entity and resolves to something like:

http://your_ha_ip:8123/api/camera_proxy_stream/camera.your_camera?token=xxxxxxx

The token, also an attribute, changes from time to time.

2 Likes

Can you show the full config for your TTGO w Mic version?
Might be that the pinout on AliExpress is wrong.

Why not flash it with esphome?

I’m running in a oracle vm and oracle doesn’t seem to like the usb-c to attach as a serial port. Standard usb with WeMos d1 minis etc work fine.

Cheers

Hi Olaf

Here is what the config should look like with a TTGO WITH MICROPHONE ESP32 board. It has a completly different GPIO pinout than the TTGO CAM with BME280. Beware that the pinout given by the sellers for this cam (with mic) is actually wrong for the PIR GPIO. It is said to be on GPIO33 (as on the NON-MIC CAM) while it is indeed on the GPIO19. I have tested the config to be OK with the PIR and I2C devices. The Camera is working but I get continuous disconnections from the Esphome API, which is a different issue.

binary_sensor:
  - platform: gpio
    pin: GPIO19
    name: "ttgocam1 PIR"
    device_class: motion

i2c:
  sda: GPIO21
  scl: GPIO22

esp32_camera:
  name: "ttgocam1 Camera"
  external_clock:
    pin: GPIO4
    frequency: 20MHz
  i2c_pins:
    sda: GPIO18
    scl: GPIO23
  data_pins: [GPIO34, GPIO13, GPIO14, GPIO35, GPIO39, GPIO12, GPIO15, GPIO36]
  vsync_pin: GPIO5
  href_pin: GPIO27
  pixel_clock_pin: GPIO25
1 Like