Skip to main content

Simple Meshtastic monitoring UI + JSON API

Project description

Meshtastic Monitor

A tiny web dashboard + JSON API for Meshtastic over TCP (direct to your node, default port 4403).

What you need (before you start)

  1. A Meshtastic node reachable over Wi‑Fi (you know its IP/hostname)
  2. Python 3.9+

Start (2 minutes)

1) Install (one time)

pip install meshtastic-monitor

If pip is not available, use:

python3 -m pip install meshtastic-monitor

2) Run

python -m meshtastic_monitor --host YOUR_MESH_IP

If python is not available, use:

python3 -m meshtastic_monitor --host YOUR_MESH_IP

Then open:

  • UI: http://localhost:8880/
  • Health (JSON): http://localhost:8880/api/health

If you run this on another computer in your LAN, open:

  • http://SERVER_IP:8880/

3) Stop

Press Ctrl+C in the terminal where it is running.

Configure (if you didn’t pass --host)

  1. Open the UI
  2. Click Settings
  3. Put your Meshtastic IP/host + port (4403)
  4. Click Save & Apply

The UI stores these settings in your browser (localStorage).

Command-line options (copy/paste)

Show all options:

python -m meshtastic_monitor --help

Most used:

  • --host / --mesh-host (Meshtastic IP/hostname)
  • --mesh-port (default 4403)
  • --http-port (default 8880)
  • --log-file (default ./meshmon.log)
  • --log-level (default INFO)
  • --nodes-history-interval (default 60 seconds)

You can also set env vars instead of flags:

  • MESH_HOST (default empty; can also be set via UI)
  • MESH_PORT (default 4403)
  • HTTP_PORT (default 8880 when using python -m meshtastic_monitor)
  • NODES_REFRESH_SEC (default 5) refresh live node snapshot
  • MAX_MESSAGES (default 200) in-memory ring buffer size
  • STATS_DB_PATH (default meshmon.db, set to off to disable persistence)
  • NODES_HISTORY_INTERVAL_SEC (default 60) how often to store node history samples
  • STATUS_HISTORY_INTERVAL_SEC (default 60) how often to store status samples
  • STATS_WINDOW_HOURS (default 24) used by /api/stats
  • MESH_HTTP_PORT (default 80) for http://MESH_HOST[:port]/json/report
  • STATUS_TTL_SEC (default 5) cache /json/report for this many seconds
  • LOG_LEVEL (default INFO)
  • MESHMON_LOG_FILE (default ./meshmon.log)

Logs (where are they?)

By default the app writes logs to:

  • ./meshmon.log (the directory where you started the command)

You can change it:

python -m meshtastic_monitor --log-file /path/to/meshmon.log

Logs are rotated (to avoid infinite growth): ~2MB per file, up to 3 backups.

How it works (simple mental model)

Two layers

  1. Backend (Python/Flask) exposes JSON endpoints under /api/* and serves the UI.
  2. Frontend (HTML/JS) is just static files that poll the JSON API.

What it connects to

  • Meshtastic TCP interface (library: meshtastic, class: TCPInterface)
  • Your node’s optional HTTP status endpoint: http://<mesh-host>/json/report

Data flow (incoming packets)

  1. Backend connects to your node over TCP (MESH_HOST:MESH_PORT)
  2. The meshtastic library publishes received packets on meshtastic.receive (via pypubsub)
  3. We convert every packet to a thin, JSON-safe dict (no raw bytes) and:
    • keep the last MAX_MESSAGES in memory
    • store everything in SQLite (if enabled)

Nodes

  • Live node list comes from the Meshtastic node DB (iface.nodes)
  • Node history is sampled to the DB every NODES_HISTORY_INTERVAL_SEC seconds (default 60) to avoid DB explosion

Status (“/json/report”)

  • The UI shows a nice summary of http://<mesh-host>/json/report (if your node exposes it)
  • Backend caches it for STATUS_TTL_SEC and stores a compact subset in SQLite every STATUS_HISTORY_INTERVAL_SEC

Persistence (history / database)

By default, the app creates a SQLite file:

  • meshmon.db

It stores:

  • message history (so you can scroll back)
  • per-node counters (fromCount, toCount, last RSSI/SNR, etc.)
  • node “quality over time” samples (SNR/quality/hops/lastHeard)
  • mesh connect/disconnect/error events
  • compact status samples (battery/utilization/wifi/etc.)

To disable persistence:

export STATS_DB_PATH=off
python -m meshtastic_monitor --host YOUR_MESH_IP

To reset history: stop the app and delete meshmon.db.

Security notes (important)

  • There is no login/auth. Run this only on a trusted network.
  • GET /api/device/config redacts PSKs by default.
    • GET /api/device/config?includeSecrets=1 will include secrets — do this only if you understand the risk.

API (for developers)

Quick overview:

  • GET /api/health – backend status + mesh connection status
  • GET /api/status – cached /json/report + link to the JSON
  • GET /api/nodes – live nodes (direct + relayed)
  • GET /api/messages – message history (SQLite if enabled, else memory)
  • POST /api/send – send text (optional to and channel)
  • GET /api/stats – aggregates + charts data
  • GET /api/node/<id> – combined live + persisted stats for one node
  • GET /api/nodes/history / GET /api/node/<id>/history – history samples

Example:

curl -s http://localhost:8880/api/health
curl -s http://localhost:8880/api/nodes
curl -s http://localhost:8880/api/messages?limit=20
curl -s -X POST http://localhost:8880/api/send -H 'Content-Type: application/json' -d '{"text":"hello","channel":0}'

Development (optional)

From a git checkout:

pip install -U pip
pip install -e .
pip install -r backend/requirements-dev.txt
pytest -q

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

meshtastic_monitor-0.1.6.tar.gz (55.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

meshtastic_monitor-0.1.6-py3-none-any.whl (56.7 kB view details)

Uploaded Python 3

File details

Details for the file meshtastic_monitor-0.1.6.tar.gz.

File metadata

  • Download URL: meshtastic_monitor-0.1.6.tar.gz
  • Upload date:
  • Size: 55.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for meshtastic_monitor-0.1.6.tar.gz
Algorithm Hash digest
SHA256 8130e0a191514f8ab597627553c1509b03d3dd2267a9e6e4cc1be3cdafea1f6e
MD5 23cb3449aada145d3a7a6d9beb25ddb0
BLAKE2b-256 0421e8eb09fa1d09068c68da7aa27f7892482717f9d02e2244d904b30a8e79b2

See more details on using hashes here.

File details

Details for the file meshtastic_monitor-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for meshtastic_monitor-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 00c6b5b6c8705696691d591d6b9ccfa91de5085535e95a59744362440418dc87
MD5 bcf88b15d041e2896962d23c70676940
BLAKE2b-256 a6a18fe74d34b9838edb57ed7587f7ea924b379c3f947a336f720b452b107f4f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page