Skip to content
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

ESP32: I2C access on wrong address #1480

Closed
vshymanskyy opened this issue Jul 8, 2018 · 2 comments
Closed

ESP32: I2C access on wrong address #1480

vshymanskyy opened this issue Jul 8, 2018 · 2 comments
Labels
ESP32 This is only a problem on ESP32-based devices

Comments

@vshymanskyy
Copy link
Contributor

vshymanskyy commented Jul 8, 2018

When reading on wrong address - operation success, returns random data.

I think it should actually throw an error. Currently it only prints to the console:

ERROR: jshI2CRead:, slave doesn't ACK the transfer.

This also applies to writeTo

@wilberforce wilberforce added the ESP32 This is only a problem on ESP32-based devices label Jul 17, 2018
@MaBecker
Copy link
Contributor

@vshymanskyy do you like to create a pull request for this?

@MaBecker
Copy link
Contributor

just tested - it has been fixed.

I2C1.setup({sda:D12,scl:D22});

try{
  I2C1.readFrom(0x20,1);
} catch(e){
  console.log("catch:",e.message, e.stack);
}
/* output

>catch: jshI2CRead: slave doesn't ACK the transfer  at line 6 col 23
  I2C1.readFrom(0x20,1);
                      ^
*/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ESP32 This is only a problem on ESP32-based devices
Projects
None yet
Development

No branches or pull requests

3 participants