esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
291 stars 36 forks source link

no i2c devices found. ttgo + SSD1306 #2841

Open bernardovalente opened 2 years ago

bernardovalente commented 2 years ago

The problem

I am unable to get esphome to connect to my display over i2c. log:

[16:37:39][C][wifi:350]: Local MAC: xxxxx [16:37:39][C][wifi:351]: SSID: [redacted] [16:37:39][C][wifi:352]: IP Address: xxxx [16:37:39][C][wifi:354]: BSSID: [redacted]

[16:37:39][C][wifi:357]: Signal strength: -46 dB ▂▄▆█ [16:37:39][C][wifi:361]: Channel: 9 [16:37:39][C][wifi:362]: Subnet: xxxx [16:37:39][C][wifi:363]: Gateway: xxxxxx [16:37:39][C][wifi:364]: DNS1: 0.0.0.0 [16:37:39][C][wifi:365]: DNS2: 0.0.0.0

[16:37:39][C][logger:234]: Level: DEBUG [16:37:39][C][logger:235]: Log Baud Rate: 115200 [16:37:39][C][logger:236]: Hardware UART: UART0 [16:37:39][C][i2c.arduino:032]: I2C Bus: [16:37:39][C][i2c.arduino:033]: SDA Pin: GPIO21 [16:37:39][C][i2c.arduino:034]: SCL Pin: GPIO22 [16:37:39][C][i2c.arduino:035]: Frequency: 50000 Hz [16:37:39][C][i2c.arduino:038]: Recovery: bus successfully recovered [16:37:39][I][i2c.arduino:048]: Scanning i2c bus for active devices... [16:37:39][I][i2c.arduino:060]: Found no i2c devices! [16:37:39][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'doorbell PIR' [16:37:39][C][gpio.binary_sensor:015]: Device Class: 'motion' [16:37:39][C][gpio.binary_sensor:016]: Pin: GPIO19 [16:37:39][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'doorbell button' [16:37:39][C][gpio.binary_sensor:016]: Pin: GPIO15 [16:37:39][C][uptime.sensor:031]: Uptime Sensor 'doorbell Uptime' [16:37:39][C][uptime.sensor:031]: State Class: 'total_increasing' [16:37:39][C][uptime.sensor:031]: Unit of Measurement: 's' [16:37:39][C][uptime.sensor:031]: Accuracy Decimals: 0

[16:37:39][C][status:034]: Status Binary Sensor 'doorbell status' [16:37:39][C][status:034]: Device Class: 'connectivity' [16:37:39][C][restart:022]: Restart Switch 'Doorbell Restart'

[16:37:39][C][esp32_camera:046]: ESP32 Camera: [16:37:39][C][esp32_camera:047]: Name: Doorbell Camera [16:37:39][C][esp32_camera:048]: Internal: NO [16:37:39][C][esp32_camera:050]: Board Has PSRAM: YES [16:37:40][C][esp32_camera:053]: Data Pins: D0:34 D1:13 D2:14 D3:35 D4:39 D5:38 D6:37 D7:36 [16:37:40][C][esp32_camera:054]: VSYNC Pin: 5 [16:37:40][C][esp32_camera:055]: HREF Pin: 27 [16:37:40][C][esp32_camera:056]: Pixel Clock Pin: 25 [16:37:40][C][esp32_camera:057]: External Clock: Pin:4 Frequency:20000000 [16:37:40][C][esp32_camera:058]: I2C Pins: SDA:18 SCL:23 [16:37:40][C][esp32_camera:059]: Reset Pin: -1 [16:37:40][C][esp32_camera:080]: Resolution: 800x600 (SVGA) [16:37:40][C][esp32_camera:102]: JPEG Quality: 10 [16:37:40][C][esp32_camera:104]: Contrast: 0 [16:37:40][C][esp32_camera:105]: Brightness: 0 [16:37:40][C][esp32_camera:106]: Saturation: 0 [16:37:40][C][esp32_camera:107]: Vertical Flip: ON [16:37:40][C][esp32_camera:108]: Horizontal Mirror: ON [16:37:40][C][esp32_camera:125]: Test Pattern: NO [16:37:40][C][homeassistant.time:010]: Home Assistant Time:

[16:37:40][C][ssd1306_i2c:023]: I2C SSD1306 [16:37:40][C][ssd1306_i2c:023]: Rotations: 180 ° [16:37:40][C][ssd1306_i2c:023]: Dimensions: 128px x 64px [16:37:40][C][ssd1306_i2c:024]: Address: 0x3C [16:37:40][C][ssd1306_i2c:025]: Model: SSD1306 128x64 [16:37:40][C][ssd1306_i2c:027]: External VCC: NO [16:37:40][C][ssd1306_i2c:028]: Flip X: YES [16:37:40][C][ssd1306_i2c:029]: Flip Y: YES [16:37:40][C][ssd1306_i2c:030]: Offset X: 0 [16:37:40][C][ssd1306_i2c:031]: Offset Y: 0 [16:37:40][C][ssd1306_i2c:032]: Inverted Color: NO [16:37:40][C][ssd1306_i2c:033]: Update Interval: 1.0s [16:37:40][E][ssd1306_i2c:036]: Communication with SSD1306 failed! [16:37:40][C][captive_portal:144]: Captive Portal: [16:37:40][C][ota:082]: Over-The-Air Updates: [16:37:40][C][ota:083]: Address: xxxxx [16:37:40][C][ota:086]: Using Password. [16:37:40][C][api:134]: API Server: [16:37:40][C][api:135]: Address: xxxxx [16:37:40][C][api:139]: Using noise encryption: NO [16:37:40][C][homeassistant.binary_sensor:038]: Homeassistant Binary Sensor 'Doorbell Copy Door Relay' [16:37:40][C][homeassistant.binary_sensor:039]: Entity ID: 'switch.door_lock_relay' [16:37:40][C][wifi_signal.sensor:009]: WiFi Signal 'doorbell WiFi Signal' [16:37:40][C][wifi_signal.sensor:009]: Device Class: 'signal_strength' [16:37:40][C][wifi_signal.sensor:009]: State Class: 'measurement' [16:37:40][C][wifi_signal.sensor:009]: Unit of Measurement: 'dBm' [16:37:40][C][wifi_signal.sensor:009]: Accuracy Decimals: 0

[16:37:40][C][mdns:085]: Hostname: ttgo-campainha

Which version of ESPHome has the issue?

2021.12.1

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

core-2021.12.3 supervisor-2021.12.2

What platform are you using?

ESP32

Board

lilygo t-camera v1.6.2

Component causing the issue

i2c SSD1306

Example YAML snippet

wifi:
  ssid: !secret ssid
  password: !secret ssid_pwd

  manual_ip:
    static_ip: xxxx
    gateway: xxxx
    subnet: xxxx
captive_portal:

logger:

substitutions:
  devicename: campainha
  friendly_name: Campainha

esphome:
  name: ttgo-campainha
  platform: ESP32
  board: esp32dev

# Enable Home Assistant API
api:

ota:
  password: "xxxxx"

binary_sensor:
  - platform: gpio
    pin: GPIO19
    name: doorbell PIR
    device_class: motion
    filters:
      - delayed_off: 1s

  - platform: gpio
    pin:
      number: GPIO15
      mode: INPUT_PULLUP
      inverted: True
    name: doorbell button
    # On press show ding dong page and activate doorbell script in Home Assistant
    on_press:
      then:
        - display.page.show: ding_page
        - component.update: doorbell_display
        - delay: 2s
        - display.page.show: name_page
        - component.update: doorbell_display
        - homeassistant.service: 
            service: script.turn_on
            data:
              entity_id: "script.doorbell"
  # If front door is opened, show come in page
  - platform: homeassistant
    name: "Doorbell Copy Door Relay"
    entity_id: switch.door_lock_relay
    id: door_lock
    on_press:
      then:
        - display.page.show: come_in_page
        - component.update: doorbell_display
        - delay: 5s
        - display.page.show: name_page
        - component.update: doorbell_display
  - platform: status
    name: doorbell status

sensor:
  - platform: wifi_signal
    name: doorbell WiFi Signal
    update_interval: 10s
  - platform: uptime
    name: doorbell Uptime

switch:
  - platform: restart
    name: "Doorbell Restart"

esp32_camera:
  name: Doorbell Camera
  external_clock:
    pin: GPIO4
    frequency: 20MHz
  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: 800x600
  max_framerate: 60 fps
  jpeg_quality: 10
  vertical_flip: true
  horizontal_mirror: true

i2c:
  sda: GPIO21
  scl: GPIO22

font:
  - file: "fonts/times-new-roman.ttf"
    id: tnr1
    size: 20
  - file: "fonts/times-new-roman.ttf"
    id: tnr2
    size: 40

time:
  - platform: homeassistant
    id: homeassistant_time

display:
  - platform: ssd1306_i2c
    model: "SSD1306 128x64"
    rotation: 180
    address: 0x3C
    id: doorbell_display
    pages:
    # Name page
      - id: name_page
        lambda: |-
          it.print(22, 0, id(tnr1), "Carregar");
          it.print(50, 20, id(tnr1), "No");
          it.print(38, 43, id(tnr1), "Botao");
    # Ding Dong page
      - id: ding_page
        lambda: |-
            it.print(64, 0, id(tnr2), TextAlign::TOP_CENTER, "DING");
            it.print(64, 64, id(tnr2), TextAlign::BASELINE_CENTER, "DONG");
    # Welcome in page
      - id: come_in_page
        lambda: |-
            it.print(64, 0, id(tnr2), TextAlign::TOP_CENTER, "Pode");
            it.print(64, 64, id(tnr2), TextAlign::BASELINE_CENTER, "entrar");

Anything in the logs that might be useful for us?

At some point the display worked as I was testing with a a few months ago with a preetty similar yaml from where I copied mine, so don't think it's a hw issue (can't rule it out though)

Additional information

No response

github-actions[bot] commented 2 years 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.

bernardovalente commented 2 years ago

Issue still not resolved but no longer use this hw. Feel free to close this.