This script in this repository allows for displaying how many DNS requests are being blocked on your PiHole in the form of a percentage on your Rainbow HAT.
For this repository, you will need to download the following dependencies via pip3
.
Example syntax: pip3 install <package>
Packages:
PiHole-api
rainbowhat
As of a recent commit, a dedicated configuration file has been made for an easy updating process for when updates have been made for this script.
Please edit configuration.py
and edit accordingly.
# IP of where the Pi-hole panel runs.
server_ip = "127.0.0.1"
# Password - not the API token!
server_password = "your_password_here"
# Number of seconds before the Rainbow HAT updates.
update_frequency = 10
If you choose to, you can manually invoke the script by running it via python3
.
python3 ./pihole_stat_rainbow_hat.py
From time to time I may choose to update the scripts to add more features.
You can update local version of your project by running git pull
in the directory of the cloned repository to pull the latest changes while keeping your configuration.
A command has been made to make this process easy and dynamically find PATH variables for your environment.
Run the following command to create a service on your Raspberry Pi.
bash create-service.sh
Service files are created in the following path: /etc/systemd/system/
Please run the following command to delete the service from your Raspberry Pi so you can safely delete the repository without causing conflicts.
rm /etc/systemd/service/pihole-stat-rainbow-hat.service
Run this command to start the service manually after creating the service.
systemctl start pihole-stat-rainbow-hat
If you would like the script to automatically start when your Raspberry Pi turns on, run the following command:
systemctl enable pihole-stat-rainbow-hat
systemctl disable pihole-stat-rainbow-hat
- Edit
/boot/config.txt
- Uncomment
dtparam=i2c_arm=on
- Reboot.