esphome / issues

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

Two different buses, one bus shadows another #5852

Open Limych opened 4 months ago

Limych commented 4 months ago

The problem

I'm trying to update an outdoor temperature and humidity sensor to ESPHome. The device worked perfectly under Tuya. By analyzing the printed circuit board and using trial firmware, all internal elements were found.

Among others, there is an HTU21D sensor operating via an I2C bus and a display similar to the TM1638. They use a common clock pin (SCL for I2C, CLK for display)

When working separately, everything functions correctly. But when adding both components at the same time, the display does not work. Although no errors are given.

Which version of ESPHome has the issue?

2024.5.3

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2024.5.4

What platform are you using?

ESP8266

Board

Konlen WiFi TH Sensor (TYWE3S inside)

Component causing the issue

tm1638

Example YAML snippet

esphome:
  name: "konlen-wifi-th-sensor"
  platform: ESP8266 
  board: esp_wroom_02

i2c:
  sda: GPIO14
  scl:
    number: GPIO12
    allow_other_uses: True
  scan: False

sensor:
  - platform: htu21d
    model: htu21d
    temperature:
      name: "Temperature"
    humidity:
      name: "Humidity"

display:
  platform: tm1638
  id: gn1638_display
  stb_pin: GPIO13
  clk_pin:
    number: GPIO12
    allow_other_uses: True
  dio_pin: GPIO4
  intensity: 1 # 0...7
  #update_interval: 1s
  lambda: |-
    it.print("0123");

Anything in the logs that might be useful for us?

No response

Additional information

No response

skykingjwc commented 3 months ago

Because the TM1638 is not an I2C device. You can't share the clock pin with the I2C bus. It doesn't work that way.

Limych commented 3 months ago

But it somehow works with the native firmware. And it works absolutely correctly.

While waiting for an answer, I studied the question in more detail. As I understand it, the operation of the I2C bus is temporarily suspended while communicating with the display.