OLED display of pi-hole stats stopped after 5.14.2 update

Please follow the below template, it will help us to help you!

Expected Behaviour:

I created a pi-hole following the instructions from Adafruit with an OLED to display basic stats. Overview | Pi Hole Ad Blocker with Pi Zero W | Adafruit Learning System.

Actual Behaviour:

This worked perfectly for 18 months - however the OLED display has stopped working - I get an error in the stats.py file. Looks like something may have changed with the latest release in terms of the data that is being accessed for the display.

Debug Token:

Traceback (most recent call last):
File "/home/pi/Pi-hole/Display/stats.py", line 117, in
DNSQUERIES = data['dns_queries_today']
TypeError: list indices must be integers or slices, not str

Hope you can help

Pi-hole doesn't use Python files.
This is a third party app. You need to contact the developers of the app.


If you know python, you can try to fix it.

This python code uses the Pi-hole API to get the information, but the current API doesn't allow to connect without authentication. You need to use an authorization token.

Find the line containing api_url and replace it with:

api_url = 'http://localhost/admin/api.php?summaryRaw&token=XXXXXXXXXX'

You need to replace the "XXXXXXXXXX" with your token.
You can find the token on Pi-hole web interface Settings page, tab API / Web interface. Click on the button Show API Token.

2 Likes

Thanks for the suggestion - I made the change adding the API token - all working again

It seems the Adafruit people got the heads up about Pi-hole's recent API authentication changes and updated their solution, see Install PiOLED | Pi Hole Ad Blocker with Pi Zero W | Adafruit Learning System. :slight_smile:

1 Like

I did contact Adafruit also - and yes I saw yesterday when I was makiong the change that they had updated the instructions - great to see the process works!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.