• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Library error while using ssd1306

Q&A Forum › Category: Raspberry Pi › Library error while using ssd1306
0 Vote Up Vote Down
Renaud Richard asked 4 days ago

Hi,
First, as I already said, kudos for all your thorough work.
Now:
While trying your ssd1306 & RTC file I get:
File “<stdin>”, line 19, in <module>
File “ssd1306.py”, line 110, in __init__
File “ssd1306.py”, line 36, in __init__
File “ssd1306.py”, line 71, in init_display
File “ssd1306.py”, line 115, in write_cmd
I thought I correctly loaded ssd1306.py on the Pico.
I tried again by downloading a fresh ssd1306.py from another web source to no avail.
I’m sure the error is on my side. Any help will be appreciated.
Renaud

Question Tags: ssd1306.py library
4 Answers
0 Vote Up Vote Down
Renaud Richard answered 4 days ago

Just saw that the ssd1306.py file is 4585 octets on the Pico.

0 Vote Up Vote Down
Renaud Richard answered 4 days ago

And would that size be correct?

0 Vote Up Vote Down
Sara Santos Staff answered 3 days ago

Hi.
Can you tell me exactly what’s the project you’re following?
 
How are you uploading the files to the Pico?
 
Regards,
Sara

0 Vote Up Vote Down
Renaud Richard answered 2 days ago

Hi Sara,
Yes, of course, thanks.
I need RTC for a project so I tried this I get from your book I bought (which btw is excellent!) on a Pico2W with Thonny :
import time
import urtc
from machine import SoftI2C, Pin
import ssd1306
days_of_week = [‘Monday’, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’, ‘Saturday’, ‘Sunday’]
#Initialize RTC Module
i2c_rtc = SoftI2C(scl=Pin(5), sda=Pin(4))
rtc = urtc.DS1307(i2c_rtc)
# Initialize OLED
oled_width = 128
oled_height = 64
i2c_oled = SoftI2C(scl=Pin(7), sda=Pin(6))
oled = ssd1306.SSD1306_I2C(oled_width, oled_height, i2c_oled, addr=0x3c)
This gets:
Traceback (most recent call last):
File “<stdin>”, line 19, in <module>
File “ssd1306.py”, line 110, in __init__
File “ssd1306.py”, line 36, in __init__
File “ssd1306.py”, line 71, in init_display
File “ssd1306.py”, line 115, in write_cmd
OSError: [Errno 19] ENODEV
So, I tried to load another ssd1306 from another site but got the same.
Also I tried  scanning I2C bus:
on SDA=GP4, SCL=GP5… I2C devices found on 0x50 and 0x68
so the cabling is correct and anyway this error is certainly independent of the hardware as I tried it on another Pico without RTC or Oled and got the same errors.
To load the library I load the ssd1306.py file on Thonny and save it on the Pico. As I said it is indeed there  at 4585 octets.
Best,
Renaud
 

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Smart Home with Raspberry Pi, ESP32, and ESP8266 V1.6 September 9, 2025
  • [eBook Updated] Learn LVGL: Build GUIs for ESP32 Projects – Version 1.5 July 7, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.