Alex Vanderpot 0265a900a0 Decode advert node type as enum; add sensor type; drop empty packets
The advert app_data flags byte (Core Protocol §2.8.3) uses split encoding:
the low 4 bits are an integer node-type enum (1=chat/companion, 2=repeater,
3=room server, 4=sensor) and the high 4 bits are independent presence flags.
The decode treated the type as independent bit flags, so a room server (type
3 = 0b0011) matched is_chat_node, is_repeater AND is_room_server at once, and
a sensor (type 4) matched none and rendered as an untyped node.

Migration 008 fixes the derivation in the meshcore_adverts / meshcore_adverts_latest
views (read-time only, retroactive over all history), adds is_sensor and a
node_type column, and carries neighbor_is_sensor onto the direct-neighbor graph.
The UI gains a sensor badge across the node page, node cards, and advert details,
and search/streaming/node queries expose is_sensor.

Ingest: drop envelopes whose decoded packet has zero bytes instead of storing
them. They decode to an empty payload and a degenerate packet_hash and carry no
signal; dropped rows are counted and logged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 15:10:07 -04:00

MeshExplorer

A real-time map, chat client, and packet-analysis tool for MeshCore mesh networks. This repository ships the whole stack so it can be brought up with a single docker compose up:

Component Path Description
Web app meshexplorer/ Next.js UI + API (map, chat, stats, packet analysis)
Ingest + DB ingest/ Go MeshCore MQTT→ClickHouse ingest, ClickHouse image, and SQL migrations
Discord relay meshexplorer/ (Dockerfile.bot) Optional bot that relays MeshCore channel messages to Discord
Grafana grafana/ Dashboards with a pre-provisioned ClickHouse datasource (read-only user), on 127.0.0.1:3000

Architecture

                MQTT brokers (you configure)
                          │
                          ▼
   ┌──────────────┐   ┌──────────────┐
   │ meshcoreingest│──▶│  ClickHouse  │◀── migrate (one-shot, applies schema)
   └──────────────┘   └──────┬───────┘
                             │ (readonly user)
                  ┌──────────┴──────────┐
                  ▼              ▼              ▼
            meshexplorer     discord-bot      grafana
            (web UI :3001)   (--profile bot)  (:3000)

Quick start

Requirements: Docker + Docker Compose.

cp .env.example .env
# Edit .env — at minimum set:
#   CLICKHOUSE_PASSWORD   (read/write user, used by ingest + migrations)
#   MQTT_BROKERS          (JSON array of meshcore MQTT brokers to ingest from)
# Optional, for the Discord relay: DISCORD_WEBHOOK_URL (+ run with --profile bot)

docker compose up --build

Then open http://localhost:3001.

Startup order is handled automatically: ClickHouse becomes healthy → migrate applies the schema and exits → meshcoreingest and meshexplorer start.

To also run the Discord relay:

docker compose --profile bot up --build

Configuration

All configuration is via environment variables in .env (see .env.example for the full list and defaults). Highlights:

  • ClickHouse — two accounts. The read/write default user (CLICKHOUSE_PASSWORD) is used by the ingest daemon and the migration runner; the readonly user (CLICKHOUSE_READONLY_PASSWORD) is used by the web app and the Discord bot. ClickHouse is only published to 127.0.0.1 for debugging and is otherwise reachable only on the internal meshnet network.
  • MQTT_BROKERS — a JSON array; each entry is { "url", "username", "password", "topics" } (topics defaults to ["meshcore/#"]). The ingest daemon exits with a clear error if this is unset, so configure at least one broker.

Development

Each component can be run on its own:

Security notes

  • .env is gitignored — keep real credentials out of version control.
  • If you previously used the bundled defaults, rotate any secrets before going to production.
S
Description
No description provided
Readme 1.2 MiB
Languages
TypeScript 83.6%
Go 10.1%
JavaScript 3.7%
CSS 1.6%
Dockerfile 0.8%
Other 0.2%