-
-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems with PiOLED and PiTFT since the last update #2467
Comments
This is caused by #2411 see also our announcement in November about this upcoming change: https://pi-hole.net/blog/2022/11/17/upcoming-changes-authentication-for-more-api-endpoints-required/ There you can also find a description how to fix your scripts. |
Thank you for the info. Since another Pi-hole with TFT and PADD does not show any problems in this regard, I can assume that the necessary adjustments have already been made to padd.sh? |
PADD does not query the web API, but directly FTL's telnet API. |
Ok, Thanks. Since I don't feel able to make these adjustments in the Python script due to a lack of programming knowledge, I have to see if I can find help. |
The python scripts you are using has As mentioned in the blog post, if there is a line like api_url = "http://pi.hole/admin/api.php?status" somewhere, you will only have to change this to api_url = "http://pi.hole/admin/api.php?status&auth=abcdef123456789" where you can get the actual token ( |
It doesn't seem to be that difficult normally, but... Here are a few lines that might apply: -# Import Python Imaging Library api_url = 'http://localhost/admin/api.php' If I replace this line with api_url = 'http://localhost/admin/api.php?status&auth=abcdef123456789' then unfortunately it still doesn't work. |
Can you access the data if you open the URL in your bowser (if you are not logged-in the web dashboard)? |
Yes, data is displayed. For output I used the browser on my PC. JSON If I enter http://10.0.0.XXX/admin/api.php?status&auth=abcdef123456789 with an active password then only appears JSON |
Sorry, the confusion comes from that you called api_url = 'http://localhost/admin/api.php?auth=abcdef123456789' (as before with added or api_url = 'http://localhost/admin/api.php?summary&auth=abcdef123456789' (being fully explicit). Both should return identical information. |
api_url = 'http://localhost/admin/api.php?summary&auth=abcdef123456789' was the solution! That's how it works. |
I now have the same problem with accessing the api_url with an RPi Zero W and an e-Paper Display. The e-paper is addressed using the pihole-dashboard. I temporarily disabled the password and it works so far, it is of course better with an activated password.
Both of the variants shown here do not work that way. I also contacted the developer at |
It should be something like def update():
url = "http://127.0.0.1:{}/admin/api.php?summaryRaw&auth=abcdef123456789".format(PIHOLE_PORT)
r = json.load(urllib.request.urlopen(url)) but this isn't the best way of doing this (the password hash should be a variable as well). |
I think this should work (untested - I usually don't work with Python):
|
Hello I also updated and was unable to view anything on the e-ink screen so I went through and attempted to follow the changed made by the posts above by adding the necessary token keys into the stats script but now for some reason I get this error update: a friend of mine said that changing line 67 any help is much appreciated also if I am posting in the wrong section my apologies I just found this as the most relevant |
Your error is happening on a third party app, not developed by Pi-hole. If none of the above suggestions work for you, please ask your question to the app developers. |
Sorry I haven't responded to your tips yet, but this pi-hole isn't on site. But I think I'll test it this week. |
I have now entered everything as described,
|
As I said, this was not tested. Also note: this is an external app. |
Hello,
since the last update, the displays of 2 Pi-hole with PiOLED and PiTFT are black.
Pi-hole data is no longer displayed.
I set up both displays a while ago following the instructions below:
https://learn.adafruit.com/pi-hole-ad-blocker-with-pi-zero-w/install-pioled
https://learn.adafruit.com/pi-hole-ad-blocker-with-pi-zero-w/install-mini-pitft
If I run the command sudo python3 stats.py once on the Pi-hole with PiTFT I get the following output:
root@pihole-backup-I:/home/dietpi# sudo python3 stats.py
Traceback (most recent call last):
File "stats.py", line 109, in
DNSQUERIES = data['dns_queries_today']
TypeError: list indices must be integers or slices, not str
and on the Pi-Hole with PiOLED I get the following output:
root@pihole-backup-II:~# sudo python3 stats.py
Traceback (most recent call last):
File "/root/stats.py", line 96, in
DNSQUERIES = data['dns_queries_today']
TypeError: list indices must be integers or slices, not str
Excerpts from both relevant lines of the respective stats.py:
PiTFT stats.py
PiOLED stats.py
Can the error be due to the changes in Pi-hole FTL?
The text was updated successfully, but these errors were encountered: