esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 34 forks source link

LILYGO T-camera board disconnects #5194

Open krisnoble opened 9 months ago

krisnoble commented 9 months ago

The problem

I have four of the Lilygo/TTGO T-camera ESP32 boards with OLED and mic purchased from AliExpress, albeit not using the I2S mic functionality as it crashes when trying to use both mic and camera, I assume due to lack of resources.

They have been working great for over a year but recently have been disconnecting seemingly randomly, no obvious patterns or triggers. Not 100% sure when this started but I first noticed it in 2023.10 and still present in 2023.11.6. My other devices running a mixture of ESP32 and ESP8266 don't seem to be affected so I assume it's something to do with the board or the config.

I had assumed a crash but the logs I captured from one just now don't have any sort of crash report, just a network disconnect/reconnect. In the log section below the first time it reconnected almost immediately, second time took about 20 minutes.

Hoping someone might have some ideas? YAML is below, all have similar config with static IP.

Which version of ESPHome has the issue?

2023.11.6

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

No response

What platform are you using?

ESP32

Board

LILYGO® TTGO T-Camera ESP32 WROVER & PSRAM Camera Module ESP32-WROVER-B OV2640 Camera Module 0.96 OLED Fish-eye Mic 9102

Component causing the issue

No response

Example YAML snippet

substitutions:
  friendly_name: "Living room"
  device_name: "living-room-camera"

####################################

  # Sensors
  motion_timeout: "1s"
  sound_timeout: "10s"
  occupancy_timeout: "300s"

  # Camera
  quality: "10"
  resolution: "640x480"
  invert: "true"
  max_frames: "30fps"
  idle_frames: "0fps"

  # Display
  display_rotation: "180"

  # Security
  api_key: [redacted]
  ota_pass: [redacted]

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    # Set this to the IP of the ESP
    static_ip: 192.168.0.189
    # Set this to the IP address of the router. Often ends with .1
    gateway: 192.168.0.1
    # The subnet of the network. 255.255.255.0 works for most home networks.
    subnet: 255.255.0.0

####################################

binary_sensor:
  - platform: gpio
    pin: 
      number: GPIO19
      mode: INPUT
      inverted: False
    name: Motion
    device_class: motion
    filters:
      - delayed_off: $motion_timeout
  - platform: gpio
    pin: 
      number: GPIO19
      mode: INPUT
      inverted: False
    name: Occupancy
    device_class: occupancy
    filters:
      - delayed_off: $occupancy_timeout
  - platform: status
    name: Status
  - platform: gpio
    pin: 
      number: GPIO15
      mode: INPUT_PULLDOWN
      inverted: true
    name: Sound
    device_class: sound
    filters:
      - delayed_off: $sound_timeout

switch:
    - platform: gpio
      pin: 21
      id: active
      name: Camera active
      icon: "mdi:power"
      on_turn_on:
        - display.page.show: "on"
      on_turn_off:
        - display.page.show: "off"

####################################

esphome:
  name: $device_name
  friendly_name: $friendly_name
  platform: ESP32
  board: esp-wrover-kit

# Enable logging
logger:

# Enable Home Assistant API
api:
    encryption:
      key: $api_key

ota:
    password: $ota_pass

####################################

i2c:
  sda: GPIO21
  scl: GPIO22
  frequency: 400kHz

font:
  - file: "gfonts://Bebas Neue"
    id: bebas
    size: 48

time:
  - platform: homeassistant
    id: homeassistant_time

display:
  - platform: ssd1306_i2c
    model: "SSD1306 128x64"
    address: 0x3C
    rotation: $display_rotation
    brightness: 100%
    pages:
      - id: "off"
        lambda: |-
          it.fill(COLOR_OFF);
      - id: "on"
        lambda: |-
          it.strftime(64, 32, id(bebas), TextAlign::CENTER, "%H:%M:%S", id(homeassistant_time).now());

esp32_camera:
  name: Camera
  external_clock:
    pin: GPIO4
    frequency: 10MHz
  i2c_pins:
    sda: GPIO18
    scl: GPIO23
  data_pins: [GPIO34, GPIO13, GPIO14, GPIO35, GPIO39, GPIO38, GPIO37, GPIO36]
  vsync_pin: GPIO5
  href_pin: GPIO27
  pixel_clock_pin: GPIO25
  resolution: $resolution
  jpeg_quality: $quality
  vertical_flip: $invert
  horizontal_mirror: $invert
  max_framerate: $max_frames
  idle_framerate: $idle_frames
  on_stream_start:
  - then:
    - switch.turn_on: active

button:
  - platform: restart
    name: Restart

Anything in the logs that might be useful for us?

Example 1:

[15:28:51][D][binary_sensor:036]: 'Motion': Sending state ON [15:28:56][D][binary_sensor:036]: 'Motion': Sending state OFF WARNING 192.168.0.189: Connection error occurred: Ping response not received after 90.0 seconds INFO Processing unexpected disconnect from ESPHome API for 192.168.0.189 WARNING Disconnected from API WARNING Can't connect to ESPHome API for 192.168.0.189: Error connecting to ('192.168.0.189', 6053): [Errno 113] Connect call failed ('192.168.0.189', 6053) (SocketAPIError) INFO Trying to connect to 192.168.0.189 in the background INFO Successfully connected to 192.168.0.189 in 0.129s INFO Successful handshake with 192.168.0.189 in 1.742s WARNING 192.168.0.189: Connection error occurred: Ping response not received after 90.0 seconds INFO Processing unexpected disconnect from ESPHome API for 192.168.0.189 WARNING Disconnected from API WARNING Can't connect to ESPHome API for 192.168.0.189: Error connecting to ('192.168.0.189', 6053): [Errno 113] Connect call failed ('192.168.0.189', 6053) (SocketAPIError) INFO Trying to connect to 192.168.0.189 in the background INFO Successfully connected to 192.168.0.189 in 0.037s INFO Successful handshake with 192.168.0.189 in 0.107s [15:57:16][D][binary_sensor:036]: 'Motion': Sending state ON [15:57:21][D][binary_sensor:036]: 'Motion': Sending state OFF [16:02:20][D][binary_sensor:036]: 'Occupancy': Sending state OFF

Example 2:

[00:05:09][D][binary_sensor:036]: 'Occupancy': Sending state OFF WARNING 192.168.0.163: Connection error occurred: [Errno 104] Connection reset by peer INFO Processing unexpected disconnect from ESPHome API for 192.168.0.163 WARNING Disconnected from API INFO Successfully connected to 192.168.0.163 in 0.035s INFO Successful handshake with 192.168.0.163 in 0.143s WARNING 192.168.0.163: Connection error occurred: [Errno 104] Connection reset by peer INFO Processing unexpected disconnect from ESPHome API for 192.168.0.163 WARNING Disconnected from API INFO Successfully connected to 192.168.0.163 in 0.014s INFO Successful handshake with 192.168.0.163 in 0.092s [00:53:49][D][api:102]: Accepted 192.168.0.102 [00:53:49][D][api.connection:1089]: Home Assistant 2023.11.3 (192.168.0.102): Connected successfully [00:53:49][D][time:045]: Synchronized time: 2023-12-05 00:53:49 WARNING 192.168.0.163: Connection error occurred: Ping response not received after 90.0 seconds INFO Processing unexpected disconnect from ESPHome API for 192.168.0.163 WARNING Disconnected from API WARNING Can't connect to ESPHome API for 192.168.0.163: Error connecting to ('192.168.0.163', 6053): [Errno 113] Connect call failed ('192.168.0.163', 6053) (SocketAPIError) INFO Trying to connect to 192.168.0.163 in the background INFO Successfully connected to 192.168.0.163 in 5.176s INFO Successful handshake with 192.168.0.163 in 0.292s WARNING 192.168.0.163: Connection error occurred: Ping response not received after 90.0 seconds INFO Processing unexpected disconnect from ESPHome API for 192.168.0.163 WARNING Disconnected from API WARNING Can't connect to ESPHome API for 192.168.0.163: Error connecting to ('192.168.0.163', 6053): [Errno 113] Connect call failed ('192.168.0.163', 6053) (SocketAPIError) INFO Trying to connect to 192.168.0.163 in the background INFO Successfully connected to 192.168.0.163 in 0.115s INFO Successful handshake with 192.168.0.163 in 0.100s [02:24:03][D][binary_sensor:036]: 'Motion': Sending state ON

Additional information

No response

github-actions[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

krisnoble commented 5 months ago

Still getting occasional dropouts - not as often as back in December but more often than my other devices