Jump to content

OrangePi5 OLEDStats


allatutti

Recommended Posts

If someone is interested can easy setup OledStats for OrangePi5 and SSD1306

 

Hardware:
Orangepi5
SSD1306 OLED display

Software
Armbian Jammy KDE Neon 6.1.43
Files attached in ZIP archive
device.py

PixelOperator.ttf
setup.py
stats.py


How to:

1) add overlay

wget https://raw.githubusercontent.com/orangepi-xunlong/linux-orangepi/orange-pi-5.10-rk3588/arch/arm64/boot/dts/rockchip/overlay/rk3588-i2c5-m3.dts
sudo armbian-add-overlay rk3588-i2c5-m3.dts
reboot


2) connect OLED display to I2C5 M3 Pins SDA + SCL (pins 1(VCC),2(SDA),3(SCL) and 5(GND))
check connection

sudo i2cdetect -y 5

must be detected 3c value

 

3) install needed libs
 

sudo apt-get install i2c-tools python3-smbus python3-pip python3-dev python3-pil


4) download main karabek project

git clone https://github.com/karabek/OrangePi-OLED
cd OrangePi-OLED

rename old setup.py

mv setup.py setup_old.py

 

4) create new setup.py or copy from ZIP archive

nano setup.py
#!/usr/bin/env python

from setuptools import setup

setup(
    name="ssd1306",
    version="0.1.0",
    author="Richard Hull",
    author_email="richard.hull@destructuring-bind.org",
    description="A small library to drive an OLED device with either SSD1306 or SH1106 chipset",
    license="MIT",
    keywords="raspberry pi rpi oled ssd1306 sh1106",
    url="https://github.com/rm-hull/ssd1306",
    packages=['oled'],
)

 

5) Start setup.py

sudo python3 setup.py sdist


6) copy generated folders to python3 dist packages
 

sudo cp -r OrangePi-OLED/oled/ /usr/local/lib/python3.10/dist-packages/
sudo cp -r OrangePi-OLED/ssd1306.egg-info/ /usr/local/lib/python3.10/dist-packages/

 

7) replace device.py file with file in ZIP archive in dist-packages oled folder

cd /usr/local/lib/python3.10/dist-packages/oled
mv device.py device_old.py

 

9) copy stats.py and font file PixelOperator.ttf from ZIP archive


start stats.py file

sudo python3 stats.py


result should be same as on RPI device
picture


 

Orangepi5_OLED.zip

Link to comment
Share on other sites

Posted (edited)

"OLED stats working also in debian, you need to activate I2C5 M3 overlay in orangepi-config"

 

By doing above, do you still need to execute point #1 (add overlay) from original instructions?

 

 

Edited by habro
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines