i2c.readfrom timeout

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
pmulvey
Posts: 45
Joined: Sun Jul 29, 2018 8:12 am
Location: Athlone, Ireland

i2c.readfrom timeout

Post by pmulvey » Fri Aug 14, 2020 3:30 pm

I am talking to my Arduino from ESP8266 via i2c. The Arduino code can sometimes take up to 36mS to complete the code that responds to the i2c.readfrom command at the ESP. After a few transactions the ESP throws an error:

Code: Select all

  File "IO.py", line 110, in read
OSError: I2C bus error
Does anyone know if there is a timeout setting that I can use because I'm guessing that this is the problem.
Paul Mulvey

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: i2c.readfrom timeout

Post by pythoncoder » Fri Aug 14, 2020 3:45 pm

Bus errors are often caused by electrical problems, especially missing pullup resistors or ones with too high a value. Also ensure that the wires are reasonably short and that you have a reliable common ground connection.
Peter Hinch
Index to my micropython libraries.

shaoziyang
Posts: 363
Joined: Sun Apr 17, 2016 1:55 pm

Re: i2c.readfrom timeout

Post by shaoziyang » Sat Aug 15, 2020 2:50 am

You may try reduce the frequency of the I2C bus.

Post Reply