Skip to content

Wire.lastError() throwing back error 5 #24

Closed
@euquiq

Description

@euquiq

Hi Stickbreaker !!!

How are you ? Hope you remember me, I had serious problems with ESP32 and official arduino branch regarding i2c.

Your work saved me!

And then, today, I decided to update into the latest espressif/arduino-esp32 code from github.

Then I downloaded your branched - i2c enhanced code from git, and copied over the relevant files, into the master esp32 arduino:

\libraries\Wire\scr\Wire.h
\libraries\Wire\scr\Wire.cpp
\cores\esp32\esp32 - hal - i2c.h
\cores\esp32\esp32 - hal - i2c.c
\cores\esp32\esp32 - hal - log.h

I recompiled, and to my dismay, my code is not being able to read 256 bytes from my sensor's EEPROM (which in the older commit was OK until now (I was using ge5b2c1cf).

This is my code (which was working fine):

//Levanto toda la info de la EEPROM del sensor para manejarla en ram (más rápido)
void readEEPROM() { // Read in blocks of 32 bytes to accomodate Wire library
	int err = 0;
	do {
		Wire.beginTransmission(MLX90621_EEPROM);
		Wire.write(0);
		err = Wire.transact(eepromData, 256); //grab 256 byte directly into eepromData
		if (err != 256) { //Error: NO recibí los 256 bytes de la eeprom
			Serial.println("EEPROM ERROR " + (String)Wire.lastError() + ", " + (String)err + " bytes");
			Wire.endTransmission(true); //Cierro la transmision correctamente.
			Wire.reset(); //Y reseteo el interface
		}
	} while (err != 256);
	reseteo = 0; //No da error el i2c
}

Which now keeps in loop throwing at me:

EEPROM ERROR 5, 0 bytes

I was hoping you may have an idea on what may be going on ? I could try to revert into earlier commits, until I get a working one again, I suppose. But maybe it is an easy thing to fix from my side ?

Regards,

Enrique.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions