Home Speedtest

So every night around 7-11:59pm my downspeeds drop to <10Mbit and latency starts pumping up to around 500ms… So I’ve come up with a system to chart it so I can provide them irrefutable proof there’s an issue…

Technically all you need to make this work is the speedtest.py script… but I went a bit further and also setup a speedtest/mini server to combat the stupid techs from telling me it’s my wifi.  This is how I created it.

  1. Install Ubuntu Server 14.x LTS in a VM.
  2. During install, select SSH Server, LAMP, Samba services by default.
    1. Update the server
      1. apt-get update
      2. apt-get upgrade
  3. Setup the Samba share as required…
    1. sudo smbpasswd -a yoursambauser
    2. sudo nano –w /etc/samba/smb.conf
      1. Add a block like this to the end:
        [secured]

        path = /home/yourusername
        valid users = yoursambauser
        guest ok = no
        writable = yes
        browsable = yes
  4. Install the Mini Speed Test (optional)
    1. Make sure the pre-reqs are installed
      1. apt-get install php5 php5-mysql php5-mcrypt php5-gd libapache2-mod-php5
    2. Download the mini.zip from http://www.speedtest.net/mini.php
    3. Extract it to /var/www/html/
      1.  
    1. wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest_cli.py
    2. chmod ugo+x speedtest-cli
    3. sudo chown root:root speedtest-cli
    4. mv speedtest-cli /usr/bin/
    1. Do some tests…  make sure speedtest-csv is actually calling speedtest-cli properly…
      1. I had to make a few edits to the script to specify a server when calling it… (attached)
    2. There’s a windows .bat variant on the github page if you opt not to do it on a linux box.
  5. Add it to the crontab…  (or Task Scheduler in windows)
# Crontab running speedtest-csv.sh which calls speedtest.py which uses the speedtest.net servers…
# Best Pick Server
08,38 * * * * /home/user/speedtest-csv.sh --standardize --server 3635 >> /home/daceige/speedtestlog.random.csv
# 3635) LUS Fiber
18,48 * * * * /home/user/speedtest-csv.sh --standardize --server 3635 >> /home/daceige/speedtestlog.csv
# 2410) Charter Communications (Slidell, LA, United States) [41.34 km]
28,58 * * * * /home/user/speedtest-csv.sh --standardize --server 2410 >> /home/daceige/speedtestlog.csv

/home/user/speedtestlog.csv is shared via a Samba service on the server… which then I import into an excel spreadsheet as a data source, which I then pump into a few pivot tables and graphs…

And … Volia…