How naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform works
Purpose and deployment model
This is a distributed Python voice-control ground station for a Pixhawk-class drone. A Raspberry Pi on the vehicle bridges UART/MAVLink telemetry and commands to a laptop over Wi-Fi TCP; the laptop exposes a local browser dashboard and voice/text control. RC remains an independent manual-override path.
Core entry points: START_SYSTEM.ps1, rpi/rpi_drone_bridge.py, and laptop/laptop_gcs.py.
On-drone bridge and flight-controller boundary
rpi/rpi_drone_bridge.py is the vehicle-side runtime. It connects to the flight controller through the Pi UART (typically /dev/ttyAMA0), using DroneKit/pymavlink, and owns the physical MAVLink boundary: vehicle state acquisition plus execution of received flight commands.
Relevant paths:
• rpi/rpi_drone_bridge.py
• rpi/pyproject.toml
• docs/HARDWARE_CONNECTIONS.md
The Pi’s serial configuration and separate power requirements are deployment-critical because this process is the sole software path between network control and Pixhawk telemetry/control.
Network telemetry and command channel
The Pi hosts a TCP listener (documented default 5760) for the laptop GCS. The laptop connects using the RPi address/port, receives telemetry and health information, and sends normalized control requests back through this channel. This creates a clear trust and failure boundary: Wi-Fi loss separates the laptop UI from vehicle control, while onboard flight-controller and RC behavior remain available.
Relevant paths:
• rpi/rpi_drone_bridge.py
• laptop/laptop_gcs.py
• Obsidian Vault/RPI Drone Bridge.md
Ground-control server and dashboard
laptop/laptop_gcs.py is the laptop-side orchestration process. It combines the TCP client to the Pi with a local HTTP server (documented default 5000) that serves the operator dashboard. It is the integration point for connection state, telemetry presentation, command history, voice/text command intake, and forwarding commands to the bridge.
Relevant paths:
• laptop/laptop_gcs.py
• laptop/templates/index.html
• laptop/pyproject.toml
The browser is an operator interface only; flight interaction crosses the separate laptop-to-Pi TCP channel.
Command interpretation and flight actions
Voice commands and typed dashboard commands map to a constrained action set: arm/disarm, takeoff, land, RTL, hover/loiter, emergency land, and flight-mode changes. The GCS handles user-facing interpretation; the Pi bridge applies commands through DroneKit/MAVLink to the flight controller. Safety-sensitive actions ultimately depend on the vehicle-side bridge and Pixhawk mode/failsafe behavior.
Relevant paths:
• laptop/laptop_gcs.py
• rpi/rpi_drone_bridge.py
• Obsidian Vault/Voice Commands.md
Health monitoring and anomaly awareness
Telemetry is used for real-time health tracking and alerts, including battery, GPS, spoofing/jamming-oriented anomaly concerns described by the project. Monitoring crosses from onboard vehicle signals to the laptop dashboard; the laptop is the visualization/control plane, not the sensor source.
Relevant paths:
• rpi/rpi_drone_bridge.py
• laptop/laptop_gcs.py
• Obsidian Vault/Project Architecture.md
Adversarial simulation subsystem
A separate laptop2_attacker Python project models attacks against the drone communications/telemetry environment, including scanning, sniffing, command injection, telemetry spoofing, and an orchestrated full attack. It is distinct from normal GCS operation and is useful for validating monitoring and resilience boundaries.
Relevant paths:
• laptop2_attacker/full_attack.py
• laptop2_attacker/cmd_injector.py
• laptop2_attacker/telemetry_spoofer.py>
Runtime and operations
Python 3.8+ is the primary runtime, with DroneKit, pymavlink, pyserial, and requests on the Pi; laptop and attacker environments are managed independently with pyproject.toml/UV lockfiles. RPi provisioning is shell-based; laptop startup supports PowerShell. Operational support scripts handle SSH, deployment, diagnostics, and Raspberry Pi remediation.
Relevant paths:
• rpi/setup.sh
• laptop/setup.ps1
• tools/rpi_push.py
Main entry points: rpi_drone_bridge.py RPi drone bridge · RPI Drone Bridge.md Wi-Fi TCP channel · laptop_gcs.py Laptop GCS · full_attack.py Full attack orchestrator
Components 16
Vehicle runtime
Raspberry Pi bridge and flight-control boundary.
- RPi drone bridge · Sole software bridge between network control and Pixhawk MAVLink.
rpi/rpi_drone_bridge.py - UART MAVLink boundary · Pi UART connection to the flight controller.
docs/HARDWARE_CONNECTIONS.md - Vehicle telemetry · Battery, GPS, flight state, and anomaly-relevant signals.
rpi/rpi_drone_bridge.py - Flight actions · Arm, takeoff, land, RTL, loiter, emergency land, and mode changes.
rpi/rpi_drone_bridge.py - Provisioning and deployment · Sets up and deploys the Pi runtime.
rpi/setup.sh
Ground control
Laptop orchestration and operator interface.
- Local dashboard
laptop/templates/index.html - Laptop GCS · Combines dashboard, command interpretation, and Pi TCP client.
laptop/laptop_gcs.py - Voice and text intake · Converts operator requests into constrained flight actions.
laptop/laptop_gcs.py - Health and anomaly view · Shows telemetry, battery, GPS, and anomaly-oriented alerts.
laptop/laptop_gcs.py
Adversarial simulation
Separate laptop project for resilience testing.
- Full attack orchestrator · Coordinates attacks against communications and telemetry.
laptop2_attacker/full_attack.py - Command injection
laptop2_attacker/cmd_injector.py - Telemetry spoofing
laptop2_attacker/telemetry_spoofer.py
Other components
- Operator
- Wi-Fi TCP channel · Default bridge listener is documented as port 5760.
Obsidian Vault/RPI Drone Bridge.md - Pixhawk flight controller · Executes MAVLink actions and retains onboard failsafe behavior.
- RC manual override · Remains available independently of Wi-Fi and GCS.
Connections 21
- Operator → Local dashboard: uses
- Local dashboard → Laptop GCS: local HTTP :5000
- Operator → Voice and text intake: speaks or types
- Voice and text intake → Laptop GCS: normalized request
- Laptop GCS → Wi-Fi TCP channel: commands and connection
- Wi-Fi TCP channel → RPi drone bridge: TCP client traffic
- RPi drone bridge → Wi-Fi TCP channel: telemetry and health
- Wi-Fi TCP channel → Laptop GCS: telemetry stream
- Laptop GCS → Health and anomaly view: presents alerts
- RPi drone bridge → Vehicle telemetry: acquires
- RPi drone bridge → Flight actions: applies received commands
- RPi drone bridge → UART MAVLink boundary: DroneKit/pymavlink
- UART MAVLink boundary → Pixhawk flight controller: UART MAVLink
- Flight actions → Pixhawk flight controller: control requests
- Pixhawk flight controller → Vehicle telemetry: state signals
- RC manual override → Pixhawk flight controller: manual override
- Full attack orchestrator → Command injection: coordinates
- Full attack orchestrator → Telemetry spoofing: coordinates
- Command injection → Wi-Fi TCP channel: targets
- Telemetry spoofing → Wi-Fi TCP channel: targets
- Provisioning and deployment → RPi drone bridge: provisions