Closed trylika closed 3 years ago
I have similar issue with ESP32 and SHTC3. It's works until I shutdown homeassistance vm. All other sensors, not related to i2c continues to works perfect (with mqtt). After shutdown (or just loss connection between ESP32 and HA) HA VM - SHTC3 continues to works for some time (maybe 5 minutes or more) then blue light on ESP32 (I use it as status indicator) starts fast flashing, which means problems with ESP32. If I restore HA VM, it doesn't helps until I completely power off/on my ESP32 (resetting ESP32 is not helpful). If I start my ESP32 without HA it's starts to works, I receiving messages on MQTT broker, but not for long time (problem only on device with i2c).
Is there any suggestion?
part of project:
status_led:
pin:
number: GPIO2
inverted: true
mqtt:
broker: mqtt.myserver.my
username: meme
password: momo
i2c:
sda: 21
scl: 22
sensor:
- platform: shtcx
temperature:
name: "SHTC3 temp"
humidity:
name: "SHTC3 hum"
update_interval: 30s
I run into the same problems. It seems to have some problems in the ccs811 library, but the i2c library also seems to have some problems.
The i2c library uses the underlying Wire library for many functions. In the Wire library, some issues are resolved when the status() function is called. However, this function is never called by the i2c library. One simple fix to try: In i2c.cpp, line 132, call "this->wire_->status();" before "return false;".
The ccs811 misses some error handling and passes invalid data during startup phase. I will soon rewrite some things for the ccs811 library.
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.
The problem is still present. I tried the proposal from @brambo123, but compilation failed with:
src/esphome/components/i2c/i2c.cpp: In member function 'bool esphome::i2c::I2CComponent::read_bytes(uint8_t, uint8_t, uint8_t*, uint8_t, uint32_t)':
src/esphome/components/i2c/i2c.cpp:132:18: error: 'class TwoWire' has no member named 'status'
this->wire_->status();
^
*** [.pioenvs/stopnice/src/esphome/components/i2c/i2c.cpp.o] Error 1
My error is:
i2c:076]: Unknown transmit error 4 for address 0x68
i2c:076]: Unknown transmit error 5 for address 0x68
The problem is still present. I tried the proposal from @brambo123, but compilation failed with:
src/esphome/components/i2c/i2c.cpp: In member function 'bool esphome::i2c::I2CComponent::read_bytes(uint8_t, uint8_t, uint8_t*, uint8_t, uint32_t)': src/esphome/components/i2c/i2c.cpp:132:18: error: 'class TwoWire' has no member named 'status' this->wire_->status(); ^ *** [.pioenvs/stopnice/src/esphome/components/i2c/i2c.cpp.o] Error 1
My error is:
i2c:076]: Unknown transmit error 4 for address 0x68 i2c:076]: Unknown transmit error 5 for address 0x68
I just tried the fix again, and it still compiles without problems. I'm guessing you are running on an ESP32 and not an ESP8266?
Yes, that is correct. And now i see Issue title :facepalm:
Do you perhaps have a fix for ESP32?
Operating environment/Installation (Hass.io/Docker/pip/etc.):
pip3 on Raspbian. Tested versions of ESPHome - develop and 1.14.3 Tested arduino_version: 2.5.2 and 2.4.2
ESP (ESP32/ESP8266, Board/Sonoff):
ESP8266 (Wemos D1 Mini v3)
Affected component:
https://esphome.io/components/i2c.html
Description of problem: After some odd number of hours (around 7). i2c communication stops working with any sensors connected to ESP8266. Rebooting ESP does not help, only full power off/on makes sensor working again. Log shows only message
Unknown transmit error 4 for address *****
for every connected sensor.Problem-relevant YAML-configuration entries:
Logs (if applicable):
Additional information and things you've tried: