Next we're going to install PADD, the Pi-hole Ad Detection Display. This application displays statistics about advertisements, your Pi's status, network configuration and system statistics on your PiTFT.
It is written and maintained by Jim McKenna who did an awesome job!
In the SSH session with your Pi, navigate to your home directory:
cd ~
Grab a copy of PADD:
wget -N https://raw.githubusercontent.com/jpmck/PADD/master/padd.sh
Make PADD executable by running:
sudo chmod +x padd.sh
Next, we're going to set PADD to open automatically on your PiTFT when we start our Pi.
Open ~/.bashrc
:
nano ~/.bashrc
Navigate to the end of the file (by pressing the down arrow key) and add the following text:
# Run PADD # If we're on the PiTFT screen (ssh is xterm) if [ "$TERM" == "linux" ] ; then while : do ./padd.sh sleep 1 done fi
Save (control+O) the configuration and exit (control+X) nano to be brought back to the terminal.
The PiTFT is bright and doesn't need to be powered-on at night, so let's put it to sleep until we wake up.
Edit cron as root:
sudo crontab -e
Select nano as an editor by pressing the 2 key.
Scroll beneath the commented text (#) and enter the following:
# PADD Sleep # Turn off the PiTFT+ at midnight 00 00 * * * sh -c 'echo "0" > /sys/class/backlight/soc\:backlight/brightness' # Turn on the PiTFT+ at 8:00 am 00 08 * * * sh -c 'echo "1" > /sys/class/backlight/soc\:backlight/brightness'
Save (control+O) the configuration and exit (control+X) nano to be brought back to the terminal.
Reboot the Pi to apply the new changes by running:
sudo reboot
When your Pi reboots, the TFT should boot into PADD:
After PADD starts, it should go into display mode. If your PADD is displaying statistics about your network, congrats! We're all set up and ready to test our advertisement-blocking-pi.
You can also use this guide with smaller displays, like the PiTFT 2.8". The full PADD display is unsupported by this screen - but don't worry - it'll automatically display a smaller, mini PADD interface.
Text editor powered by tinymce.