[Python] How to fix "OSError: [Errno 110] ETIMEDOUT" error in thonny ide

Discussão em 'Python' iniciado por Stack, Fevereiro 23, 2025.

  1. Stack

    Stack Membro Participativo

    My code is made using raspberry pi pico and oled (ssd1306) and it is like this:

    from machine import Pin, I2C
    from ssd1306 import SSD1306_I2C
    import framebuf
    width = 128
    height = 64
    i2c = I2C(1, scl=Pin(15), sda=Pin(14), freq=400000)
    oled = SSD1306_I2C(width, height, i2c)
    oled.fill(0)
    oled.text("Hola perro", 5, 8)
    oled.text("2022", 5, 18)
    oled.show()


    and error:

    Traceback (most recent call last):
    File "<stdin>", line 12, in <module>
    File "ssd1306.py", line 118, in __init__
    File "ssd1306.py", line 37, in __init__
    File "ssd1306.py", line 74, in init_display
    File "ssd1306.py", line 123, in write_cmd
    OSError: [Errno 110] ETIMEDOUT


    And if I add print(i2c.scan()) to my program it shows me this:

    >>> print(i2c.scan())
    []

    Continue reading...

Compartilhe esta Página