I’ve had a strange issue with my Internet for the last few months, it’s rock solid during the day and I have no issues at all, however from around 8pm onwards, it becomes unreliable – ping times go through the roof or I lose connectivity intermittently. This used to occur one night a week or so but for the past couple of weeks it has been happening 2-3 times a week which is seriously affecting my Netflix consumption 😀.
I have a FTTP connection and there doesn’t appear to be a fault with the fibre connection into my property as the fibre connection light on the ONT is green when the Internet grinds to a halt. I reported this to my ISP who requested I contact them when the issue is active so that they can perform some diagnostics.
I decided to collect some data on the issue to help me identify any patterns with this and also as evidence for my ISP. As I mentioned in a previous post I have a lot of spare Raspberry Pi’s so decided to put one of them to some good use!
I connected the Pi directly via Ethernet to my router and wrote a quick and dirty PowerShell script that uses the Speedtest CLI Python script written by Matt Martz to perform a speed test of my connection every 5 minutes. Yes, you read that correctly – you can run PowerShell on the Raspberry Pi, here is a guide on how to set this up. I used PowerShell to call the Python script for no other reason than I’d never done it before so it seemed like a good experiment.
Below is the script that I ran, this uses the Speedtest CLI to perform a test every 5 minutes and writes the output to a CSV file.
$i = 0
while ($i -eq 0)
{
$Time = Get-Date
$SpeedTest = /usr/local/bin/speedtest-cli --simple
$Time.ToString() + "," + $SpeedTest[0] + "," + $SpeedTest[1] + "," + $SpeedTest[2] >> /home/pi/Share/SpeedTest.csv
Start-Sleep -Seconds 300
}
Here is what the output looks like in Excel, I’m going to collect data for a few days before I crack open Power BI and do some analysis of the data.


Comments
6 responses to “The Joys of Unreliable Internet”
[…] part of my continued quest to over-engineer and complicate things, I decided to update a script I wrote to perform a regular speed test of my Internet connection to store the results in Azure […]
LikeLike
[…] (which at some point I’ll actually analyse and produce some pretty charts! I wrote about it here. This got me thinking – could I write the output of these tests to my shiny new-ish display? […]
LikeLike
[…] the latency and speed of my Internet connection and writes this to a CSV file. I wrote about this here, my primary reason was to diagnose some random connectivity issues that I’d experienced […]
LikeLike
[…] them for all kinds of things, ranging from testing my Internet connection, which I blogged about here to playing my favourite video games from the 90s using RetroPie, what better use of a Pi than […]
LikeLike
[…] do I do this? Check out “The Joys of Unreliable Internet” which explains […]
LikeLike
[…] time ago I wrote about issues with the reliability of my Internet connection – The Joys of Unreliable Internet, one thing that came out of this was a script that I run every 15 minutes that checks the download […]
LikeLike