i2cdevlib icon indicating copy to clipboard operation
i2cdevlib copied to clipboard

Updating to Arduino ESP32 2.02 breaks this library!

Open kjamesDBW opened this issue 3 years ago • 5 comments

Hi, Couldn't figure it out at first but updating to ESP32 2.02 in the Arduino Boards Manager breaks this library. It never manages to get past the .initialize() function:

// initialize device Serial.println("Initializing I2C devices..."); accelgyro.initialize(); <---- dies here

Downgraded to ESP32 2.0.0 and all back to working correctly. Phew!

Hope this save someone some time fiddling and swapping bits out like I have this evening...

kjamesDBW avatar Feb 09 '22 21:02 kjamesDBW

I see the same issue with ESP 2.0.0 and 2.0.1 in addition to 2.0.2. I don't see the problem with 1.0.6, and that works for my other Adafruit ESP32, but the Adafruit ESP32 Feather v2 won't compile with the 1.0.6.

If you have a trick to make 2.0.0 work, I'd be interested in hearing it.

mahboud avatar Mar 05 '22 10:03 mahboud

Same issue. Don't why it's still not fixed. If I have some spare time I'll try sending a PR.

listout avatar Apr 03 '22 15:04 listout

I have the same issue, looks like the problem is in the wire implementation in espressif32 for arduino. Have not dont any more deeper investigation but there are tickets open.

mp-se avatar May 06 '22 15:05 mp-se

I have the same issue when updating to Arduino ESP32 2.0.3

igcxl avatar Jul 07 '22 08:07 igcxl

Try to remove line 285 in i2cdev.cpp, that worked for me. If it works I can send in a PR.

        for (int k = 0; k < length; k += min((int)length, I2CDEVLIB_WIRE_BUFFER_LENGTH)) {
            useWire->beginTransmission(devAddr);
            useWire->write(regAddr);
            useWire->endTransmission();
            // See: https://github.com/espressif/arduino-esp32/issues/6674
            // useWire->beginTransmission(devAddr); <-- Remove this line...
            useWire->requestFrom((uint8_t)devAddr, (uint8_t)min((int)length - k, I2CDEVLIB_WIRE_BUFFER_LENGTH));

mp-se avatar Jul 07 '22 08:07 mp-se

@jrowberg Will here be a fix-commit for this issue? I triefd for days, only to find out, there must not be begin/endTransmission around any requestForm, and now I have a manually fixed version of this lib in my project. But I would like to see it in the official. Its the same fix for issue #672

If you wish, I can create a PR.

brainwind-software avatar Sep 28 '22 14:09 brainwind-software

@jrowberg Will here be a fix-commit for this issue?

Sorry it took me so long to get to such a mind-numbingly simple issue that's been in the library from the very beginning. There was one small part that was already fixed some time ago, but most of the offending code was still intact. It's now all fixed.

jrowberg avatar Oct 14 '22 03:10 jrowberg