While cleaning out some old cartons last weekend, I found my old Raspberry Pi Model B+. It is the first iteration of the Pi. It has a 700MHz ARM CPU and 512MB of RAM. It uses a micro-SD card for non-volatile storage. So as you can see, it is quite a capable little computer, and you can power it off a standard 5V USB charger, which means you can run it all the time without worrying about power consumption.
I decided to track my home internet speed to see if my ISP is ripping me off 😉. Here’s how I did it.
Measuring speed on Raspberry Pi
Speedtest.net has an official CLI client that you can install directly using apt. It selects the best server automatically and reports the download and upload speed, along with the latency of your connection.
There is an option to get this info in json format, which is easier to parse.
So I wrote a simple python script to capture this output.
Store measurments in a Firestore DB
A bit of code will push this to a Firestore DB. Google lets you use a Firestore DB for free if you stay within a reasonable number of operations per day.
Take measurements every 30 minutes
Then I added this to crontab so it runs every 30 minutes.
Pulling records from Firestore to Google Sheets
I let this run for a bit over 24 hours, and got 52 readings. Next step was to write a small Google Apps Script to pull these records from Firestore and put them in rows in a Google Sheets worksheet.
Then it’s simple to chart the speeds and latency over the roughly 24-hour period.
Problem in the setup
This chart shows that my download speed varies between 20 to 35Mbps, and the upload varies between 15 to 20Mbps. This is significantly lower than the 100Mbps symmetric I pay for. If you go back to the first test result I showed in this post, which I ran from my laptop, it shows 83Mbps download and 60Mbps upload. So why this discrepancy?
I suspect this is where my old Pi is showing its age. Even though it is connected to my router using a 100Mbps ethernet cable, the hardware is simply not powerful enough to fully saturate the connection. So I will not be running this setup anymore. Maybe one day I’ll get a newer model and run this for a longer duration. That would hopefully reveal some interesting patterns.
Another concern of mine is the amount of data transfered. Each run of the test consumes around 60MB of data. Running it every half hour for a month would use up ~85GB. That is close to 17% of my plan’s monthly quota. That would probably push me over the limit and cause the connection to slow down to something unusable like 1Mbps.