Closed BerkSmash1984 closed 8 months ago
Hi @BerkSmash1984, can you see a request to your Pi-Hole instance in the network logs? If so, what does the response look like?
The Pi-Hole API returns responses as application/json
, perhaps it is not loading. Also, the apiURL
should contain the port if it is not the default 80
for http.
The Pi-hole is actually running on the same device as the MagicMirror (my RPI 4B) and is using standard port 80 for http traffic.
Dev mode on the browser is not showing anything revealing. Which network logs did you want me to check, specifically? Pi-hole itself is not showing anything, but again, it is talking to itself since it is all on the same device.
Can you see the HTTP response from the pihole requests in the network console?
Appreciate your responses. I'll check in the morning via the network dev console and get back to you, but it doesn't prevent my MagicMirror from loading, it's just the pihole stats module never loads.
I just checked the Network tab in the Dev console but not seeing any requests related to the pi-hole stats module:
I am seeing the same thing (i.e. stuck on "Loading.")
My Magic Mirror logs shows " [ERROR] MMM-pihole-stats: TypeError: fetch failed"
Hi, are you running the latest version of this module and magicmirror?
Hi, just installed a new MM and this module today and can confirm this loading stuck issue.
Thanks for a fix in advance =)
I think I found the issue/solution.
First, background:
I first tried creating an API token, which also required establishing a password. Did both of these, no change.
I then noted that the apiURL wasn't working, as it wasn't picking up the correct port. (I previously had a "port: " configuration in my MM config file, but now see that option is not listed in the current module configuration options.)
I added the port to by apiURL (http://192.168.1.1:808/admin/api.php) and rebooted MM.
Everything now is back to working. And works with and without API and/or password.
@robklingler the port config was indeed removed recently. Will add it to the readme too.
Hi, the port was not the solution for my setup although I changed it too.
I got it working meanwhile by changing the apiURL to the IP-address instead of the pi.hole url:
apiURL: "http://192.168.1.15/admin/api.php"
Now it shows the data.
Thanks and kind regards =)
(And thank you for removing the dependency on fetch, which through an error every time I updated the MM container. I knew how to fix it, but it required manual steps, and ultimately caused me not to regularly update the MM container.)
The README has been updated to highlight the removal of the port
config option in #38 . Thanks all for raising this issue.
Maybe update the code snippet showing the port in the apiURL config so it is clear. Right now the code doesn’t show absolute URL; it doesn’t have the port.
Respectfully,
Jordan Berkebile
On Sun, Mar 10, 2024 at 6:53 PM Sheya Bernstein @.***> wrote:
The README has been updated to highlight the removal of the port config option in #38 https://github.com/sheyabernstein/MMM-pihole-stats/pull/38 . Thanks all for raising this issue.
— Reply to this email directly, view it on GitHub https://github.com/sheyabernstein/MMM-pihole-stats/issues/35#issuecomment-1987390919, or unsubscribe https://github.com/notifications/unsubscribe-auth/AY6X2WJKCLBWHNU2QOPAPVTYXTP5NAVCNFSM6AAAAABD6WT2B6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBXGM4TAOJRHE . You are receiving this because you were mentioned.Message ID: @.***>
@sheyabernstein This still is not working for me, even with absolute URL
Yes, I am using latest MM and latest module (just downloaded it this AM to retest.
In the logs, it is still showing this:
@BerkSmash1984 please verify that you can ping the Pi-hole URL from the MagicMirror devtools.
@sheyabernstein the MM and Pihole are running on the same device, a Raspberry Pi 4.
@BerkSmash1984 the apiURL
in your config is not pointing to the Pi-hole API. Please check your config.
@sheyabernstein it 100% is pointing to the correct URL. It doesn't matter if I use IP or actual URL, with port 80 specified, or without
Directly from my RPI4:
MM config:
^^^ I tried all possible configs...
Still stuck on loading
The url in your screenshots point to the admin/dashboard page at /admin/index.php
and the login page at /admin/login.php
. Your url should end with admin/api.php
for the API as defined in the readme.
This is also why you are seeing Expected JSON but received text/html
in your errors. The url was pointing to a path that returns HTML.
Please open a new issue if you continue to have any trouble.
Ah let me take another look I must have missed that somehow, and will do. Thanks!
@sheyabernstein appreciate you handing in there with me! That was in fact the issue and the module is now working:
Thanks again!
Just installed this module fresh, but it is stuck on loading:
Here is my config:
Here is what I am seeing in the logs:
Any thoughts?