BPI-R2/R3 and SSD1306 oled screen

have you tried this in 2023?

Not yet tried again because i’m busy with other things…have you tried and it does not work?

so far no dice, still at it to get this working

which point does not work? does the device show up in i2cdetect?

at least my display does show up in i2cdetect, if it does not for you make sure connection is right

for installing packages, i used these commands

apt install python3 python3-pip python3.11-venv
python3 -m venv venv
. venv/bin/activate
pip3 install luma-oled #install into venv

#next commands for creating wheel files (in a arm64 chroot) to avoid install compile-tools on router
pip install wheel #needed for RPi.GPIO
pip wheel --wheel-dir tmp luma-oled

uploaded wheel-files here on my wiki: en:bpi-r3:display [FW-WEB Wiki]

Basicly these packages can be installed with

pip install some-package.whl

There is also pip install --no-deps in combination with pip check to maybe skip install of spidev (which needs compile-tools) and maybe the rpi-gpio package

the following packages are needed: luma-oled,luma-core,pillow,cbor2,smbus2 after these installed and adding my user to i2c group i get no error, but display stays dark…have now installed all packages in my venv, but still nothing on display…need to check with another one

edit: got it solved…

https://luma-oled.readthedocs.io/en/latest/python-usage.html

says:

When a program ends, the display is automatically cleared. This means that a fast program that ends quickly may never display a visible image.

so i added this to my script (after the with block) and it shows the image

import time
time.sleep(10)

tested uninstalling the libs…

pip uninstall pyftdi pyusb spidev RPi.GPIO

and display still works :wink: so we only need luma-oled,luma-core, pyserial,smbus2,pillow,cbor2

updated my repo to now use luma

GitHub - frank-w/bpi-r2-ssd1306-display at luma

stats-luma

what pins did you connect the display to? when i run —i2cdetect -y -r 2— no display detected.

As i wrote above

1=vcc,3=sda,5=scl,6=gnd

Made picture from my 1.0 board as there it is better visible

using the below on openwrt snapshot its not detected

opkg update;opkg install --force-depends --force-reinstall python3 python3-pip python3-venv gcc python3-dev i2c-tools python3-smbus kmod-i2c-gpio kmod-usb-hid-cp2112 kmod-regmap-i2c kmod-i2c-smbus

pip install rpi-gpio --pre

python3 -m venv venv
. venv/bin/activate
pip3 install luma-oled

#next commands for creating wheel files (in a arm64 chroot) to avoid install compile-tools on router
pip install wheel #needed for RPi.GPIO
pip wheel --wheel-dir tmp luma-oled

 wget https://www.fw-web.de/dokuwiki/lib/exe/fetch.php?media=en:bpi-r3:luma-oled.tar.gz

Rpi-gpio is not needed…try pip install --no-deps

Ok,you use openwrt…maybe you need a special module there…but i2c is used for sfp too so it should be active

This looks cool, would like to do this as well. Are there any larger devices that are supported?

Afaik larger displays are mostly spi and not i2c…i have an old rpi display,but had not got it working…for basic system info this display is enough for me.

Maybe someone else try this too and get a step further

1 Like

I wonder if its the display as it cannot be detected.

https://amzn.to/47efKpx

All of those SDD1306 compatible displays should work with a kernel driver providing framebuffer like for any other GPU and display connected in more conventional ways, see https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/solomon/ssd130x-i2c.c#n67