i2cWriteReadNonStop error when reading i2c registers

Issue #466 resolved
Sean shao created an issue

While doing an i2c scan, I found that reading a non-existing register would return a value of 0. It should return a negative value. Looking at the logs I found this error message:

[ 22099][E][Wire.cpp:499] requestFrom(): i2cWriteReadNonStop ret

[ 22099][E][Wire.cpp:499] requestFrom(): i2cWriteReadNonStop ret

Serial error, opcode: 114

urned Error -1

This error only occurs in the pilot version 1.2.50.

The boards tested were ESP32 and m5core.

Comments (6)

  1. John Maloney repo owner

    Hmm. This behavior is the result of fixing a problem with the MPR121 chip, which was not working correctly with the ESP32. If I revert, it will break the MPR121 code.

    Needs some thought...

  2. John Maloney repo owner

    I've investigated this issue and, in my tests, attempting to read a non-existent register for an I2C device resulted in a -3 error in the current pilot release (1.2.52).

    What I2C device are you using and which non-existent register were you attempting to read? Your I2C device may actually be returning a value for that register even if it is not listed as an existing register in the documentation.

    I'm also curious if you get different behavior using the stable version (v1.2.46) and the current pilot version. You can find the stable version here.

  3. John Maloney repo owner

    On further investigation, I realized that the problem does not arise when reading a non-existing register from an existing I2C device, but rather when you attempt to read from a non-existant I2C device. You are right, that made it impossible to scan the I2C bus to find out which devices were present.

    This is fixed in the latest pilot release, v1.2.54. I found a different way to fix the issue with using the MPR121 with ESP32 boards.

  4. Log in to comment