after three days of looking why my ssd1306 did not work I found that reloading the pi w with 0
I had a similar problem in a raspberry pi pico with a DS3231 real time clock module and I solved it switching the microPython version to RPI_PICO-20231005-v1.21.0.uf2
the code was
from machine import Pin, I2C
from ssd1306 import SSD1306_I2C
i2c=I2C(1,sda=Pin(2), scl=Pin(3), freq=400000)
devices = i2c.scan()
print(devices)
print(devices[0])
try:
oled = SSD1306_I2C(128, 64, i2c,addr=devices[0])
oled.text("hello world", 0, 0)
oled.show()
except Exception as err:
print("eeeee")
print(f"Unable to initialize oled: {err}")
this where i found it thanks
https://stackoverflow.com/questions/76972665/oserror-errno-5-eio-when-running-my-code