Files
pilot/scripts/start_mqtt_broker.sh
Gilles Soulier c5381b7112 Pilot v2: Core implementation + battery telemetry
Major updates:
- Complete Rust rewrite (pilot-v2/) with working MQTT client
- Fixed MQTT event loop deadlock (background task pattern)
- Battery telemetry for Linux (auto-detected via /sys/class/power_supply)
- Home Assistant auto-discovery for all sensors and switches
- Comprehensive documentation (AVANCEMENT.md, CLAUDE.md, roadmap)
- Docker test environment with Mosquitto broker
- Helper scripts for development and testing

Features working:
 MQTT connectivity with LWT
 YAML configuration with validation
 Telemetry: CPU, memory, IP, battery (Linux)
 Commands: shutdown, reboot, sleep, screen (dry-run tested)
 HA discovery and integration
 Allowlist and cooldown protection

Ready for testing on real hardware.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 06:23:00 +01:00

29 lines
768 B
Bash
Executable File

#!/usr/bin/env bash
# Start MQTT broker for development and testing
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"
echo "Starting Mosquitto MQTT broker..."
docker compose -f docker-compose.dev.yml up -d
echo "Waiting for broker to be ready..."
sleep 2
echo "Testing broker connection..."
docker exec pilot-mosquitto mosquitto_sub -t test -C 1 &
sleep 1
docker exec pilot-mosquitto mosquitto_pub -t test -m "Hello"
echo ""
echo "✅ MQTT broker is running!"
echo " Broker: localhost:1883"
echo " WebSocket: localhost:9001"
echo ""
echo "To monitor all messages:"
echo " docker exec pilot-mosquitto mosquitto_sub -v -t '#'"
echo ""
echo "To stop the broker:"
echo " docker compose -f docker-compose.dev.yml down"