Skip to content

💻 Pi-hole and system stats displayed on an OLED 0.96" (ssd1306) screen.

License

Notifications You must be signed in to change notification settings

Maschine2501/PiHole-UI

 
 

Repository files navigation

PiHole-UI(for Raspberry Pi Zero)


This is a fork from: pihole-oled

I faced installation-problems with the original code, so I forked it, and changed the code.

What is "new" in this code?

  • skipped addafruit module -> use "luma.oled"

To-Do / Plans for new Features:

Hardware


The OLED display is connected via I2C with 4 wires: SDA, SCL, 3.3V and GND.

PiHole V1

PiHole V2

PiHole V2

Information:


This project requires:

  • a Raspberry Pi Zero (or 3/4 with wifi -> "wlan0" is used in the code, not "eth0")
  • An 0.96" Oled (ssd1306) with i2c
  • Raspbian Buster Lite Image

Make an SD-Card with an "Raspbian Buster Lite" Image ready:


1st - Download Raspbian Buster LITE Image:

Raspbian Images

2nd - flash it to the SD-Card:

Use "Win32Diskimager"

3rd - Go to the "root" folder of the SD Card

  • Open "config.txt" -> remove the "#" before "dtparam=spi=on" to activate SPI -> add "dtparam=i2c_vc=on" for second display/i2c bus

  • make a new textfile called "ssh" -> no .txt at the end!

  • Make a new textfile called "wpa_supplicant.conf" -> put this text in it, and edit it for your case:

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="NETWORK-NAME"
    psk="NETWORK-PASSWORD"
}

4th - remove SD Card

put SD-Card in your Pi Zero and let it boot (takes a few minutes)

5th - Connect to the Pi Zero with SSH

Use Putty/Kitty (User: pi / PW: raspberry)

1st: Configure your PiZero:


sudo apt-get update

sudo dpkg-reconfigure tzdata

-> Select your Timezone

sudo raspi-config

-> 5 Interfacing Options -> P5 I2C -> enable i2c

2nd: Install PiHole


curl -sSL https://install.pi-hole.net | bash

-> follow the setup... -> note the password in the last step!

3rd: Install the dependencies:


sudo apt-get install -y python3-dev python3-setuptools python3-pip libfreetype6-dev libjpeg-dev build-essential python-rpi.gpio python3-rpi.gpio libopenjp2-7 libopenjp2-7-dev libtiff5 libcurl4-openssl-dev libssl-dev git 

sudo pip3 install -U pip

sudo pip3 install -U setuptools

sudo pip3 install humanize

sudo pip3 install psutil

sudo pip3 install luma.oled

4th: Install pihole-oled


git clone https://github.com/Maschine2501/PiHole-UI.git /home/pi/PiHole-UI
cd PiHole-UI

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

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

sudo systemctl start pihole-oled.service

sudo reboot

Nightly Build installation:


follow the installation steps above, until you finished step 3.

After Step 3 continue with this:

sudo pip3 install fritzconnection

git clone https://github.com/Maschine2501/PiHole-UI.git /home/pi/PiHole-UI

cd PiHole-UI

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

sudo systemctl enable /etc/systemd/user/pihole-nightly.service

sudo systemctl start pihole-nightly.service

sudo reboot

Dual-Screen installation:


Pi Zero:

follow the installation steps above, until you finished step 3.

After Step 3 continue with this:

sudo pip3 install fritzconnection

git clone https://github.com/Maschine2501/PiHole-UI.git /home/pi/PiHole-UI

cd PiHole-UI

sudo cp pihole-dual-z.service /etc/systemd/user/

sudo systemctl enable /etc/systemd/user/pihole-dual-z.service

sudo systemctl start pihole-dual-z.service

sudo reboot

Pi 2/3/4:

follow the installation steps above, until you finished step 3.

After Step 3 continue with this:

sudo pip3 install fritzconnection

git clone https://github.com/Maschine2501/PiHole-UI.git /home/pi/PiHole-UI

cd PiHole-UI

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

sudo systemctl enable /etc/systemd/user/pihole-dual.service

sudo systemctl start pihole-dual.service

sudo reboot

Pi 2/3/4 Testfile:

follow the installation steps above, until you finished step 3.

After Step 3 continue with this:

sudo pip3 install fritzconnection

sudo pip3 install gpiozero

git clone https://github.com/Maschine2501/PiHole-UI.git /home/pi/PiHole-UI

cd PiHole-UI

sudo cp dual-test.service /etc/systemd/user/

sudo systemctl enable /etc/systemd/user/dual-test.service

sudo systemctl start dual-test.service

sudo reboot

If something is wrong:


check the journal!

stable:

sudo journalctl -fu pihole-oled.service

nightly:

sudo journalctl -fu pihole-nightly.service

dual-screen:

  • Pi Zero:
sudo journalctl -fu pihole-dual-z.service
  • Pi 2/3/4:
sudo journalctl -fu pihole-dual-z.service

About

💻 Pi-hole and system stats displayed on an OLED 0.96" (ssd1306) screen.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%