OSError: [Errno 110] ETIMEDOUT using Raspberry Pi Pico on Thonny

3,480 views
Skip to first unread message

Ken

unread,
May 30, 2023, 11:17:48 PM5/30/23
to thonny
So I tried to code a Raspberry Pi Pico to use an Ultrasonic sensor and display distance on an ssd1306 display (128x64) but I keep getting this error in my code for some reason:

Traceback (most recent call last):
  File "<stdin>", line 9, 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

For sake of saving space I saved the code (two files) onto a google drive link:

The code started to not work when I tried to install the micropython-ssd1306 module on PyPI but got an error. So it may be an issue on Thonny, but I don't know. Please someone let me know how to fix this!

Andy Piper

unread,
May 31, 2023, 5:59:39 AM5/31/23
to Ken, thonny
The clue here may be that the ssd1306 driver is getting stuck in init_display, which is using the I2C settings you’re passing in from your main code. Is it connected to pins 16 and 17 on the Pico? There’s not really enough information here to help. 

What happens if you run i2c.scan() when the display is connected?

--
You received this message because you are subscribed to the Google Groups "thonny" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thonny+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/thonny/b509408d-ed91-4faa-8798-7d80ce7d7bf7n%40googlegroups.com.


--
Andy Piper | Kingston upon Thames, London (UK)
links: https://andypiper.me  | fediverse: @andy...@macaw.social 

Ken

unread,
May 31, 2023, 10:42:48 PM5/31/23
to thonny
I did need to reconnect a few wires to their respective pins, I think I got some numbers mixed up but I got that fixed up. 
However, I got a similar error code even with the wires reconnected:

Traceback (most recent call last):
  File "<stdin>", line 9, 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 5] EIO

When I try using the i2c.scan() command it just brings up brackets like this: [ ]

Just for clarity here are some pictures of my project after I reconnected stuff in the form of a link.

Reply all
Reply to author
Forward
0 new messages