Page 1 of 1

[pyboard clone] SSD1306 - TypeError: object with buffer protocol required

Posted: Sun Mar 24, 2019 7:00 pm
by douggilliland
I'm trying to get an SSD1306 working with a clone of the pyboard. I did search the forum and found a couple of other complaints about the same issue but didn't follow the solutions they offered there.

Code is pretty simple:

import machine, ssd1306
i2c = machine.I2C(1)
oled = ssd1306.SSD1306_I2C(128, 64, i2c, 60)
oled.fill(0)
oled.text("Hello World", 0, 0)
oled.show()

Getting back error message:

>>> import ssdTest
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "ssdTest.py", line 3, in <module>
TypeError: object with buffer protocol required

I2C scan shows:

>>> import machine
>>> i2c=machine.I2C(1)
>>> i2c.scan()
[33, 60]

The 33 is a MCP23008 I2C port expander and the 60 is the OLED display so I'm pretty sure the I2C is connected. I do talked to an MCP23008 on the connection earlier today.

The offending line seems to be:

oled = ssd1306.SSD1306_I2C(128, 64, i2c, 60)

Using ssd1306.py library and the initializer for the function looks like:

class SSD1306_I2C(SSD1306):
def __init__(self, width, height, i2c, addr=0x3c, external_vcc=False):
...

>>> sys.version
'3.4.0'

>>> sys.platform
'pyboard'

Any help is appreciated. Thanks!

Re: [pyboard clone] SSD1306 - TypeError: object with buffer protocol required

Posted: Sat Jun 15, 2019 12:43 pm
by brian park
same here. did you fix this problem?

Re: [pyboard clone] SSD1306 - TypeError: object with buffer protocol required

Posted: Sat Jun 15, 2019 1:16 pm
by jimmo
douggilliland wrote:
Sun Mar 24, 2019 7:00 pm
>>> sys.version
'3.4.0'
This is the Python version, could you please also let us know the MicroPython version? sys.implementation
brian park wrote:
Sat Jun 15, 2019 12:43 pm
same here. did you fix this problem?
Could you check the same please?

If you're using the latest version of ssd1306.py, you'll need to be running MicroPython v1.11. https://micropython.org/downloads