Prometheus exporter for MeshCore repeaters, read over the mesh: a companion (USB, BLE, or a companion identity in openHop over TCP) logs in to each repeater, asks for status and telemetry with direct packets and serves battery, temperature/humidity, noise floor, RSSI/SNR, packet counters, airtime and uptime on :9200/metrics. - meshcore_exporter.py: command line, MC_* environment or a TOML file with a password per repeater; --check reads every repeater once and exits; interval 1 h (min 15 min); a failed repeater is retried once after 3 min; contacts fetched once per round. - dashboards/: the Grafana dashboard, generated from generate.py (datasource, job and the rate window are variables; TX drawn above zero, RX below). - stack/: Docker Compose with Prometheus and Grafana provisioned, for a USB companion, or on the host network for openHop on the same machine. - systemd/: running without Docker. - README.md (Czech) and AGENTS.md for setting it up with an AI agent. - CI: lint and tests, gitleaks; PR check builds the image; single-platform images per architecture behind a Trivy gate (latest-<arch>, and X.Y.Z-<arch> with a release on tag vX.Y.Z); dependencies by Renovate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
36 lines
1.4 KiB
Bash
36 lines
1.4 KiB
Bash
# Copy to .env (git ignores it) and fill in the REPLACE_ME lines.
|
|
|
|
# --- the companion: EITHER a radio on USB (A) OR an openHop companion (B) ----
|
|
# (A) USB
|
|
MC_SERIAL=/dev/meshcore
|
|
# `ls -l /dev/serial/by-id/` -- the long name stays the same after a replug,
|
|
# /dev/ttyACM0 does not.
|
|
MC_SERIAL_HOST=/dev/serial/by-id/REPLACE_ME
|
|
# group of that port on this computer: `stat -c %g /dev/ttyACM0`
|
|
MC_SERIAL_GID=20
|
|
# (B) openHop on this machine (README "Bez vyhrazené desky"): delete the three
|
|
# MC_SERIAL* lines above and uncomment these two
|
|
# MC_TCP=127.0.0.1:5002
|
|
# COMPOSE_FILE=docker-compose.yml:docker-compose.host.yml
|
|
|
|
# amd64 = PC; arm64 = Raspberry Pi 4/5 with a 64-bit system
|
|
MC_ARCH=amd64
|
|
# latest, or a release (e.g. 1.0.0) to stay on it
|
|
MC_VERSION=latest
|
|
|
|
# --- the repeaters ------------------------------------------------------------
|
|
# Name exactly as the repeater advertises it; several: comma separated.
|
|
MC_REPEATERS=REPLACE_ME
|
|
# Admin or guest password of the repeater(s). Guest: all but external sensors.
|
|
MC_PASSWORD=REPLACE_ME
|
|
# Seconds between readings (min 900). Each reading takes ~1 s of a channel
|
|
# everyone shares. A battery does not change in minutes: an hour is plenty;
|
|
# https://meshcore.repeater.cz/nastaveni/telemetrie/
|
|
MC_INTERVAL=3600
|
|
# Czech mesh: 2 (width of route hashes in packets this radio sends)
|
|
MC_PATH_HASH_BYTES=2
|
|
|
|
# --- Grafana ------------------------------------------------------------------
|
|
GRAFANA_PASSWORD=REPLACE_ME
|
|
GRAFANA_PORT=3000
|