Page 1 of 1

SSD1306 error

Posted: Sun Apr 04, 2021 9:40 am
by kwiley
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?

Re: SSD1306 error

Posted: Sun Apr 04, 2021 12:48 pm
by pythoncoder
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.

Re: SSD1306 error

Posted: Sun Apr 04, 2021 3:37 pm
by kwiley
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.

Re: SSD1306 error

Posted: Mon Apr 05, 2021 9:17 am
by pythoncoder
It doesn't make sense from my lifetime's experience as an electronics design engineer either.