mirror of
https://github.com/jorijn/meshcore-stats.git
synced 2026-03-28 17:42:55 +01:00
Add environmental telemetry collection (temperature, humidity, barometric
pressure, voltage) from both the repeater node (over LoRa) and companion
node (local serial). Telemetry is stored in the same EAV metrics table
with `telemetry.` prefix.
Key changes:
- Add TELEMETRY_ENABLED feature flag (defaults to OFF)
- Add telemetry-specific timeout/retry settings
- Create shared telemetry.py module with extract_lpp_from_payload()
and extract_telemetry_metrics() helpers
- Handle MeshCore API dict payload format: {'pubkey_pre': '...', 'lpp': [...]}
- Repeater: store status metrics BEFORE attempting telemetry (LoRa reliability)
- Companion: merge telemetry into single DB write (serial is reliable)
- Telemetry failures do NOT affect circuit breaker state
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
141 lines
4.8 KiB
Plaintext
141 lines
4.8 KiB
Plaintext
# MeshCore Stats Configuration
|
|
# Copy this file to meshcore.conf and customize for your setup:
|
|
# cp meshcore.conf.example meshcore.conf
|
|
#
|
|
# Format: KEY=value (no 'export' keyword, no spaces around '=')
|
|
# This format is compatible with both Docker env_file and shell 'source' command.
|
|
# Comments start with # and blank lines are ignored.
|
|
|
|
# =============================================================================
|
|
# Connection Settings
|
|
# =============================================================================
|
|
|
|
MESH_TRANSPORT=serial
|
|
MESH_SERIAL_PORT=/dev/ttyUSB0
|
|
# MESH_SERIAL_BAUD=115200
|
|
# MESH_DEBUG=0
|
|
|
|
# TCP transport (for macOS Docker or remote serial servers)
|
|
# MESH_TRANSPORT=tcp
|
|
# MESH_TCP_HOST=host.docker.internal
|
|
# MESH_TCP_PORT=5000
|
|
|
|
# BLE transport (Bluetooth Low Energy)
|
|
# MESH_TRANSPORT=ble
|
|
# MESH_BLE_ADDR=AA:BB:CC:DD:EE:FF
|
|
# MESH_BLE_PIN=123456
|
|
|
|
# =============================================================================
|
|
# Remote Repeater Identity
|
|
# =============================================================================
|
|
# At least REPEATER_NAME or REPEATER_KEY_PREFIX is required to identify your repeater
|
|
|
|
REPEATER_NAME=Your Repeater Name
|
|
# REPEATER_KEY_PREFIX=a1b2c3
|
|
REPEATER_PASSWORD=your-password
|
|
|
|
# =============================================================================
|
|
# Display Names (shown in UI)
|
|
# =============================================================================
|
|
|
|
REPEATER_DISPLAY_NAME=My Repeater
|
|
COMPANION_DISPLAY_NAME=My Companion
|
|
|
|
# Public key prefixes (shown below node name in sidebar, e.g., "!a1b2c3d4")
|
|
# REPEATER_PUBKEY_PREFIX=!a1b2c3d4
|
|
# COMPANION_PUBKEY_PREFIX=!e5f6g7h8
|
|
|
|
# =============================================================================
|
|
# Location Metadata (for reports and sidebar display)
|
|
# =============================================================================
|
|
|
|
REPORT_LOCATION_NAME=City, Country
|
|
REPORT_LOCATION_SHORT=City, XX
|
|
REPORT_LAT=0.0
|
|
REPORT_LON=0.0
|
|
REPORT_ELEV=0
|
|
REPORT_ELEV_UNIT=m
|
|
|
|
# =============================================================================
|
|
# Hardware Info (shown in sidebar)
|
|
# =============================================================================
|
|
|
|
REPEATER_HARDWARE=Your Repeater Model
|
|
COMPANION_HARDWARE=Your Companion Model
|
|
|
|
# =============================================================================
|
|
# Radio Configuration Presets
|
|
# =============================================================================
|
|
# Uncomment ONE preset below that matches your MeshCore configuration,
|
|
# or set custom values. These are for display purposes only.
|
|
|
|
# MeshCore EU/UK Narrow (default)
|
|
RADIO_FREQUENCY=869.618 MHz
|
|
RADIO_BANDWIDTH=62.5 kHz
|
|
RADIO_SPREAD_FACTOR=SF8
|
|
RADIO_CODING_RATE=CR8
|
|
|
|
# MeshCore EU/UK Wide
|
|
# RADIO_FREQUENCY=869.525 MHz
|
|
# RADIO_BANDWIDTH=250 kHz
|
|
# RADIO_SPREAD_FACTOR=SF10
|
|
# RADIO_CODING_RATE=CR5
|
|
|
|
# MeshCore US Standard
|
|
# RADIO_FREQUENCY=906.875 MHz
|
|
# RADIO_BANDWIDTH=250 kHz
|
|
# RADIO_SPREAD_FACTOR=SF10
|
|
# RADIO_CODING_RATE=CR5
|
|
|
|
# MeshCore US Fast
|
|
# RADIO_FREQUENCY=906.875 MHz
|
|
# RADIO_BANDWIDTH=500 kHz
|
|
# RADIO_SPREAD_FACTOR=SF7
|
|
# RADIO_CODING_RATE=CR5
|
|
|
|
# MeshCore ANZ (Australia/New Zealand)
|
|
# RADIO_FREQUENCY=917.0 MHz
|
|
# RADIO_BANDWIDTH=250 kHz
|
|
# RADIO_SPREAD_FACTOR=SF10
|
|
# RADIO_CODING_RATE=CR5
|
|
|
|
# =============================================================================
|
|
# Intervals and Timeouts
|
|
# =============================================================================
|
|
|
|
# COMPANION_STEP=60
|
|
# REPEATER_STEP=900
|
|
# REMOTE_TIMEOUT_S=10
|
|
# REMOTE_RETRY_ATTEMPTS=2
|
|
# REMOTE_RETRY_BACKOFF_S=4
|
|
|
|
# Circuit breaker settings (prevents spamming LoRa when repeater is unreachable)
|
|
# REMOTE_CB_FAILS=6
|
|
# REMOTE_CB_COOLDOWN_S=3600
|
|
|
|
# =============================================================================
|
|
# Telemetry Collection (Environmental Sensors)
|
|
# =============================================================================
|
|
# Enable telemetry collection from repeater's environmental sensors
|
|
# (temperature, humidity, barometric pressure, etc.)
|
|
# Requires sensor board attached to repeater (e.g., BME280, BME680)
|
|
# Default: 0 (disabled)
|
|
# TELEMETRY_ENABLED=1
|
|
|
|
# Telemetry-specific timeout and retry settings
|
|
# Defaults match status settings. Separate config allows tuning if telemetry
|
|
# proves problematic (e.g., firmware doesn't support it, sensor board missing).
|
|
# You can reduce these if telemetry collection is causing issues.
|
|
# TELEMETRY_TIMEOUT_S=10
|
|
# TELEMETRY_RETRY_ATTEMPTS=2
|
|
# TELEMETRY_RETRY_BACKOFF_S=4
|
|
|
|
# =============================================================================
|
|
# Paths (Native installation only)
|
|
# =============================================================================
|
|
# Docker: Leave these commented. The container uses /data/state and /out by default.
|
|
# Native: Uncomment for local cron-based installation:
|
|
# STATE_DIR=./data/state
|
|
# OUT_DIR=./out
|
|
|