Git Product home page Git Product logo

pi-hole-monitor's Introduction

Pi-hole Monitor

Pi-hole Monitor Pi-hole Monitor is a Wemos D1 Mini (ESP8266) with an I2C OLED display that is managed through a web interface and sits on your local network and will display statistics from your Pi-hole server.
Pi-hole Monitor Video

Features:

  • Display Pi-Hole Statistics
  • Total Blocked
  • Total Clients
  • Percentage Blocked
  • Blocked Ads Graph from the last 21.33 hours of data (only 128 lines to show 10 min incriments)
  • Option to show Top 3 Clients Blocked
  • Option to display 24 hour or AM/PM style clock
  • Sample rate is every 60 seconds
  • Fully configurable from the web interface (not required to edit Settings.h)
  • Supports OTA (loading firmware over WiFi connection on same LAN)
  • Basic Authentication to protect your settings
  • Video: https://youtu.be/niRv9SCgAPk
  • Detailed build video by Chris Riley: https://youtu.be/Rm-l1FSuJpI

Required Parts:

Note: Using the links provided here help to support these types of projects. Thank you for the support.

Wiring for the Wemos D1 Mini to the I2C SSD1306 and SSH1106 OLED

SDA -> D2
SCL -> D5
VCC -> 5V+
GND -> GND-

Pi-hole Monitor Wire Diagram

3D Printed Case by Qrome:

https://www.thingiverse.com/thing:3573903 -- new 0.96" SSD1306 OLED Display https://www.thingiverse.com/thing:2884823 -- for the 0.96" SSD1306 OLED Display
https://www.thingiverse.com/thing:2934049 -- for the 1.3" SSH1106 OLED Display

Upgrading

Once compiled and loaded you will have ability to upgrade pre-compiled firmware from a binary file. You can upload the pre-compiled binary files to your printer monitor via the web interface. From the main menu in the web interface select "Firmware Update" and follow the prompts.

  • piholemonitor.ino.d1_mini_SSD1306.bin - compiled for Wemos D1 Mini for the smaller 0.96" SSD1306 OLED (default)
  • piholemonitor.ino.d1_mini_SH1106.bin - compiled for Wemos D1 Mini for the larger 1.3" SSH1106 OLED

Compiling and Loading to Wemos D1 Mini

It is recommended to use Arduino IDE. You will need to configure Arduino IDE to work with the Wemos board and USB port and installed the required USB drivers etc.

  • USB CH340G drivers: https://sparks.gogo.co.nz/ch340.html
  • Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas. This will add support for the Wemos D1 Mini to Arduino IDE.
  • Open Boards Manager from Tools > Board menu and install esp8266 Core platform version 2.5.2
  • Select Board: "LOLIN(WEMOS) D1 R2 & mini"
  • Set 1M SPIFFS -- this project uses SPIFFS for saving and reading configuration settings. If you don't do this, you will get a blank screen after uploading. If you get a blank screen after loading -- check to see if you have 1M SPIFFS set in the Arduino IDE tools menu.

Loading Supporting Library Files in Arduino

Use the Arduino guide for details on how to installing and manage libraries https://www.arduino.cc/en/Guide/Libraries
Packages -- the following packages and libraries are used (download and install):
ESP8266WiFi.h
ESP8266WebServer.h
WiFiManager.h --> https://github.com/tzapu/WiFiManager
ESP8266mDNS.h
ArduinoOTA.h --> Arduino OTA Library
"SSD1306Wire.h" --> https://github.com/ThingPulse/esp8266-oled-ssd1306/releases/tag/4.1.0 (version 4.1.0)
"OLEDDisplayUi.h"

Initial Configuration

All settings may be managed from the Web Interface, however, you may update the Settings.h file manually only the first time loading -- but it is not required.

  • Add the address and port for your Pi-hole Server (via web interface).
  • Add the Pi-hole API Token from Pi-hole → Settings → API/Web interface.

NOTE: The settings in the Settings.h are the default settings for the first loading. After loading you will manage changes to the settings via the Web Interface. If you want to change settings again in the Settings.h, you will need to erase the file system on the Wemos or use the “Reset Settings” option in the Web Interface.

Web Interface

The Pi-hole Monitor uses the WiFiManager so when it can't find the last network it was connected to it will become a AP Hotspot -- connect to it with your phone or computer and you can then enter your WiFi connection information to get the monitor on your network.

After connected to your WiFi network it will display the IP addressed assigned to it and that can be used to open a browser to the Web Interface. Everything can be configured there.

Donate or Tip

Please do not feel obligated, but donations and tips are warmly welcomed. I have added the donation button at the request of a few people that wanted to contribute and show appreciation. Thank you, and enjoy the application and project.

paypal

Or -- you can buy me something from my Amazon Wishlist: https://www.amazon.com/hz/wishlist/ls/GINC2PHRNEY3

Contributors

David Payne -- Principal developer and architect

Contributing to this software is warmly welcomed. You can do this basically by forking from master, committing modifications and then making a pulling requests to be reviewed (follow the links above for operating guide). Detailed comments are encouraged. Adding change log and your contact into file header is encouraged. Thanks for your contribution.

Pi-hole Monitor Pi-hole Monitor Blocked Traffic
Pi=hole Monitor Screens
Pi-hole Monitor Case

pi-hole-monitor's People

Contributors

qrome avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pi-hole-monitor's Issues

Option to disable top3

Is it possible to add a true/false to the webgui for displaying the top 3 of blocked clients?

The text is very small and it almost unreadable.
42E54D34-634F-4C74-9020-08834E4030AF

Changing password

When changing the password from web interface it always sets the same value to both password/username, so if I set username "Admin" and Password "12345" it saves settings with Username "12345" Password "12345"

CPU Load / Temp on Display

Would it be possible to have also the CPU Load and Temp scrolling in the display?
I Saw you did some preparations for it but seems not to be finished right?

Cant ged OLED display to work

I've done everything as in description. I have 0,96 and 1,3 OLED, tried them. None of them gives me nothign.

What am I missing?

Displays are black, and on sign of anything on them.

Thanks

default reset without password

So my pi-hole SD took a crap, had to reinstall. Now im trying to get my pi-hole monitor setup again, and if keeps telling me wronv password. I don't believe i changed it cause i have nothing in my password vault.
So how can i default it to start over?

Thanks.

Not showing info on the OLED display?

Hi friends. First of all I am a newb and this is my first attempt at a project like this. I am pleased that I got this far. :) I have the board connected to my wifi and I am logged into it. I ran the tests and it is seeing the pihole data however nothing shows on the OLED display. I have double checked the connections and my solder looks good. The OLED has not showed any signs of life. Could it be bad? Wasn't sure if there is something could be causing this. Just looking for any suggestions. I was so close to making this work :)

Invalid access to Configuration

I have modified the Settings.h to set my user & password in order to access the Configuration sections, but any value used here will not work, I commented the validation in piholemonitor in order to skip validation and I have observed that the user & password are populated automatically with
User: password
Password: password
So it's not really updating the values, then i tried to access using the above credentials and it works, but if I change the credentials on the Configuration page to others it wont update anything using the specified ones.

I have also tried to dissable the acces setting it to false, and it still asks for user/password.
boolean IS_BASIC_AUTH = false; // true = require athentication to change configuration settings / false = no auth

Failed Parses reading some pi hole data

Set this up today pointed it to my docker server running pi hole..

It gets the date and ips that tried blocked domains, but nothing else, ive looked in serial monitor and get this

Sending: http://192.168.1.164:1010/admin/api.php?summary
Response Code: 200
Response: []
Data Summary Parsing failed: http://192.168.1.164:1010/admin/api.php?summary
Sending: http://192.168.1.164:1010/admin/api.php?overTimeData10mins
Response Code: 200
Modified Response: {
Data Parsing failed: http://192.168.1.164:1010/admin/api.php?overTimeData10mins
Sending: http://192.168.1.164:1010/admin/api.php?topClientsBlocked=3&auth=3ed0140524f0e5571e0134b6153656db4efa37be7b09a11adfa61f7c5dfda72e
Response Code: 200
Response: {"top_sources_blocked":{"192.168.1.191":3}}
Blocked Client 1: 192.168.1.191 (3)

When i click in the pi hole monitor config test connection for summary i get the summary returned fine etc....

{"domains_being_blocked":"166,512","dns_queries_today":"533","ads_blocked_today":"4","ads_percentage_today":"0.8","unique_domains":"268","queries_forwarded":"515","queries_cached":"8","clients_ever_seen":"3","unique_clients":"3","dns_queries_all_types":"533","reply_UNKNOWN":"40","reply_NODATA":"109","reply_NXDOMAIN":"43","reply_CNAME":"220","reply_IP":"63","reply_DOMAIN":"0","reply_RRNAME":"0","reply_SERVFAIL":"0","reply_REFUSED":"0","reply_NOTIMP":"0","reply_OTHER":"0","reply_DNSSEC":"58","reply_NONE":"0","reply_BLOB":"0","dns_queries_all_replies":"533","privacy_level":"0","status":"enabled","gravity_last_updated":{"file_exists":true,"absolute":1673452010,"relative":{"days":0,"hours":0,"minutes":39}}}

but the pihole monitor not grabbing this info properly?

Temporary deactivate Pihole with knob?

Hi there,

i dont know if this is the right was to ask.

could you implement the funktion to deactivate pihole for a time that is config per webinterface.
i would love to trigger this event by a hardware button.

thanks for your work

Display stuck on "web interface on"

Hello
I have a strange problem, tried with many version of esp2866 core (from 2.41 to 2.74).
All is good, the setup is ok, the display run fine till last message "web interface" then I don't get any graphic by pi-hole section (see image), remains stuck on this.
I'm using an SSH1106 and pins D3&D4 (the same wemos+ssh1106 I used for your weather station)

Below the log that seem everything is good:

`UtcOffset=-1.00
PiHoleServer=192.168.0.7
PiHolePort=80
PiHoleApiKey=fbe8631820d75f44c4ca1520fdb69a638f80739367f3484f1c0f1900bcd9d4b0
SHOW_CLIENTS=1
minutesBetweenDataRefresh=15
themeColor=light-blue
IS_BASIC_AUTH=1
www_username=admin
www_password=***
IS_24HOUR=1
INVERT_DISPLAY=1
USE_FLASH=1
Sending: http://192.168.0.7:80/admin/api.php?summary
Failed to connect and get data: http://192.168.0.7:80/admin/api.php?summary
Sending: http://192.168.0.7:80/admin/api.php?overTimeData10mins
Failed to get data: http://192.168.0.7:80/admin/api.php?overTimeData10mins
Sending: http://192.168.0.7:80/admin/api.php?topClientsBlocked=3&auth=fbe8631820d75f44c4ca1520fdb69a638f80739367f3484f1c0f1900bcd9d4b0
Failed to get data: http://192.168.0.7:80/admin/api.php?topClientsBlocked=3&auth=fbe8631820d75f44c4ca1520fdb69a638f80739367f3484f1c0f1900bcd9d4b0
*WM: [1] AutoConnect
*WM: [2] Connecting as wifi client...
*WM: [3] STA static IP:
*WM: [2] setSTAConfig static ip not set, skipping
*WM: [1] Connecting to SAVED AP: MAXNETHOME
*WM: [3] Using Password: ********
*WM: [3] WiFi station enable
*WM: [3] enableSTA PERSISTENT ON
*WM: [1] connectTimeout not set, ESP waitForConnectResult...
*WM: [2] Connection result: WL_CONNECTED
*WM: [3] lastconxresult: WL_CONNECTED
*WM: [1] AutoConnect: SUCCESS
*WM: [1] STA IP Address: 192.168.0.108
Signal Strength (RSSI): 56%
Server started
Use this URL : http://192.168.0.108:80/
*** Leaving setup()
*WM: [3] unloading

Updating Time...
.
09:18:35
9:18:35
33515
Local time: 8:18 AM
Sending: http://192.168.0.7:80/admin/api.php?summary
Response Code: 200
Response: {"domains_being_blocked":"84,352","dns_queries_today":"81,833","ads_blocked_today":"7,085","ads_percentage_today":"8.7","unique_domains":"4,191","queries_forwarded":"31,564","queries_cached":"43,184","clients_ever_seen":"61","unique_clients":"55","dns_queries_all_types":"81,833","reply_NODATA":"7,250","reply_NXDOMAIN":"806","reply_CNAME":"11,550","reply_IP":"52,129","privacy_level":"0","status":"enabled","gravity_last_updated":{"file_exists":true,"absolute":1601169554,"relative":{"days":1,"hours":7,"minutes":59}}}
Pi-Hole Status: enabled
Todays Percentage Blocked: 8.7

Sending: http://192.168.0.7:80/admin/api.php?overTimeData10mins
Response Code: 200
Modified Response: {"ads_over_time":{"1601201100":20,"1601201700":27,"1601202300":73,"1601202900":41,"1601203500":15,"1601204100":55,"1601204700":82,"1601205300":38,"1601205900":74,"1601206500":37,"1601207100":20,"1601207700":58,"1601208300":30,"1601208900":48,"1601209500":77,"1601210100":54,"1601210700":62,"1601211300":71,"1601211900":41,"1601212500":15,"1601213100":52,"1601213700":34,"1601214300":38,"1601214900":38,"1601215500":16,"1601216100":64,"1601216700":74,"1601217300":52,"1601217900":16,"1601218500":38,"1601219100":39,"1601219700":32,"1601220300":65,"1601220900":35,"1601221500":20,"1601222100":35,"1601222700":29,"1601223300":38,"1601223900":63,"1601224500":33,"1601225100":91,"1601225700":137,"1601226300":58,"1601226900":20,"1601227500":47,"1601228100":36,"1601228700":30,"1601229300":49,"1601229900":53,"1601230500":68,"1601231100":72,"1601231700":49,"1601232300":53,"1601232900":145,"1601233500":53,"1601234100":25,"1601234700":58,"1601235300":42,"1601235900":22,"1601236500":66,"1601237100":48,"1601237700":43,"1601238300":53,"1601238900":49,"1601239500":46,"1601240100":159,"1601240700":89,"1601241300":93,"1601241900":62,"1601242500":50,"1601243100":66,"1601243700":147,"1601244300":66,"1601244900":50,"1601245500":79,"1601246100":100,"1601246700":78,"1601247300":54,"1601247900":27,"1601248500":24,"1601249100":65,"1601249700":23,"1601250300":21,"1601250900":42,"1601251500":24,"1601252100":17,"1601252700":47,"1601253300":36,"1601253900":50,"1601254500":44,"1601255100":27,"1601255700":16,"1601256300":47,"1601256900":35,"1601257500":35,"1601258100":47,"1601258700":20,"1601259300":16,"1601259900":45,"1601260500":37,"1601261100":47,"1601261700":44,"1601262300":23,"1601262900":17,"1601263500":50,"1601264100":34,"1601264700":37,"1601265300":33,"1601265900":32,"1601266500":18,"1601267100":46,"1601267700":32,"1601268300":50,"1601268900":48,"1601269500":55,"1601270100":22,"1601270700":80,"1601271300":29,"1601271900":32,"1601272500":48,"1601273100":56,"1601273700":87,"1601274300":65,"1601274900":46,"1601275500":115,"1601276100":81,"1601276700":62,"1601277300":52,"1601277900":116,"1601278500":107,"1601279100":54,"1601279700":60,"1601280300":46,"1601280900":53,"1601281500":69,"1601282100":72,"1601282700":33,"1601283300":53,"1601283900":46,"1601284500":35}}
High Value: 159
Count: 140

Sending: http://192.168.0.7:80/admin/api.php?topClientsBlocked=3&auth=fbe8631820d75f44c4ca1520fdb69a638f80739367f3484f1c0f1900bcd9d4b0
Response Code: 200
Response: {"top_sources_blocked":{"192.168.0.80":2873,"192.168.0.66":1784,"192.168.0.10":814}}
Blocked Client 1: 192.168.0.80 (2873)
Blocked Client 2: 192.168.0.66 (1784)
Blocked Client 3: 192.168.0.10 (814)

`

IMG_0543

Display off after v1.5 Upgrade

Today i updated to v1.5 via the Web Interface. After unplugging and replugging the device, it no longer shows any Display Output.
The WebInterface still works just fine.
I Tried re-Flashing the Firmware via the WebInterface, but no Change.
the Display stays off no matter what i do. Not even the Boot-Up Sequence is shown with the IP.
Only the Webinterface keeps working.

I use this Hardware https://www.etsy.com/de-en/listing/823257424/octoprint-3d-printer-monitor-kit-with?variation0=1461984079

Error compiling - outdated api?

Receiving the following error when tryin to compile:

Compilation error: call to 'HTTPClient::begin' declared with attribute error: obsolete API, use ::begin(WiFiClient, url)

Can you assist?

Always getting Failed to connect and get data

I flashed it with Platformio with ArduinoJson in libs folder from the Repo. After a few runs it is getting more and more data. Sometimes the summary works and the others doesn't.

Sending: http://10.1.4.3:80/admin/api.php?summary Failed to connect and get data: http://10.1.4.3:80/admin/api.php?summary Sending: http://10.1.4.3:80/admin/api.php?overTimeData10mins Failed to get data: http://10.1.4.3:80/admin/api.php?overTimeData10mins Sending: http://10.1.4.3:80/admin/api.php?topClientsBlocked=3&auth=4ba89e70bb8243ef7ce9fbd9dfec1ddd11d5c62464f322419f4f094f29d120c9 Failed to get data: http://10.1.4.3:80/admin/api.php?topClientsBlocked=3&auth=4ba89e70bb8243ef7ce9fbd9dfec1ddd11d5c62464f322419f4f094f29d120c9 Sending: http://10.1.4.3:80/admin/api.php?summary Response Code: 200 Response: {"domains_being_blocked":"111,810","dns_queries_today":"199,878","ads_blocked_today":"10,948","ads_percentage_today":"5.5","unique_domains":"863","queries_forwarded":"26,955","queries_cached":"161,974","clients_ever_seen":"17","unique_clients":"17","dns_queries_all_types":"199,878","reply_NODATA":"66","reply_NXDOMAIN":"31","reply_CNAME":"2,715","reply_IP":"1,333","privacy_level":"0","status":"enabled","gravity_last_updated":{"file_exists":true,"absolute":1556416208,"relative":{"days":"3","hours":"10","minutes":"13"}}} Pi-Hole Status: enabled Todays Percentage Blocked: 5.5

Error while updating to V1.5

When I tried to update my pi-hole monitor using the .bin file via the web interface. I keep getting the following error:

Update error: ERROR[10]: Magic byte is wrong, not 0xE9

I Used the following .bin file since I'm using 0.96 OLED display: piholemonitor.ino.d1_mini_v1.5.bin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.