SP8266 I2C bus freezing
Hi everyone, I'm currently using a DIY weather station with an ESP8266 WeMos D1. For some time now, I've been having problems with the I2C bus freezing, which forces me to reboot the device, cycle power, and reconnect power to get the sensors working again—sometimes once a day.
Following some advice, I added two 2.2 kΩ pull-up resistors between the 3.3 V pin and the SDA/SCL lines. This seems to have solved the freezing issue; for now, it seems to have been working stably for a full day!
However, I've noticed a side effect: the readings from my TSL2591 ambient light sensor have halved compared to what I was getting before.
I have two questions:
Are there better ways to resolve these I2C bus freezing issues, or is adding external pull-up resistors the standard solution for the ESP8266?
Should I simply compensate for the "offset" in my code, or does the variation in values indicate a deeper issue with the I2C signal integrity caused by the resistors?
Currently, the ESP8266 reads temperature with an SHT40, wind direction with an AS5600 and a 10-meter cable, and light with a TSL2591. This and the SHT40 use two 2-meter cables. (I should join the two sensors to use a single cable, but I hadn't thought of that before installing them.) I added a 470 microF capacitor just to be safe.
Any advice or suggestions on best practices would be greatly appreciated. Thanks!