Coder Social home page Coder Social logo

thrull / pihole-luma-oled Goto Github PK

View Code? Open in Web Editor NEW

This project forked from willdurand/pihole-oled

0.0 1.0 0.0 14.45 MB

:computer: Pi-hole and system stats displayed on an OLED 0.96" screen using Luma.oled library

License: MIT License

Python 100.00%

pihole-luma-oled's Introduction

pihole-oled

Original code from willdurand/pihole-oled

Hardware

The OLED display is connected via I2C with 4 wires: SDA, SCL, 3.3V and GND. There is no reset pin. The "HAT" is made with a 8-pin female header, a piece of proto-board and short wires. There is nothing fancy here.

Installation

โš ๏ธ This project requires a Raspberry Pi with Pi-hole installed, the SPI bus enabled and Python 3.5.

Software requirements

If you do not have pip3 installed, start by installing it:

sudo apt-get install python3-pip

If you do not have pipenv installed, install it too:

pip3 install --user pipenv

Note: the command above keeps everything into a ~/.local directory. You can update the current user's PATH by adding the following lines into your .bashrc (or equivalent):

export PY_USER_BIN="$(python -c 'import site; print(site.USER_BASE + "/bin")')"
export PATH="$PY_USER_BIN:$PATH"

Now install a few libraries for Pillow:

sudo apt-get install python3-pil libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev libopenjp2-7 libtiff5 -y

Now install a luma.oled library Luma.oled

sudo -H pip3 install luma.oled

Project installation

Clone this project:

git clone https://github.com/thrull/pihole-oled.git /home/pi/pihole-oled

Install the python dependencies:

cd /home/pi/pihole-oled
pipenv install

If you plug the OLED display and run the command below, you should see some information on the display:

pipenv run python3 main.py

You can exit the script with ctrl+c.

Systemd configuration

You can install a systemd service by copying the provided configuration file using the command below. This service will automatically run the python script mentioned in the previous section on boot:

sudo cp pihole-oled.service /etc/systemd/user/

Enable, then start the pihole-oled.service:

sudo systemctl enable /etc/systemd/user/pihole-oled.service
sudo systemctl start pihole-oled.service

Dev corner

This sections is only relevant if you intent to work on this project.

We use conda to ship a (hopefully) reproducible environment to work on this project. Start by installing conda, then create the environment for this project:

conda env create -f environment.yml

Do not forget to enable this environment:

conda activate

You should have python3 (3.5) and pipenv available now.

License

This project is released under the MIT License. See the bundled LICENSE file for details.

pihole-luma-oled's People

Contributors

willdurand avatar thrull avatar dependabot[bot] avatar

Watchers

James Cloos 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.