I2C OLED display library for C.H.I.P


Working with I2C on CHIP, I wrote a user-space Linux library and basic demo for a small 128x64 pixel OLED module that is made by HelTec and that utilises the SSD1306 controller.

Here is the github repo: https://github.com/vkomenda/ssd1306

Some images showing how to connect the display to CHIP:


OLED (128 x 64) with nodejs / johnny five / chip-io

Hi vkomenda,

Very nice, this small OLED screens can be bought cheaply and it can be very useful for embedded interfaces. Another solution for larger screens (LCD or OLED) is : https://github.com/notro/fbtft/wiki which work through SPI. I’m not sure about the state of DMA SPI on the CHIP. Did anybody made test on latency and throughput of SPI drivers ?



Sure, it would be interesting to try SPI. SPI2 pins are 27-30 on the U14 header. By default, these pins are probably assigned to CSI in the device tree. If so, sun5i-r8-chip.dtb should be changed and recompiled (no recompilation of the kernel or modules necessary). This would enable those pins for SPI peripherals.


really nice one! Looks like I have the same OLED flying around here! definitely will use this for testing! :slight_smile: thx


I hacked together a horrible shell-script based solution for bit-banging one of these displays in SPI mode via GPIOs: https://github.com/pib/gpio_ssd1306 (warning: it takes about 5 seconds to redraw the entire display using this method)

There’s actually now a kernel module with built-in framebuffer support for these displays in SPI mode as well: https://github.com/notro/fbtft (it’s in the staging tree, which means it will require a custom kernel compile to get up and running)

I haven’t spent the time to re-wire and figure out the proper configuration to get that working yet, though.


Can I ask how you handled the reset pin? I have the Adafruit version of this and it only shows random pixels until I manually pulled reset low momentarily.


Using a resistor and capacitor, you can make a power on reset for these. The capacitor keeps the reset pin low until the resistor can charge it up. It’s probably built into the module.


Thanks! I wired up a GPIO in the meantime which I toggle before doing anything else. It did the trick.


I have a similar display however i cannot find the step by step installation of this. I’ve tried installing libraries every thing and seem’s that I dont it wrong. no display on my OLED. Can anyone post the instruction for no novice like me. thanks in advance.


You need to:
apt-get install libglib2.0-dev
git clone https://github.com/vkomenda/ssd1306.git
cd ssd1306/
./ssd1306_demo /dev/i2c-2

In this case " /dev/i2c-2" is the SPI device (because I connected it to the second SPI).

Does anybody know a Python implementation for this?