/web/COM0 Afri Blanck, Engineer
Blog / 2025-09-22

PotatoMesh what and why

#meshtastic #ruby #python

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.

API endpoints

Four main ones:

MethodEndpointPurpose
GET /api/nodes?limit=100fetch recent nodes reported to the app (with their known metadata)
GET /api/messages?limit=100fetch 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/messagesAppend 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

Python ingestor in PotatoMesh

What this script does:

  1. 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.
  2. Parse each piece of data:
    • Whenever a NodeInfo or 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.
  3. 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.

  4. 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:

To try it:


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.