The capture database
Your history, in SQLite
What gets captured
Coop write-through captures everything it decodes into a single SQLite file:
| Table | Contents |
|---|---|
packets | Every packet: time, from/to, portnum, channel, SNR/RSSI, hop counts, size, decoded text where applicable. |
messages | Chat: direction, channel, text, tapback/reply linkage, DM flag, delivery status. |
nodes | The roster: names, hardware, role, last position, battery/voltage, distance/bearing from home, first/last seen. |
The radio itself remembers almost nothing (a node list and a small buffer) — the capture file is your history. On startup Coop rehydrates recent packets, messages, and the full roster from it, so restarts don't blank the dashboard.
Where it lives, how to change it
Default: ~/Documents/Coop/mesh.db (same idea on Windows: Documents\Coop).
Change it live from Coop's status page (http://127.0.0.1:2667 → Capture database
card), which persists to coop.json — no restart needed. Or configure directly:
# ~/.config/coop/coop.json
{ "dbPath": "~/Documents/Coop/mesh.db", "retentionDays": 30 }
# env always wins:
MESH_DB=/somewhere/else/mesh.db MESH_RETENTION_DAYS=90
# memory-only (nothing written to disk):
"dbPath": "off" # or MESH_DB=off
Retention
Every 6 hours Coop purges packets/messages older than retentionDays
(default 30) and vacuums to reclaim disk. Nodes are kept forever — the roster is small and
valuable. Set retention to 0… actually, don't: a month of a busy city mesh is
tens of megabytes. Disk is cheap; raise it instead if you want deeper history.
It's yours — query it
WAL-mode SQLite: one writer (Coop), any number of readers, safe to back up by copying the file. Some starters:
sqlite3 ~/Documents/Coop/mesh.db
-- busiest nodes this week
SELECT from_name, COUNT(*) n FROM packets
WHERE t > strftime('%s','now')-604800
GROUP BY from_id ORDER BY n DESC LIMIT 15;
-- your chat history, newest first
SELECT datetime(t,'unixepoch','localtime'), from_name, text
FROM messages ORDER BY t DESC LIMIT 50;
-- who have we ever heard, farthest first
SELECT long_name, distance_km FROM nodes
WHERE distance_km IS NOT NULL ORDER BY distance_km DESC LIMIT 20;