A FastAPI web application that provides a proxy interface for sending commands to drone dock devices via MQTT. Includes a web dashboard for one-click control.
- Web dashboard at
/with real-time status badges, hold-to-land button, and action controls - REST API for drone commands: landing, authority, debug mode, power, dock door, and more
- Real-time OSD status via MQTT subscription with polling endpoint
- Docker container management — restart the
dock-agentcontainer remotely - Custom commands via
POST /command - Dockerized with Docker Compose for easy deployment
- Docker and Docker Compose
- Access to an MQTT broker (default
localhost:1883) ~/infra/config.ymlwith yourdock_serial~/infra/data/identity.txt(optional) with drone name metadata
git clone <repo-url> drone-proxy
cd drone-proxyCreate the configuration file before installing:
mkdir -p ~/infra/data
cat > ~/infra/config.yml <<EOF
dock_serial: your_dock_serial_here
EOFThen build and start:
./install.shThe install script will build the Docker image (with host networking) and start the container. The dashboard will be available at http://localhost:3001.
The application reads ~/infra/config.yml (mounted into the container at /config/config.yml):
dock_serial: your_dock_serial_hereThe dock_serial is used to construct MQTT topics for your specific device.
Place a JSON file at ~/infra/data/identity.txt to set the drone name shown in the dashboard:
{"name": "My Drone"}If missing, the name defaults to "Drone".
These are configured in docker-compose.yml:
| Variable | Description | Default |
|---|---|---|
CONFIG_PATH |
Path to config.yml inside the container | /config/config.yml |
IDENTITY_PATH |
Path to identity.txt inside the container | /config/identity.txt |
MQTT_BROKER |
MQTT broker hostname | localhost |
MQTT_PORT |
MQTT broker port | 1883 |
MQTT_USER |
MQTT username | eyesatop |
MQTT_PASS |
MQTT password | eyesatop |
| Method | Path | Description |
|---|---|---|
| GET | /land |
Force-land the drone (DRC drc_force_landing) |
| GET | /authority |
Grab control authority (DRC drc_authority_grab) |
| Method | Path | Description |
|---|---|---|
| GET | /enter_debug_mode |
Enter debug mode (debug_mode_open) |
| GET | /exit_debug_mode |
Exit debug mode (debug_mode_close) |
| GET | /power_on_drone |
Power on the drone (drone_open) |
| GET | /power_off_drone |
Power off the drone (drone_close) |
| GET | /open_dock_door |
Open dock cover (cover_open) |
| GET | /close_dock_door |
Close dock cover (cover_close) |
| Method | Path | Description |
|---|---|---|
| GET | /status |
Parsed device status (MQTT connection, OSD data, mode, cover state, etc.) |
| GET | /status/raw |
Full accumulated OSD state for debugging |
| Method | Path | Description |
|---|---|---|
| POST | /restart-dock-agent |
Restart the dock-agent Docker container |
| POST | /command |
Send an arbitrary command JSON body via MQTT |
| Method | Path | Description |
|---|---|---|
| GET | / |
Web dashboard with real-time controls and status |
docker compose up -d # start
docker compose down # stop
docker compose up -d --build # rebuild and start
docker compose logs -f # view logs- The FastAPI application starts inside a Docker container on port 3001
- On startup it reads the
dock_serialfrom the mountedconfig.ymland the drone name fromidentity.txt - Connects to the MQTT broker, subscribes to the OSD topic (
thing/product/{dock_serial}/osd), and keeps the connection alive with automatic reconnection - OSD messages are accumulated into an in-memory state that powers the
/statusendpoint and the dashboard badges - API calls publish commands to
thing/product/{dock_serial}/drc/down(DRC) orthing/product/{dock_serial}/services(dock services) - The Docker socket is mounted so the app can restart the
dock-agentcontainer on demand