MeshCore Kommando-Bot mit Webinterface (Python, TCP-Companion, aiohttp Dashboard)
- Python 51.9%
- HTML 19.1%
- JavaScript 17.2%
- CSS 10.8%
- Shell 1%
| bot | ||
| static | ||
| .gitignore | ||
| config.example.yaml | ||
| main.py | ||
| meshcore-bot.service | ||
| README.md | ||
| requirements.txt | ||
| setup.sh | ||
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)