Skip to content

simon-amadeus/berri-speed-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ookla Speedtest CLI Report Generator

A simple speedtest-cli (Ookla) report generator.

The purpose is to monitor internet speed over time. The goal is to assess whether the quality provided by internet service providers matches the advertised speed.


Python Wrapper

This project includes a robust Python wrapper (monitor/monitor.py) for the Ookla Speedtest CLI.
It runs the CLI, parses all JSON output lines (including errors), and logs results with timestamps in speedtests.jsonl.

Usage

  1. Install Ookla Speedtest CLI
    See Ookla CLI install instructions or use Homebrew:

    brew tap teamookla/speedtest
    brew install speedtest --force
  2. Install Python dependencies

    python -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
  3. Run the monitor

    python monitor/monitor.py

    Results are appended to speedtests.jsonl in JSON Lines format.


Automated Deployment & Reporting

You can deploy the monitor and automated reporting to a Raspberry Pi (or other Linux host) using the provided deployment script.

Deploy to Raspberry Pi

  1. Edit deploy.sh if needed
    Adjust REMOTE_USER, REMOTE_HOST, and paths if your setup differs.

  2. Run the deployment script

    ./deploy.sh

    This will:

    • Copy all project files to the remote host
    • Set up a Python virtual environment and install dependencies
    • Install Ookla Speedtest CLI if needed
    • Set up cron jobs to run the monitor and generate the HTML report hourly
    • Install and enable a systemd service to serve the report via HTTP
  3. Access the report
    Open in your browser:

    http://berri:8080/report.html
    

    (Replace berri with your Pi's hostname or IP if needed.)


Testing

This project uses pytest for testing.

To run tests:

pytest monitor/tests/

Analysis

Show report (Jupyter Notebook)

If you want to explore the data interactively:

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
jupyter notebook

Open analysis/analysis.ipynb in Jupyter.


Manual Report Generation

To manually generate the HTML report:

source venv/bin/activate
jupyter nbconvert --to html --theme dark analysis/analysis.ipynb --output analysis/report.html

Systemd Service

The HTTP server is managed by a systemd service (speed-report.service).
You can check its status on the Pi with:

sudo systemctl status speed-report.service

Troubleshooting

  • If you cannot access the report from another device, check your firewall and ensure the service is running.
  • The cron logs are available at /opt/speed-monitor/cron.log on the Pi.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors