OpenWrt · GL-MT6000 · Build Guide

Monitor your
internet speed,
automatically.

A complete walkthrough for installing the Ookla speedtest binary on your GL.iNet Flint 2 router, scheduling hourly tests via cron, logging results to CSV, and rendering them as a live dashboard — all running locally on the router itself.

~30 minSetup time
6Steps
0 depsNo packages needed
∞Test history
// System Architecture

How it all fits together

Cron /etc/crontabs/root every 6 hours SHELL SCRIPT speedtest-log.sh → runs binary → parses CSV → converts units ./speedtest results.csv /root/speedtest-data/ append-only log symlink uhttpd /www/ on :80 already running Browser Chart.js render live dashboard
00 Before you start

What you'll need

This guide assumes a GL.iNet Flint 2 (GL-MT6000) running OpenWrt with SSH access enabled. The same approach works on most ARM64-based OpenWrt routers — just confirm the architecture before downloading the speedtest binary.

Architecture
ARM64 / aarch64. Verify with uname -a. The Flint 2 uses MediaTek MT7986 — different to the older Flint 1 which needs armel.
SSH access
SSH from your computer to root@192.168.8.1. Enable from LuCI → System → Administration if not already on.
Web server
uhttpd is built-in and already serving /www/ on port 80 — that's where the dashboard goes. No extra packages required.
Storage
Roughly 5 MB free on the overlay filesystem (the persistent flash partition where /root/ lives).
!
Bandwidth awareness

Each Ookla test consumes roughly 2.5 GB of data on a gigabit connection. Plan your schedule accordingly — recommendations are in step 4.

01

Install the speedtest binary

SSH · ARM64 · ~3 MB download

SSH into your router as root, then download and extract the official Ookla speedtest CLI binary for ARM64. This is a single static binary — no dependencies, no package manager required.

root@GL-MT6000:~ — install speedtest
# SSH in (from your computer)
ssh root@192.168.8.1

# Download, extract, and accept license on first run
cd /root
wget https://install.speedtest.net/app/cli/ookla-speedtest-1.2.0-linux-aarch64.tgz
tar xzf ookla-speedtest-1.2.0-linux-aarch64.tgz
./speedtest --accept-license --accept-gdpr

You should see a clean test result with download speed, upload speed, latency, and a result URL. If you get an "unterminated quoted string" error, you've grabbed the wrong architecture — that error means the binary doesn't match your CPU.

✓
Verify the install

Run ls -lh /root/speedtest. You should see a roughly 2.4 MB executable file owned by root.

02

Create a persistent data directory

Filesystem · Overlay · CSV storage

OpenWrt has two main filesystem areas — and choosing the wrong one will silently destroy your data on every reboot.

/tmp/
RAM-based tmpfs. Wiped on every reboot. Fast but not for log storage.
Volatile · RAM
/root/
Lives on the overlay (writable flash). Survives reboots and most upgrades. The right place for our data.
Persistent · Flash
/etc/crontabs/
Persistent configuration directory for cron schedules. Edit with care.
Config
/www/
Web server root, served by uhttpd on port 80. Static files dropped here are instantly available.
Served · :80
create persistent data directory
mkdir -p /root/speedtest-data
03

Write the logging script

Shell · POSIX · CSV output

This script runs the speedtest binary in machine-readable mode, parses the resulting CSV line, converts bytes-per-second into Mbps, and appends a clean row to a structured log file. The first time it runs, it writes a header.

Why parse to our own CSV format?

Ookla's native CSV output is comma-separated with quoted fields and reports speeds in bytes per second. We convert to Mbps (multiply by 8, divide by 1,000,000) so the dashboard can display values familiar to anyone who's used speedtest.net.

/root/speedtest-log.sh
#!/bin/sh

DATAFILE="/root/speedtest-data/results.csv"

# Write CSV header if file is new
if [ ! -f "$DATAFILE" ]; then
    echo "timestamp,server,latency_ms,jitter_ms,packet_loss,download_mbps,upload_mbps" > "$DATAFILE"
fi

# Run speedtest, capture machine-readable CSV
RAW=$(/root/speedtest --format=csv --accept-license --accept-gdpr --progress=no 2>/dev/null)

if [ -z "$RAW" ]; then
    echo "$(date '+%Y-%m-%d %H:%M:%S'),ERROR,0,0,0,0,0" >> "$DATAFILE"
    exit 1
fi

# Parse fields (awk strips the surrounding quotes)
SERVER=$(echo "$RAW" | awk -F',' '{gsub(/"/, "", $1); print $1}')
LATENCY=$(echo "$RAW" | awk -F',' '{gsub(/"/, "", $3); print $3}')
JITTER=$(echo "$RAW"  | awk -F',' '{gsub(/"/, "", $4); print $4}')
PKT_LOSS=$(echo "$RAW" | awk -F',' '{gsub(/"/, "", $5); print $5}')

# Convert bytes/sec to Mbps
DL_BYTES=$(echo "$RAW" | awk -F',' '{gsub(/"/, "", $6); print $6}')
UL_BYTES=$(echo "$RAW" | awk -F',' '{gsub(/"/, "", $7); print $7}')
DL_MBPS=$(echo "$DL_BYTES" | awk '{printf "%.2f", $1/1000000*8}')
UL_MBPS=$(echo "$UL_BYTES" | awk '{printf "%.2f", $1/1000000*8}')

TIMESTAMP=$(date '+%Y-%m-%d %H:%M:%S')
echo "$TIMESTAMP,$SERVER,$LATENCY,$JITTER,$PKT_LOSS,$DL_MBPS,$UL_MBPS" >> "$DATAFILE"

Save it and make it executable

create the script with a heredoc
# Use the cat << 'EOF' technique to paste the whole script in one go
cat > /root/speedtest-log.sh << 'EOF'
# ... paste the script body here ...
EOF

chmod +x /root/speedtest-log.sh

# Run it once to verify
/root/speedtest-log.sh
cat /root/speedtest-data/results.csv
i
Why cat << 'EOF' with single quotes?

Single-quoting 'EOF' tells the shell not to expand $variables as you paste — meaning $DATAFILE stays literal in the file rather than being substituted into emptiness.

04

Schedule it with cron

Cron · /etc/crontabs · OpenWrt

OpenWrt's cron daemon reads schedules from /etc/crontabs/root. Append one line, restart the daemon, done.

00 06 12 18 EVERY 6H

Choose a frequency

Each test uses ~2.5 GB. Pick what suits your bandwidth.

Hourly 0 * * * * ~62 GB/day
Every 3h 0 */3 * * * ~21 GB/day
Twice/day 0 8,20 * * * ~5 GB/day
install the cron schedule
# Append the schedule (every 6 hours)
echo "0 */6 * * * /root/speedtest-log.sh" >> /etc/crontabs/root

# Restart cron to pick up the change
/etc/init.d/cron restart

# Verify it's there
crontab -l
05

Expose the CSV to the web

Symlink · uhttpd · /www/

Rather than copying the CSV into /www/ on every update, create a symbolic link. uhttpd will follow it and serve the live file straight from /root/speedtest-data/.

symlink CSV into web root
ln -s /root/speedtest-data/results.csv /www/speedtest-results.csv

# Test it from your browser:
# http://192.168.8.1/speedtest-results.csv
i
LAN-only by default

uhttpd is bound to your LAN interface, so the dashboard is only accessible from devices on your home network. It's not exposed to the internet unless you've explicitly forwarded port 80 (please don't).

06

Build the dashboard

HTML · Chart.js · client-side

The dashboard is a single HTML file. It loads Chart.js from a CDN, fetches the CSV, parses it client-side, and renders two line charts: one for bandwidth, one for latency. There's no server-side rendering — your browser does all the work.

/www/speedtest.html — abridged
<!DOCTYPE html>
<html>
<head>
  <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
  <canvas id="speedChart"></canvas>
  <canvas id="latencyChart"></canvas>

  <script>
    const res  = await fetch('/speedtest-results.csv');
    const rows = (await res.text()).trim().split('\n').slice(1);

    const labels = [], dl = [], ul = [], ping = [];
    rows.forEach(line => {
      const p = line.split(',');
      labels.push(p[0].substring(5, 16));
      ping.push(parseFloat(p[2]));
      dl.push(parseFloat(p[5]));
      ul.push(parseFloat(p[6]));
    });

    new Chart(document.getElementById('speedChart'), {
      type: 'line',
      data: { labels, datasets: [
        { label: 'Download Mbps', data: dl, borderColor: '#4CAF50' },
        { label: 'Upload Mbps',   data: ul, borderColor: '#2196F3' }
      ]}
    });
  </script>
</body>
</html>

Save it to /www/speedtest.html and visit http://192.168.8.1/speedtest.html from any device on your network. As cron fires throughout the day, the chart fills in.

✓
Cache-busting

Add ?_=' + Date.now() to your fetch URL so the browser doesn't serve a stale CSV from cache when you refresh the page.

07 Troubleshooting

When things go sideways

"Unterminated quoted string"
Wrong CPU architecture. The aarch64 binary won't run on armel hardware. Run uname -a and check what your router actually is.
CSV isn't growing
Cron may not be running. Check with /etc/init.d/cron status. Also verify the script is executable (ls -l /root/speedtest-log.sh).
Dashboard shows no data
Open the CSV URL directly in your browser to confirm uhttpd is serving it. Check DevTools console for fetch errors.
Everything gone after upgrade
Firmware upgrades may wipe /root/. Back up speedtest, speedtest-log.sh, and the cron entry before flashing.

Pruning old results

The CSV grows forever otherwise. Trim it weekly with another cron job that keeps only the last 500 rows:

weekly cleanup
echo "0 3 * * 0 tail -n 500 /root/speedtest-data/results.csv > /tmp/st_trim.csv && mv /tmp/st_trim.csv /root/speedtest-data/results.csv" >> /etc/crontabs/root
/etc/init.d/cron restart