MeshCore Kommando-Bot mit Webinterface (Python, TCP-Companion, aiohttp Dashboard)
  • Python 51.9%
  • HTML 19.1%
  • JavaScript 17.2%
  • CSS 10.8%
  • Shell 1%
Find a file
2026-03-09 17:00:50 +00:00
bot fix: is_connected ist @property, nicht Methode – Klammern entfernt 2026-03-09 17:00:50 +00:00
static fix: diverse Fehler behoben, Unterseiten fertiggestellt 2026-03-09 16:03:06 +00:00
.gitignore chore: virtualenv-Setup (setup.sh, service, gitignore, README) 2026-03-09 07:44:18 +00:00
config.example.yaml feat: Serial-Verbindung (USB) als Alternative zu TCP 2026-03-09 16:57:20 +00:00
main.py feat: Bootstrap/Tabler UI mit ausgelagerten HTML-Seiten und Themewahl 2026-03-09 16:01:55 +00:00
meshcore-bot.service chore: virtualenv-Setup (setup.sh, service, gitignore, README) 2026-03-09 07:44:18 +00:00
README.md chore: virtualenv-Setup (setup.sh, service, gitignore, README) 2026-03-09 07:44:18 +00:00
requirements.txt feat: Webinterface (aiohttp, WebSocket Dashboard) 2026-03-09 07:38:56 +00:00
setup.sh chore: virtualenv-Setup (setup.sh, service, gitignore, README) 2026-03-09 07:44:18 +00:00

meshcore-bot-web

MeshCore Kommando-Bot (Python, TCP-Companion) mit Webinterface.

Basiert auf meshcore-bot erweitert um ein aiohttp-basiertes Echtzeit-Dashboard mit WebSocket.

Features

  • Bot: TCP-Verbindung zum Companion-Radio, Kommandos via ?-Prefix
  • Webinterface: Terminal-Dashboard unter http://<pi>:8080
    • Echtzeit-Nachrichten via WebSocket
    • Kontaktliste mit Aktivitätsstatus
    • Nachrichten senden (Kanal & Direktnachricht)
    • Live-Log + Statistiken

Voraussetzungen

  • Python 3.10+
  • Heltec V3 / RAK / Xiao mit WiFi-Companion-Firmware
  • Companion-Radio im gleichen Netzwerk wie der Raspberry Pi

Installation

git clone https://git.pfeiffer-privat.de/ppfeiffer/meshcore-bot-web.git
cd meshcore-bot-web

# Virtualenv einrichten + Abhängigkeiten installieren
bash setup.sh

# Konfiguration anpassen
cp config.example.yaml config.yaml
nano config.yaml

Manuell (ohne setup.sh)

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Starten

# mit venv
venv/bin/python main.py

# oder nach activate
source venv/bin/activate
python main.py

Webinterface erreichbar unter: http://localhost:8080

Kommandos

Kommando Beschreibung
?ping Erreichbarkeitstest mit SNR
?info Bot-Version, Node-ID, Uptime
?wetter Wetter für Standardort (Dresden)
?wetter 01067 Wetter für PLZ
?nodes Anzahl bekannter Nodes
?mesh Mesh-Statistik
?me Eigene Node-Infos
?zeit Aktuelle Uhrzeit
?hilfe Alle Kommandos

Optionen

python main.py --config config.yaml   # Konfigurationsdatei
python main.py --no-web               # ohne Webinterface
python main.py --web-port 9090        # anderen Port
python main.py --web-host 127.0.0.1   # nur lokal

Systemd-Dienst

sudo cp meshcore-bot.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now meshcore-bot
journalctl -fu meshcore-bot

Der Service nutzt automatisch das venv/ im Projektverzeichnis.

Erweiterung

Neue Kommandos in bot/commands.py mit dem @command("name")-Dekorator:

@command("hallo")
async def cmd_hallo(ctx, args, mc, cfg):
    return f"👋 Hallo {ctx.from_name}!"

Architektur

meshcore-bot-web/
├── main.py              Einstiegspunkt (Bot + Webserver)
├── setup.sh             Installationsskript (venv)
├── requirements.txt     Abhängigkeiten
├── config.example.yaml  Konfigurationsvorlage
├── meshcore-bot.service systemd Unit
└── bot/
    ├── core.py          MeshCoreBot (TCP, Events, Dispatch)
    ├── commands.py      Kommando-Registry (@command Dekorator)
    ├── config.py        YAML-Konfiguration (Dot-Notation)
    └── web.py           WebSocketHub + BotWebServer (aiohttp)