Monday, June 20, 2016

Raspberry Pi display on 128x64 I2C OLED with SSD1306, using Python


This post show how to install rm-hull/ssd1306 on Raspberry Pi, and run the example to display on 0.96" 128x64 I2C OLED with SSD1306 driver, using Python.


rm-hull/ssd1306 interfacing OLED matrix displays with the SSD1306 (or SH1106) driver in Python using I2C on the Raspberry Pi.

Before install rm-hull/ssd1306, we have to enable I2C on the Raspberry Pi.

Connect a 0.96" 128x64 I2C OLED to Raspberry Pi 2 as shown:
3V3, GND, SDA and SCL respectively.
(my OLED support both 3.3V and 5V)

Download rm-hull/ssd1306 with:
$ wget https://github.com/rm-hull/ssd1306/archive/master.zip

Install the library, switch to the unpacked download folder:
$ sudo python setup.py install

Install some packages:

$ sudo apt-get install i2c-tools python-smbus python-pip
$ sudo pip install pillow

That's, now you can try the example, refer to the video.


Remark@2017-05-07:

Somebody commented with error of:
error in luma.oled setup command : 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.

I google to found that it may be because of the version of setuptools.

Install and upgrade setuptools:
$ sudo -H pip install --upgrade pip setuptools

(reference: https://github.com/rm-hull/luma.examples/issues/44)


Related:
NodeMCU/ESP8266 + OLED 0.96" 128x64 I2C SSD1306 using esp8266-oled-ssd1306 library


Updated@2017-05-14:
The driver renamed rm-hull/luma.oled, and updated to support SSD1306 / SSD1322 / SSD1325 / SSD1331 / SH1106 OLED.

2 comments:

Unknown said...

hi everyone

need so help, i'm using raspberry 3

got problem when installing the setup.py

error as below :

error in luma.oled setup command : 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.

Erik said...

hello Norazlan K,

Thx for your comment.

Please check my Remark@2017-05-07. Please let me know if it can fix or not.

Eric