motionEyeOS (PINE A64(+)) 20170611 [Jun 16] | Ubuntu Images (Pinebook) 0.5.5-65 [Jun 15] | Ubuntu Minimal (PINE A64(+)) 0.5.5-65 [Jun 15] | Q4OS (Pinebook) 1805 [Jun 12] | Android 6.0.1 (Pinebook) 20170605 [Jun 5] | Win10 IoT (PINE A64(+)) 10.0.15063.0_20170602 [Jun 5] | FalconGate (PINE A64(+)) 20170430 [May 31] | Q4OS (PINE A64(+)) 1804 [May 30] | Armbian - Ubuntu (SOPINE) 5.27 [May 22]

Getting Started | Visit the WIKI | IRC Logs | Forum Rules/Policy


PINE64 + mini OLED display + Luma.OLED = PINEimus Prime
#1
First there was CHIPtimus Prime for the CHIP SBC. Then came ODROIDtimus Prime for the ODROID C series. Now there's PINEimus Prime for the PINE64. This will work for I2C displays only at this point. I wasn't able to get SPI fired up with legacy or mainline Armbian.

[Image: Ih2xMbN822pkac4EwGeqh8KhrUojySMvKs4uNi37...6-h1134-no]

Transform your PINE64 into a PINEimus Prime for projects requiring a small OLED display. Luma.OLED makes it easy to do text, graphics and video. Both displays I used to test I bought on Amazon. I already ordered some cheaper ones on EBay. I was able to get 3 SSD1306 I2C displays for under $10! I also ordered some TFT displays as well to test.

Requirements
Do the following for I2C version of SSD1306
The 4 wire DIY display can be powered by 3.3V or 5V which makes it handy if you need the other power source for something else. Wire mapping using i2c-0 (twi0):

Code:
VCC to VCC 5V   (pin 4)
GND to GND      (pin 6)
SCL to I2C1 SCL (pin 5)
SDA to I2C1 SDA (pin 3)

Configure I2C
  • Power off PINE64, wire up display and power on
  • sudo apt-get install i2c-tools
  • sudo usermod -a -G i2c username
Test I2C and display
  • i2cdetect -l
Code:
i2c-0    i2c           twi0                                I2C adapter
i2c-1    i2c           twi1                                I2C adapter
  • i2cdetect -y 1

Code:
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --


Time to install Luma.OLED

Code:
sudo apt-get install python-dev python-pip libfreetype6-dev libjpeg-dev
sudo -H pip install --upgrade pip setuptools
sudo -H pip install --upgrade luma.oled


I2C hello world
  • cd
  • nano i2chello.py
Code:
import time
from luma.core.serial import i2c
from luma.core.render import canvas
from luma.oled.device import ssd1306

serial = i2c(port=1, address=0x3C)
device = ssd1306(serial)

with canvas(device) as draw:
    draw.rectangle(device.bounding_box, outline="white")
    draw.text((3, 3), "Hello", fill="white")

time.sleep(10)

  • python i2chello.py
Then install examples

Code:
cd
sudo apt-get install git-core libsdl-dev libportmidi-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev libsdl-image1.2-dev
git clone https://github.com/rm-hull/luma.examples.git
cd luma.examples
sudo -H pip install -e .

Run example on I2C display

Code:
cd
cd luma.examples
python examples/invaders.py -d ssd1306 --i2c-port 1 --i2c-address 0x3c
Reply
#2
Thanks for the tutorial, I may have a project that requires a small display...
Come have a chat in the Pine A64 IRC channel >>
Reply
#3
(04-20-2017, 04:48 AM)xalius Wrote: Thanks for the tutorial, I may have a project that requires a small display...

Now if I can only get SPI/GPIO working I could get the SPI displays fired up. I just got SPI/GPIO configured on the ODROID C1 using a RPi.GPIO replacement module. I need something similar for PINE64.
Reply
#4
there is a rpi-gpio for pine64 around. at least there was a while back. https://github.com/swkim01/RPi.GPIO-PineA64 i think there were some issues with this in getting it to work as expected. it does not appear to be under active development currently.
Reply
#5
Yea, I looked around, but without a stable GPIO module it's impossible to get Luma.OLED working. I have it working on CHIP and ODROID C1 with the mono display, but the RGB SSD1331 is still giving me issues. I ordered a Pi 3, so I can use that as a base test since that what most GPIO code is written for.
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Pine64 Drawing - binary & source documents ecolezen 1 14 1 hour ago
Last Post: pfeerick
Information Pine64 Head Unit Zoidiano0 97 17,211 06-12-2017, 09:19 AM
Last Post: dikov
Exclamation How-TO use a External HardDrive with a Pine64 JasperBrown 0 281 05-07-2017, 05:39 AM
Last Post: JasperBrown
  Turn your Pine64 into a music server with mpd JulianM 2 1,681 03-23-2017, 10:50 PM
Last Post: tllim
  How to setup VNC on your Pine64 (Debian, SSH, headless) pine64nutz 17 7,541 03-13-2017, 07:27 AM
Last Post: Unclean0ne
Lightbulb DIY Alexa on PINE64 antonelli 8 2,690 03-09-2017, 04:53 AM
Last Post: rookieone
  Pine64 as squeezebox touch replacement Learnincurve 4 753 02-28-2017, 06:26 AM
Last Post: Learnincurve
  Pine64 as NAS/Media Server VandaL.pr! 1 1,123 12-27-2016, 10:48 AM
Last Post: Luke
  Pine64 E-ink screen - Android projectileobjects 0 747 12-19-2016, 03:28 PM
Last Post: projectileobjects
  Pine64 as Flightaware ADS-B Monitor VAAviator 1 572 11-06-2016, 10:23 PM
Last Post: tllim

Forum Jump:


Users browsing this thread: 1 Guest(s)