Yahoo
Advertisement
Advertisement
Advertisement
Advertisement

I turned a Raspberry Pi into a speed tracker, and now I know exactly when my ISP is lying

A Raspberry Pi 4 configured to work as a travel router.
Nick Lewis / How-To Geek

The internet is a vital part of daily life, and you should get the speeds you pay for. This is a quick and easy way to turn a Raspberry Pi into an internet speed monitor so you can be sure you can know for a fact if your ISP is ripping you off.

You can't trust an individual speed test

When you run an individual speed test, you're getting a snapshot of your internet speed at that moment in time.

However, there are a huge number of variables that can affect your speed day by day or even hour by hour. If you're going to try and suss out a problem, or even just determine if you're actually getting the speeds you pay for, you need more than one data point.

A speed test result for AT&T Gigabit Fiber internet.

For example, if there is a poor connection somewhere between your home and your ISP, you may have normal speeds at one point but severely reduced speeds at another time. I've encountered this a few times when a loose connection allowed water infiltration when it rained, resulting in sporadic lower speeds.

A photo of a coaxial cable.

Why use a Raspberry Pi as a speed test server?

Running a speed test yourself multiple times a day would become extremely tedious, especially if you need or want to neatly collect those results to try to work out if there is any kind of pattern.

Advertisement
Advertisement

Automating the process is ideal, and luckily, you only need a computer and some open-source software.

A Raspberry Pi 4 or 5 is ideal for the job. Both feature a 1 gigabit Ethernet adapter, which is more than fast enough to accurately measure the average home internet connection.

A Raspberry Pi 4 configured to work as a travel router.

Nick Lewis / How-To Geek

Additionally, when they're not under heavy load, they barely consume any electricity, which means you can leave them plugged in and idle without much cost. Even under load, they only consume about 15 watts.

That makes them well suited to any self-hosted service that doesn't require many resources and you want to leave running in the background all the time.

Automating an internet speed test on your network

There are a few ways to set up an automatic speed test on your network. The most straightforward is a simple cron job that logs the results to a file, though that requires manual processing after the data is collected.

Advertisement
Advertisement

Instead, I'd recommend a project called Internet Pi, which not only runs tests and logs the data, but provides a tidy web interface you can access from any device on your network.

Start by installing the headless version of Raspberry Pi OS (64-bit) on a microSD card and inserting it into your Raspberry Pi. Make sure to enable SSH during the installation process; you'll need it later. At the same time, make sure that your Raspberry Pi is connected via an Ethernet cable to your router—that'll give you the most reliable information about your internet speeds.

Enable SSH on the Raspberry Pi.

Connect to your Pi over SSH, then run the following commands to make sure you have some prerequisites:

With that done, you need to actually download the Internet Pi project from GitHub and enter the project's directory. To do so, run:

Once that finishes downloading, enter ansible-galaxy collection install -r requirements.ymlto finish the installation process.

Advertisement
Advertisement

That command will create two files that you need to copy before you modify, so run the following two commands *exactly.* If the original example files are missing, you'll get an error.

With the copies made, you need to modify inventory.ini using an editor of your choice.

In inventory.ini, you need to comment out the first IP and uncomment the second one. It should look like this when you're done:

If your username on the Pi is anything other than "pi," you'll need to change that too.

With the setup done, run ansible-playbook main.yml to start the speed test service.

It'll take a while to collect results the first time, but once it starts, you'll be able to keep an eye on the results by entering your Pi's IP address followed by the port 3030 into your browser. So, mine was:

My speed tests revealed a problem

I'd originally started running speed tests because my desktop was experiencing large swings in download speeds.

Advertisement
Advertisement

Ultimately, that turned out to be a problem with the network card attached to the motherboard, but it did show something else interesting. My internet speed was way lower than it should be.

The output of Internet Pi.

After going over all the connections, updating the router and modem firmware, and double-checking the Pi itself, it was obvious the problem wasn't on my end.

As it turns out, I was somehow placed on the wrong plan. A quick message to my ISP was all it took to sort the situation out.


I can't help but wonder how long I would have gone without noticing I was on the wrong plan if I hadn't

Advertisement
Advertisement
Mobilize your Website
View Site in Mobile | Classic
Share by: