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

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
douggilliland
Posts: 1
Joined: Sun Mar 24, 2019 6:34 pm

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

Post by douggilliland » Sun Mar 24, 2019 7:00 pm

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!

User avatar
brian park
Posts: 3
Joined: Wed Apr 17, 2019 4:43 am

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

Post by brian park » Sat Jun 15, 2019 12:43 pm

same here. did you fix this problem?

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

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

Post by jimmo » Sat Jun 15, 2019 1:16 pm

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

Post Reply