Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Raspberry Pi Internet Speed Tracker: Catch ISP Lies

· 7 min read · Home Networking

In this article
  1. Why You Need Your Own Speed Tracker
  2. How the Raspberry Pi Tracker Works
  3. Choosing the Right Speed Test Tool
  4. Setting Up the Tracker Step by Step
  5. Common Problems and How to Avoid Them
  6. Comparing Your Results to Your ISP's Promise
  7. Costs and Hardware Requirements
  8. Safety and Security Considerations
  9. Alternatives to a Raspberry Pi
  10. Frequently Asked Questions

Yes, a Raspberry Pi can continuously monitor your internet speed and log the results, giving you hard data to check whether your ISP is actually delivering the speeds you pay for. By running a speed test on a schedule and storing the results, you can spot patterns of slow performance and present concrete evidence when contacting your provider.

Why You Need Your Own Speed Tracker

ISPs often advertise speeds as "up to" a certain number, which legally allows them to deliver less than that. However, there is a difference between occasional dips and chronic underperformance. Your own tracker provides a long-term record that shows what you actually get at different times of day, which is far more convincing than a single speed test result taken at an arbitrary moment. It also helps you identify whether issues are on your side (Wi-Fi interference, old router) or on the provider's side (congestion, faulty line).

How the Raspberry Pi Tracker Works

The core idea is simple: schedule a speed test to run every hour (or more often), save the results (ping, download, upload) to a file or database, and then view the data on a web dashboard. The most common tool for this is Speedtest CLI by Ookla, which you can install on the Pi and call from a cron job or a Python script. Alternatively, you can use a Python library like speedtest-cli (a third-party wrapper) or iPerf3 if you want to test against a local server rather than the public internet.

A typical setup involves:

  • A Raspberry Pi (any model from 3B+ upwards works fine) with a wired Ethernet connection to your router.
  • An SD card with Raspberry Pi OS Lite (no desktop needed).
  • A script that runs the speed test and appends the results to a CSV file or a SQLite database.
  • Optional: a simple web page (using Flask or Node-RED) to display the data as graphs.

Choosing the Right Speed Test Tool

There are two main approaches: using a public speed test service (like Ookla) or using a self-hosted test (like iPerf3). Public tests measure your connection to a remote server, which is what you experience when browsing or streaming. iPerf3 measures the raw throughput between two devices on your network, which is better for isolating whether the bottleneck is your internal network or your ISP. For the purpose of catching an ISP lying, you want a public test because that reflects the service you're paying for. Ookla's CLI is the most widely used because it's reliable and has a large network of servers. However, be aware that Ookla's results can be slightly optimistic because it picks the fastest server; you might want to force a specific server that is close to you for consistency.

Setting Up the Tracker Step by Step

  1. Install Raspberry Pi OS Lite on an SD card (use the official Raspberry Pi Imager).
  2. Boot the Pi, connect it to your router via Ethernet, and enable SSH so you can access it from your main computer.
  3. Update the system: sudo apt update && sudo apt upgrade -y.
  4. Install the Speedtest CLI: follow the official instructions from Ookla's website (they provide a .deb package for Debian-based systems).
  5. Create a Python script that runs the speed test, parses the JSON output, and appends the data to a CSV file with a timestamp.
  6. Set up a cron job to run the script every hour (e.g., 0 * * * * python3 /home/pi/speedtest.py).
  7. Optionally, install a web server (like Flask) to serve a simple dashboard that reads the CSV and displays charts using Chart.js.

Common Problems and How to Avoid Them

The biggest mistake is running the speed test over Wi-Fi. Wi-Fi is subject to interference and distance, so the results will not reflect your ISP's performance. Always use a wired connection. Another issue is running the test too frequently; every 15 minutes might be overkill and could skew results because the test itself consumes bandwidth. Hourly is a good balance. Also, make sure your Pi's clock is accurate (enable NTP) so timestamps are correct. Finally, if you use a public speed test server, the server's location can affect results; try to pin one that is geographically close to you.

Comparing Your Results to Your ISP's Promise

Once you have a few days of data, you can compare your average download and upload speeds to the plan you're paying for. Keep in mind that ISPs often have a "typical speed" range, not a fixed number. For example, if you pay for 100 Mbps, your ISP might state that you should expect between 80 and 100 Mbps. If your average is consistently below that range, you have a case. You should also look at the time of day; if speeds drop every evening between 7 PM and 11 PM, that's a sign of network congestion. Document these patterns and contact your ISP with your data. If they don't resolve it, you can file a complaint with your local telecommunications regulator, as many countries have rules about advertising speeds that are not met.

Costs and Hardware Requirements

The total cost is minimal if you already own a Raspberry Pi. A Pi 3B+ or newer (including Pi 4 and Pi 5) is more than enough. You'll also need a microSD card (8 GB or larger) and a power supply. If you don't have a Pi, the total cost is roughly $35 for the board, $10 for a case and power supply, and $5 for an SD card. You do not need a monitor or keyboard after initial setup because you can control it over SSH. The electricity cost is negligible (a few dollars per year).

Safety and Security Considerations

Running a speed test is safe and does not harm your network. However, exposing your Pi to the internet is not recommended. Keep it on your local network only, and do not enable port forwarding. If you want to access the dashboard remotely, use a VPN like WireGuard or Tailscale instead of exposing it directly. Also, make sure your Pi's OS is updated regularly to patch security vulnerabilities. The speed test script itself is harmless, but be cautious when installing third-party libraries; stick to well-known repositories.

Alternatives to a Raspberry Pi

If you don't want to buy a Pi, you can achieve the same result with an old laptop, a desktop PC that's always on, or even a router that supports custom scripts (like OpenWrt). Some network-attached storage (NAS) devices also allow you to run Docker containers, which can host a speed test container. The advantage of a Pi is its low power consumption and small footprint. But any device that can run Python and has a network connection will do the job.

Frequently Asked Questions

Can the Pi itself slow down my internet?

No, the Pi does not sit in the data path unless you configure it as a router or bridge. It's just another device on your network that sends a small amount of test traffic. The impact is negligible, especially if you test hourly.

How often should I run the speed test?

Once an hour is a good default. More frequent tests (every 15 minutes) can show finer detail but may interfere with your own usage and could trigger ISP throttling if they detect heavy testing. Less frequent (every 3 hours) might miss congestion windows.

What if my ISP says the problem is my router?

Your Pi is connected directly to the router via Ethernet, so if the Pi shows slow speeds, the bottleneck is either your router or the ISP. To isolate further, connect the Pi directly to the modem (bypassing the router) and run tests. If speeds improve, the router is the issue; if not, it's the ISP.

Can I use this data to get out of my contract?

In many jurisdictions, yes, if you can prove the ISP consistently fails to deliver the minimum advertised speed. However, rules vary by country. Check your local consumer protection laws and the terms of your contract. The data is strong evidence, but you may need to file a formal complaint with a regulatory body.

Is there a ready-made software image for this?

Yes, there are projects like "Pi Speed Test" or "Speedtest Tracker" that provide pre-configured Docker images or install scripts. However, these may not be actively maintained, so it's often safer to set it up yourself using the steps above. The setup is not difficult and gives you full control.