letscontrolit / ESPEasy

Easy MultiSensor device based on ESP8266/ESP32
http://www.espeasy.com
Other
3.28k stars 2.22k forks source link

ESP32 i2c stops working #1282

Closed waspie closed 5 years ago

waspie commented 6 years ago

ESP32

I'm still working on what conditions this happens. For sure it happens with a TSL2561 connected. I don't think i'm seeing the same behavior with just 2 MCP23017s connected but I need to disconnect the TSL2561 when I get home and see if it still happens but I'm pretty sure the TSL2561 is the cause. The particular piece of hardware has been working reliably for months on end so I don't think its the TSL2561 itself but something software/esp32 related.

I've used the precompiled binary from late march and my own compiled versions and the behavior is the same.

With my 3 i2c devices connected they work for a couple minutes (at best) but soon after they all disappear and an i2c scan shows no devices.

On my own compiled versions i'm running just 6 plugins.

Build 20100 - Mega32
GIT version (custom)
Plugins 6 [Normal]
Build Md5 4d44355f4d44355f4d44355f4d44355f
Md5 check fail !
Build time Apr 18 2018 23:03:07 <----built from April 2 source
Binary filename ThisIsTheDummyPlaceHolderForTheBinaryFilename...

ESP board ESP Chip ID |   Storage Flash Chip ID |   Flash Chip Real Size: | 4096 kB Flash IDE Size: | 4096 kB Flash Writes | 0 daily / 0 boot Sketch Size

i2c is on pin 4/5 (default) No I2C devices found

plugins

TD-er commented 6 years ago

@Budman1758 https://www.dropbox.com/s/972eoa9c72bgngw/esp32dev_20180425.rar?dl=0 Just made the build I use on my ESP32 node. That one is running with an OLED framed plugin, MQTT and some generic plugin to log the memory usage.

DL6DBZ commented 6 years ago

Is there any new esp easy firmware for the ESP32 available ? I used the ESPEasy32_R20100 but I still has problems with the framed OLED in combination with an BME280 on the same I2C bus. It always stuck in the I2C routines if both devices are active. With the standard OLED 1306 it is working also in combination with the BME280.

Thanks for you help in advance. The dropbox link from Budman1758 does not work.

TD-er commented 6 years ago

Please only close issues when they need to be closed, not when asking a question.

TD-er commented 6 years ago

About your question by the way, in the nightly builds there is also a version for ESP32 included. But it has still issues with I2C, at least when using more than one device. The last release of PlatformIO for ESP32 I tried about a week ago could not be built, so I cannot test if it has been working in the last core libraries.

waspie commented 6 years ago

the code by stickbreaker that fixes i2c problems was added to the official esp32 core (according to him) some time in june:

https://github.com/stickbreaker/arduino-esp32/issues/38#issuecomment-401554654

so you should be able to build without anything special just using the official core

TD-er commented 6 years ago

I have tried to build with the 1.3.0 a few days ago but wasn't able to compile ESP easy. And 1.2.0 caused all kinds or crashes when accessing the device config.

waspie commented 6 years ago

Well crap, that stinks. I stopped using esp32s a few months ago because of the instability so I'm of no help then :\ sorry about that

DL6DBZ commented 6 years ago

Concerning the I2C problem at ESP32 under ESP easy I got some additional information. I monitored the two I2C lines with my digital oscilloscope during operation. Running the BMx280 module standalone, I saw an 10 kHz I2C clock signal with nice slopes. The same with the SS1306 OLED module. Then I switched to the SS1306 framed OLED module. The clock signal increased to 585 kHz with very round slopes. The SS1306 framed OLED module standalone does not cause any problem. But if i switch the BMx280 module additional on, the I2C signal crashed. I saw an continous 585 kHz signal on the clock line an an constant high signal at the SDA line. To get rid of this problem, I have to do an hard reset (power down). A soft reset does not help.

Will be an future for failure free ESPeasy at ESP32 ? Why everybody use the old ESP 8266 ?

TD-er commented 6 years ago

I really would like to use the ESP32 also, since a lot of nice boards are available with that CPU, like the M5stack boards. Also that CPU has so much more potential, so I really really really like to have it supported in ESPeasy. But the I2C problems are one reason it isn't yet an active supported platform for ESPeasy. There are other issues too, but those are manageable.

For now I am working mainly on the ESP8266 to get it all stable to get to release a version. So that's my main focus now.

TD-er commented 5 years ago

I2C has been stable for a long time on ESP32 So will close this issue.