How do I view my Pi-hole's stats over SSH or on an LCD using chronometer?

chronometer

#1

New Method

With the release of chronometer2, there’s not a whole lot you need to do for this anymore. Simply load up your screen (it can be just about any LCD screen nowadays) or SSH session, and then run pihole -c.

Old Method

Below are the original instructions specific to the Raspberry Pi, but are only here for documentation’s sake for anyone that needs it.

Want to monitor your Pi-hole’s ad-blocking performance? Using a 2.8" Adafruit screen, you can display beautiful statistics in real-time to see how much of your Internet traffic is advertisements.

Use The Adafruit Version Of Raspbian

Instead of installing the official version of Rasbpian, flash your SD card with Adafruit’s build; it comes pre-configured with everything you need for the LCD display.

Set the LCD to display the console (not the GUI)

If you used the easy image from Adafruit, you should be able to skip this step as it will already be enabled. If you installed plain old Raspbian or DietPi, you will want to follow the instructions to display the console on the touch screen.

Stop The LCD From Going Blank After 10 Minutes

Edit /boot/cmdline.txt to contain one line shown below:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait fbcon=map:10 fbcon=font:VGA12x6 consoleblank=0

The text preventing the display from sleeping is consoleblank=0.

Enable the Pi user to log in automatically

This can easily be done via raspi-config.

But if you want, there are manual instructions to enable the pi user to log in automatically.

Auto-start script

Append this line to the end of /etc/profile or ~/.bashrc:

pihole -c

this will tell your Pi to execute the script as soon as you log in. Log out/in or restart your Pi. You should see real-time stats!

Adjust Font Size

You will probably need to adjust the font size so the text fills up the screen. Enter this command:

sudo dpkg-reconfigure console-setup

Then choose the following options:

  • UTF-8
  • Guess optimal character set
  • Terminus
  • 10x20 (others will work, but this seems to fit the best)
  • utf8