DEV Community

Cover image for Monitor internet speeds with Raspberry Pi
santisbon
santisbon

Posted on • Updated on

Monitor internet speeds with Raspberry Pi

A great addition to any homelab is being able to track your internet speeds over time and have a nice dashboard to visualize the data for download/upload speeds, latency, and jitter.

We'll use the speedtest.net API for the test itself, a time series database to store our test results, and a dashboard to visualize them from other machines on the network.

To make the deployment easier we'll take advantage of Docker containers to package our apps, Kubernetes for orchestration, and Helm to deploy everything.

You'll need a Raspberry Pi or some other low-cost, low-energy consumption computer you'd like to leave on to do the speed monitoring. You won't need a graphical desktop on it since you can ssh into it to carry out all tasks.

Let's get started! All the details are here:

GitHub logo santisbon / speedtest

Keep track of your internet connection speeds over time with a Raspberry Pi.

Internet Speed Monitor

Keep track of your internet connection speeds over time with a Raspberry Pi.

Dashboard

This Helm chart deploys:

  • InfluxDB 2.x database for time series data.
  • Grafana dashboard.
  • Python app to run the speed test on a schedule.

Prerequisites

  1. Set up your Raspberry Pi.
  2. Install and configure MicroK8s (or another lightweight Kubernetes distribution with DNS and Helm addons) on your Pi.

Note: MicroK8s by default uses Dqlite as its storage backend instead of etcd. Further securing of Secret objects with encryption at rest for either storage backend is outside the scope of this project.

Install

  1. Prepare your Raspberry Pi's local storage for both the database and dashboard

    # On your Pi
    sudo mkdir -p /var/lib/influxdb2
    sudo mkdir -p /etc/influxdb2
    sudo mkdir -p /var/lib/grafana
    Enter fullscreen mode Exit fullscreen mode
  2. If installing from the repository

    # On your Pi
    
    helm repo add santisbon https://santisbon.github.io/charts/
    # or 
    helm repo update
    
    CHART="santisbon/speedtest"
    Enter fullscreen mode Exit fullscreen mode

    Or if…

Top comments (1)

Collapse
 
valeryxs profile image
Valeryxs

Intresting post