Giter Site home page Giter Site logo

oled_stats's Introduction

OLED Stats

OLED Stats Display Script For Raspberry Pi

Full setup instructions available on my blog - https://www.the-diy-life.com/add-an-oled-stats-display-to-raspberry-pi-os-bullseye/ Or my Youtube Channel - https://youtu.be/lRTQ0NsXMuw

The script is pre-configured for 128x64 I2C OLED Display, but can easily be modified to run on a 128x32 I2C OLED Display

Screenshots:

stats.py monitor.py

Installation Steps:

  1. Connect GND, VCC(3.3v), SCL, & SDA ports of the display according to the picture shown below:

  1. Upgrade your Raspberry Pi firmware and reboot:
    $ sudo apt-get update
    $ sudo apt-get full-upgrade
    $ sudo reboot
  1. Install python3-pip & upgrade the setuptools
    $ sudo apt-get install python3-pip
    $ sudo pip3 install --upgrade setuptools
  1. Next, we’re going to install the Adafruit CircuitPython library using the following commands:
    $ cd ~
    $ sudo pip3 install --upgrade adafruit-python-shell
    $ sudo reboot

    $ wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/raspi-blinka.py
    $ sudo python3 raspi-blinka.py
  1. Check the I2C status using the command:
    $ sudo i2cdetect -y 1

        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: -- -- -- -- -- -- -- --
  1. Next, we need to install the CircuitPython libraries specific to the display. Start by entering the following commands:
    $ sudo pip3 install adafruit-circuitpython-ssd1306
    $ sudo pip3 install psutil
    $ sudo reboot
    $ sudo apt-get install python3-pil
  1. Now we need to download the python script from out github:
    $ git clone https://github.com/mklements/OLED_Stats.git

    $ cd OLED_Stats
    $ cp PixelOperator.ttf ~/PixelOperator.ttf
    $ cp stats.py ~/stats.py
    
    $ cp psutilstats.py ~/psutilstats.py
    
    $ cp lineawesome-webfont.ttf ~/lineawesome-webfont.ttf
    $ cp monitor.py ~/monitor.py
  1. For activating the crontab follow the procedure:
    $ crontab -e

Add this at the bottom:

Remember to change your username (pi below) if you're not using the default username

    @reboot python3 /home/pi/stats.py &

    OR
    
    @reboot python3 /home/pi/psutilstats.py &
    
    OR

    @reboot python3 /home/pi/monitor.py &
  1. At the end DELETE the OLED_Stats folder and reboot
    $ sudo rm -rf OLED_Stats
    $ sudo reboot

Display Issues:

If your display shows jumbled pixels/symbols instead of actual text - you may have a display which supports the SH1106 driver instead of more common SSD1306 driver. This script ONLY works for SSD1306 displays. If you have this issue, follow this guide instead: https://www.youtube.com/watch?v=LdOKXUDw2NY

THE END

oled_stats's People

Contributors

mklements avatar md-siam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.