PotatoMesh what and why
I have been hacking on PotatoMesh for the last couple of weeks and here are some insights. I'll give you a technical sketch: how it works, how it plugs into Meshtastic, what data flows where, and how you can run your own. (Spoiler: it's white label!)
Why a tool like PotatoMesh is needed
Meshtastic gives you resilient, off-grid mesh networks using LoRa. But by itself, it's hard to get a global view of what's going on in a community mesh: who is alive, how many hops, where are telemetry gaps, which radios are misbehaving. During "quiet" times, we need visibility so that when crisis or scale hits, debugging, preparation, and maintenance are possible. PotatoMesh is one of the tools I built for that.
Architecture of PotatoMesh: Ruby web app + Python ingestor
At its core, the PotatoMesh web app is simple: a SQLite database live on a server. It does not poll the mesh, nor listen on LoRa directly. It knows nothing until someone reports mesh data (nodes, messages, positions, etc.) via its API endpoints. The API is the only inlet for the mesh state of the web app.
- Database: SQLite, storing node records, message history, telemetry (as reported).
- Web UI: map view, chat/message view, table of nodes; search / filter; first-seen new node alerts. Authenticated POSTs feed it; GETs allow inspection.
API endpoints
Four main ones:
| Method | Endpoint | Purpose |
|---|---|---|
GET /api/nodes?limit=100 | fetch recent nodes reported to the app (with their known metadata) | |
GET /api/messages?limit=100 | fetch recent messages seen in the mesh (chats, reactions, etc.) | |
POST /api/nodes | "Upsert" nodes: send node data (JSON); requires Authorization: Bearer <API_TOKEN> | |
POST /api/messages | Append new messages (JSON); requires same auth token |
The API_TOKEN environment variable must be set (non-empty) on the web app to allow POSTs. GETs are open (or less restricted).
Inner workings: Meshtastic protocol, data ingestion
To fill those API endpoints, PotatoMesh uses a Python ingestor script ("mesh.sh" + supporting code under ./data/) which connects to a local Meshtastic node over a serial or TCP port. Here's outline of how data flows and is processed.
Meshtastic protocol basics
- Meshtastic devices communicate via encrypted protobufs: structured message definitions. These define things like
NodeInfo,MyNodeInfo,User, messages, telemetry, positions, etc. - To talk to a Meshtastic node over USB/serial/TCP/BLE, there is a Client API. In that API:
- When a client connects, it typically sends a startConfig (or
want_config_id) protobuf to ask for the current NodeDB (nodes in mesh seen), the radio settings, user info, etc. - The node replies with a stream of
FromRadioprotobuf messages: first the configuration (radio config, user, mynode), then the last 80 knownNodeInforecords, ending with an end-config marker. After that, mesh messages, positions, telemetry, etc.
- When a client connects, it typically sends a startConfig (or
- Over serial or TCP, there is framing: i.e., Meshtastic uses a 4-byte header (START1=0x94, START2=0xc3, then two bytes length) to wrap each protobuf packet in streaming transports. If the stream is unreliable / loses bytes, there is synchronization logic.
- Telemetry: nodes periodically report telemetry data (battery, environment, etc.) via defined protobuf messages. Also messages (text, chat), and node status / location / GPS.
Python ingestor in PotatoMesh
What this script does:
- Connect to a Meshtastic node on a serial port (e.g.,
/dev/ttyACM0), using the Meshtastic Python library. It sets things so that it receives the node database (NodeInfo etc.) and ongoing messages / telemetry as the mesh node sees them. - Parse each piece of data:
- Whenever a
NodeInfoor similar node status protobuf arrives, it constructs a "node" record (node ID, short name, etc.). - Whenever a message or telemetry arrives, collect the message: who from, to (broadcast or specific), type (text / telemetry / etc.), payload.
- Whenever a
- POST to the web app's endpoints:
- Node updates via
POST /api/nodes - Message / telemetry / chat data via
POST /api/messages
The tool (via environment variables) knows the instance URL and API token to use. The web app ensures deduplication on node IDs etc., so repeated reports of the same node do not create duplicates.
- Node updates via
- Continuous listening / looping: the ingestor sits waiting for new protobuf messages via the serial stream. When new messages show up, they're parsed & forwarded. In debug mode you can see logs like "upserted node …" or "stored message …" etc. Just set "DEBUG=1".
Summary & running
You get:
- A remote-web dashboard that visualizes mesh health: nodes, messages, first-seen, map, etc.
- A python serial ingestor that feeds it. Without that, nothing appears.
- Simple architecture: no MQTT broker, no huge infrastructure. Just serial + HTTP + SQLite.
To try it:
- Demo is live at potatomesh.net for Berlin #MediumFast on 868MHz.
- Instructions in the README: using Docker / docker-compose to launch the web app; configure environment (
API_TOKEN, etc.). Then run the python ingestor withPOTATOMESH_INSTANCE=<url> API_TOKEN=<token> MESH_SERIAL=<serial port> DEBUG=1 ./mesh.shetc.
Call to action
Run your own PotatoMesh. Hook a Meshtastic node (or several), run the ingestor, set up the web app, and suddenly you don't fly blind. Debug routing, telemetry, battery, nodes that drop out, hops that get too high.