SSD1306 error

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
kwiley
Posts: 140
Joined: Wed May 16, 2018 5:53 pm
Contact:

SSD1306 error

Post by kwiley » Sun Apr 04, 2021 9:40 am

PyBoard running 1.14. I copied ssd1306.py from latest to the board (not from 1.14 since I can't figure out how to download files from a tag on Github without downloading the entire source as a zip). Then I tried the following and got this error:

Code: Select all

MicroPython v1.14 on 2021-02-02; PYBv1.1 with STM32F405RG
Type "help()" for more information.
>>> import machine, ssd1306
>>> i2c = machine.I2C('X')
>>> oled = ssd1306.SSD1306_I2C(128, 32, i2c, 0x3c)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "ssd1306.py", line 110, in __init__
  File "ssd1306.py", line 36, in __init__
  File "ssd1306.py", line 73, in init_display
  File "ssd1306.py", line 101, in show
  File "ssd1306.py", line 119, in write_data
TypeError: object with buffer protocol required
>>>
Line 119 is:

Code: Select all

self.i2c.writevto(self.addr, self.write_list)
The change to writevto is one of the most recent changes to this file, but it's still a few years old. I think it ought to work. What am I doing wrong?

Any thoughts?

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: SSD1306 error

Post by pythoncoder » Sun Apr 04, 2021 12:48 pm

I can't replicate this. Tested on a Pyboard 1.1 running current firmware and the current version of ssd1306.py.

This driver is definitely supported.
Peter Hinch
Index to my micropython libraries.

kwiley
Posts: 140
Joined: Wed May 16, 2018 5:53 pm
Contact:

Re: SSD1306 error

Post by kwiley » Sun Apr 04, 2021 3:37 pm

Thanks. The problem went away when I woke up this morning. This is not the first time I have found one of these kinds of devices to "settle down" over night. It doesn't make sense from my limited understanding of electronics, but whatever.

Thanks again.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: SSD1306 error

Post by pythoncoder » Mon Apr 05, 2021 9:17 am

It doesn't make sense from my lifetime's experience as an electronics design engineer either.
Peter Hinch
Index to my micropython libraries.

Post Reply