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

Random OSError: [Errno 5] EIO #16

Open
dmilardovich opened this issue Sep 19, 2023 · 1 comment
Open

Random OSError: [Errno 5] EIO #16

dmilardovich opened this issue Sep 19, 2023 · 1 comment

Comments

@dmilardovich
Copy link

Hi,

I am using this library to connect an MCP23017 to a Raspberry Pi Pico. Randomly, every few minutes, the code crashes with the following error:

Traceback (most recent call last):
File "", line 17, in
File "mcp23017.py", line 263, in pin
File "mcp23017.py", line 144, in gpio
File "mcp23017.py", line 73, in _read
OSError: [Errno 5] EIO

I build a very simple circuit on a protoboard to debug the issue, right now its just a Raspberry Pi Pico and an MCP23017. The code I'm running is also as simple as possible:

from machine import I2C, Pin, RTC, ADC, SPI, UART
from mcp23017 import MCP23017

Set-up the I2C bus.

i2c_bus = I2C(1,
scl = Pin(19),
sda = Pin(18),
freq = 10_000)

Set-up the MCP23017 I/O expander.

IO_expander = MCP23017(i2c_bus, 0x20)

while (True):
button_UP = IO_expander.pin(0)
button_DOWN = IO_expander.pin(1)
button_MODE = IO_expander.pin(2)
button_PULSE = IO_expander.pin(3)
button_DIS_ARM = IO_expander.pin(4)

print(" ")
print(str(button_UP)+" : "+str(button_DOWN)+" : "+str(button_MODE)+" : "+str(button_PULSE)+" : "+str(button_DIS_ARM))

Could you please tell me what might be wrong here? The code works perfectly fine for a few minutes and then crashes at random times.

Thanks!
Best,
Diego

@9acca9
Copy link

9acca9 commented Sep 28, 2024

That reminds me when i have some bad soldering or shorts (i dont speak english, maybe that is not the word). Hope that is your case and not this look #17
Maybe you already fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants