-
Notifications
You must be signed in to change notification settings - Fork 7.6k
I2C communication error. #1020
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is a known issue and top priority to the devs right now. Should hopefully be fixed in a few days. |
Thanks everslick I did not know about that fault in our ESP32, I hope it will be fixed soon. Greetings BlackTiger44 |
Someone knows when it will be fixed? Thanks! :-) |
@BlackTiger44 @JavierPascual I have a branch that may work for you.
Either one should work for you. After more testing, I plan on merging Chuck. |
Thanks for contributing your work Stickbreaker. The files to correct the failure of the ESP32 on the I2C bus are the following ??. libraries\Wire\src A greeting |
@BlackTiger44 navigate to branch Wire-Destructor. This is where I am uploading revisions that handle creating and destroying I found a problem when I was testing: If I specified the I am still testing, I plan on uploading to Wire-Destructor later today if my testing succeeds. I am also testing multiple masters on the same bus. I have a sketch that has one task using the second i2c hardware peripheral to access a 4x4 keypad via MCP23008, and a 24x1 LCD via a MCP23017. While this is happening, the foreground task is using the first i2c peripheral to access a 20x4 lcd via MCP23008, and multiple 24LCxx EEPROMS, all of these devices are connected to the same i2c bus, so the two peripherals are fighting for bus ownership. I am working through the Arbitration backout, retry and polite design rules. I'm having to re-code my device libraries to logically recover from an arbitration loss. This has stretched my brain. Deciding when to fail,(stop retrying), how long to wait for a clear bus, when to manually clear the bus. It's kind of fun. Chuck. |
You have a strange idea of fun, but thanks for all your work on this! |
Hi. I have been testing in my program the files modified for the I2C bus by stickbreaker, and the truth is that I do not get stuck with the program, but even then the following error message comes out from time to time [I][esp32-hal-i2c.c:971] i2cProcQueue(): Bus busy, reinit But even when the aforementioned error message comes out, my program continues to work. I have put "Wire.setTimeout(500);" but I have not noticed any improvement. Thanks stickbreaker for your work. Greetings |
@BlackTiger44 What i2c devices are you using? Bus busy is reporting SDA or SCL are not in the Idle state (high). Either you have a bus problem, or one of your devices is stretching SCL to pause the ESP during a master mode transmission. Chuck. |
Hello, stickbreaker. Greetings and thanks BlackTiger |
Post a schematic of your circuit, i think it is an- electrical problem Chuck |
@BlackTiger44 Do you have any info on your relay module? I am questioning the current required to activate the relays. The pca 8574 is limited to 25mA per output 200mA max. |
@BlackTiger44 I just noticed you have the pca8574 powered by 3.3v but the relay module is powered by 5v. The output stages of the '74 connect to 3.3v via pmosfet, you could be back feeding 5v into the 3.3v rail. Try measuring voltage on the output pins when the signal is off. if it is above 3.3, you are going to have to change the circuit. I would change the circuit, power the '74 from 5v. Put a level shifter between esp32 and '74. Chuck |
Thanks stickbreaker Relay module information, as you can see the coils of the relays of the module work at 5V. Try to feed the PCF8574A to 5V. Thanks again |
Hi stickbreaker. I have fed the PCF8574 to 5V, but there has not been any improvement, even disconnecting the relay RL1 sometime I get a fault message on the I2C bus. In the end I decided to use the digital outputs of the ESP32 itself, to activate the relays of the module, only one current of 2mA is necessary. I hope and wish that espressif solve this problem of ESP32, since it is a great microcontroller. Thanks for your help stickbreaker. a greeting |
The I2C core was changed to @stickbreaker code officially after 13dcfe5 (thanks @stickbreaker), Let's close issues with old code and if have problems with the new code, open new issues =) |
Hardware:
Board: ESP32 Dev Module
Core Installation/update date: ?11/jul/2017?
IDE name: ?Arduino IDE? ?Platform.io? ?IDF component?
Flash Frequency: ?40Mhz?
Upload Speed: ?115200?
Hello everyone.
I have a PCF8574A port that randomly gives me the following error:
[E][esp32-hal-i2c.c:161] i2cWrite(): Busy Timeout! Addr: 21
The PCF8574A is at address 21.
The code of the function that I use to perform the writing operations is the following:
void WriteDataPortPCF8574A(byte device,byte data)
{
Wire.beginTransmission((int)device);
Wire.write(data);
Wire.endTransmission();
}
And the configuration of the I2C bus
void setup()
{
Wire.begin(21,22,100000);
WriteDataPortPCF8574A(AdrPortOut0PCF8574T,B11111111);
}
Can someone please tell me what is causing the failure in I2C communications with my PCF8574 port.
Thank you BlackTiger44.
The text was updated successfully, but these errors were encountered: