Add Speedtest to Pihole WebUI

So this project is  just another fun project integrating speedtest to PiHole Web UI.

Note : It’s just a quick solution , nowhere near perfect . If you made it better please let me know here Google+ Community

It will be using speedtest.net on background for testing. More frequent the speed tests more data will used.

What does this mod have in extra ?

  1. Speedtest results of 1 /2 4/ 7/30  days as graph.
  2. Custom speed test server selection.
  3. Detailed speedtest results page.
  4. Ability to schedule speedtest interval.

Latest Updates will listed here :  Pihole mods Community 

Inspiration : https://arstechnica.com/business/2016/02/comcast-customer-made-bot-that-tweets-at-comcast-when-internet-is-slow/

How to update to new version

Tested on Raspberry pi and Ubuntu PC

Needs latest pihole installed and working

Start with installing required packages on your Raspberry Pi / Linux

Find php version 

if it is 5.x

if it is 7.x

Restart Pi

You can try run it using

If Everything is ok, proceed to next step

Get the new set of admin Code from github ( New method  or try old one here)

Test its working

Go to your pihole admin page

http://pi.hole/admin

Note : First load may be slow

Login 

Now go to settings and enable speedtest

Note: If the item does not change to option you have chose just go to dashboard and comeback, it will be fine. I am currently working on it

Now create a speedtest Manually and make sure it’s appearing on dashboard

Go back to terminal and type  Not needed  : admin will call this if there is no data 

It may take few seconds to appear , but once its loaded you can see that on dashboard.

Please consider posting a screenshot link in the comments , I would like to know how it looks on different devices.

If there are any problems , ask here :  PiHole mods G+


Will my regular updates have problems ?

If you are upgrading pihole please revert all changes back and do the upgrade. Scroll down for instructions .

Speedtest gone missing after Pi-hole update

Dont worry your data is safe , update procedure here

Can the developer held responsible if anything goes wrong.

Absolutely not ,but you can always ask for help

I lost my DB file what Should I do ?

Here is a blank one : SpeedtestDB Zip

Can i get more features added to it ?

You can ask me via this link, I will do if feasible

Can I get it via regular pihole -up

Not currently. Hope this will get integrated into the baseline. If that happens you can easily get it via regular pihole update

The time is not not showing correctly in chart 

Please get latest code via git pull

I don’t want this , I want to go back to the original version .

If you have followed all instructions correctly , the code below will revert all the changes you have done .


Notes

Just a quick solution , you should move the db file to a directory outside www folder for security reasons.

Uses codes from

  • https://github.com/sivel/speedtest-cli
  • https://github.com/HenrikBengtsson/speedtest-cli-extras

 

Old Method for admin area

20 Replies to “Add Speedtest to Pihole WebUI”

  1. Hi, First of all Thank you this is awesome. I followed the instructions and it doesnt seem to be working the box doesnt show in the dashboard and it doesnt allow me to enable it.

    When I enter “sudo pihole -a -sn” all I get is the pihole -a help menu

    Set admin options for the web interface of pihole
    :::
    ::: Usage: pihole -a [options]
    :::
    ::: Options:
    ::: -p, password Set web interface password, an empty input will remove any previously set password
    ::: -c, celsius Set Celsius temperature unit
    ::: -f, fahrenheit Set Fahrenheit temperature unit
    ::: -k, kelvin Set Kelvin temperature unit
    ::: -h, –help Show this help dialog
    ::: -i, interface Setup interface listening behavior of dnsmasq
    ::: pihole -a -i local : Listen on all interfaces, but allow only queries from
    ::: devices that are at most one hop away (local devices)
    ::: pihole -a -i single : Listen only on one interface (see PIHOLE_INTERFACE)
    ::: pihole -a -i all : Listen on all interfaces, permit all origins

  2. great concept! i have just attempted to install it but never got it to completely work. my issues were:
    1: when clicking on speedtest in pihole after enabling it for 1hr intervals, i got an error saying that there was no data to display
    2: i rebooted, when going to http://x/admin, i only ever got the source of index.php to display – never the actual webpage.

    i reverted as per instructions and rebooted and http://x/admin displayed correctly.

  3. No issues. Instructions were perfect. Was able to install it in less than 10 minutes. Now, the only issue is that the ethernet interface of my Pi is slower than my internet connection, so i will never get the real, real results.

  4. Remove is missing a /admin

    # REVERT BACK TO ORIGINAL
    # Note this will revert all changes including you speedtest data saved
    # Will work only If you have followed all instructions exactly

    cd /var/www/html/admin
    sudo su

    git reset –hard origin/master

    cd /opt/pihole/
    mv webpage.sh webpage.sh.mod
    mv webpage.sh.org webpage.sh

  5. I keep on seeing 200 entries every time a speedtest is done in my Dashboard, which kinda pollutes the graph. Is there any way around this?

    1. You can set a custom server, it will reduce the number of queries to less than 5. Go to the settings page and enter the custom server ID

  6. Love the project, and it works great. My only issue is I have a gigabit network, but the raspberry pi only supports 100mbps. Which kills the validity of this project for me personally. If i had 100mbps or under from my isp this would be the perfect project.

  7. I’d be interested in a standalone webpage for the speedtest. (separate from the Pi-hole project)

    I’d be willing to collaborate on such a standalone webpage. I’m fairly skilled with python and shell scripting.
    If you’d be willing to do the web frontend stuff, I could help with the backend stuff, an install script, and testing.

    I’ve been looking for something like this for quite a while, and the closest I’ve found is:

    https://www.accelebrate.com/blog/pandas-bandwidth-python-tutorial-plotting-results-internet-speed-tests/

    I think that we could program in some additional features, like the ability to run a manual test (versus the automatic ones). We could also theoretically make a settings page to set the frequency of the speedtests.

Leave a Reply

Your email address will not be published. Required fields are marked *