# naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform architecture

> Architecture diagram of the GitHub repository naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform
- Repository: https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform

## Overview

#### 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/rpi_drone_bridge.py`](https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/rpi/rpi_drone_bridge.py) (RPi drone bridge), [`Obsidian Vault/RPI Drone Bridge.md`](https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/Obsidian%20Vault/RPI%20Drone%20Bridge.md) (Wi-Fi TCP channel), [`laptop/laptop_gcs.py`](https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/laptop/laptop_gcs.py) (Laptop GCS), [`laptop2_attacker/full_attack.py`](https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/laptop2_attacker/full_attack.py) (Full attack orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_vehicle["Vehicle runtime"]
  node_bridge["RPi drone bridge<br/>Python vehicle runtime"]
  node_mavlink["UART MAVLink boundary<br/>serial transport"]
  node_vehicle_telemetry["Vehicle telemetry<br/>state and health signals"]
  node_flight_actions["Flight actions<br/>constrained command set"]
  node_operations["Provisioning and deployment<br/>operations tooling<br/>[setup.sh]"]
end

subgraph group_ground["Ground control"]
  node_browser["Local dashboard<br/>browser UI<br/>[index.html]"]
  node_gcs["Laptop GCS<br/>Python orchestration<br/>[laptop_gcs.py]"]
  node_voice_text["Voice and text intake<br/>command interface<br/>[laptop_gcs.py]"]
  node_health["Health and anomaly view<br/>monitoring<br/>[laptop_gcs.py]"]
end

subgraph group_adversary["Adversarial simulation"]
  node_attacker_orchestrator["Full attack orchestrator<br/>Python simulation<br/>[full_attack.py]"]
  node_command_injection["Command injection<br/>attack simulation<br/>[cmd_injector.py]"]
  node_telemetry_spoofing["Telemetry spoofing<br/>attack simulation"]
end

node_operator(("Operator<br/>human"))
node_tcp_channel["Wi-Fi TCP channel<br/>telemetry and command link"]
node_pixhawk{{"Pixhawk flight controller"}}
node_rc["RC manual override<br/>independent control path"]

node_operator -->|"uses"| node_browser
node_browser -->|"local HTTP :5000"| node_gcs
node_operator -->|"speaks or types"| node_voice_text
node_voice_text -->|"normalized request"| node_gcs
node_gcs -->|"commands and connection"| node_tcp_channel
node_tcp_channel -->|"TCP client traffic"| node_bridge
node_bridge -->|"telemetry and health"| node_tcp_channel
node_tcp_channel -->|"telemetry stream"| node_gcs
node_gcs -->|"presents alerts"| node_health
node_bridge -->|"acquires"| node_vehicle_telemetry
node_bridge -->|"applies received commands"| node_flight_actions
node_bridge -->|"DroneKit/pymavlink"| node_mavlink
node_mavlink -->|"UART MAVLink"| node_pixhawk
node_flight_actions -->|"control requests"| node_pixhawk
node_pixhawk -->|"state signals"| node_vehicle_telemetry
node_rc -->|"manual override"| node_pixhawk
node_attacker_orchestrator -->|"coordinates"| node_command_injection
node_attacker_orchestrator -->|"coordinates"| node_telemetry_spoofing
node_command_injection -.->|"targets"| node_tcp_channel
node_telemetry_spoofing -.->|"targets"| node_tcp_channel
node_operations -->|"provisions"| node_bridge

click node_browser "https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/laptop/templates/index.html"
click node_gcs "https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/laptop/laptop_gcs.py"
click node_voice_text "https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/laptop/laptop_gcs.py"
click node_health "https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/laptop/laptop_gcs.py"
click node_tcp_channel "https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/Obsidian%20Vault/RPI%20Drone%20Bridge.md"
click node_bridge "https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/rpi/rpi_drone_bridge.py"
click node_mavlink "https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/docs/HARDWARE_CONNECTIONS.md"
click node_vehicle_telemetry "https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/rpi/rpi_drone_bridge.py"
click node_flight_actions "https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/rpi/rpi_drone_bridge.py"
click node_attacker_orchestrator "https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/laptop2_attacker/full_attack.py"
click node_command_injection "https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/laptop2_attacker/cmd_injector.py"
click node_telemetry_spoofing "https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/laptop2_attacker/telemetry_spoofer.py"
click node_operations "https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/rpi/setup.sh"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_bridge,node_mavlink,node_vehicle_telemetry,node_flight_actions,node_operations toneBlue
class node_browser,node_gcs,node_voice_text,node_health toneAmber
class node_attacker_orchestrator,node_command_injection,node_telemetry_spoofing toneMint
class node_operator,node_tcp_channel,node_pixhawk,node_rc toneNeutral
```

## Components

### Vehicle runtime

Raspberry Pi bridge and flight-control boundary.

- [RPi drone bridge](https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/rpi/rpi_drone_bridge.py): Python vehicle runtime · Sole software bridge between network control and Pixhawk MAVLink. · `rpi/rpi_drone_bridge.py`
- [UART MAVLink boundary](https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/docs/HARDWARE_CONNECTIONS.md): serial transport · Pi UART connection to the flight controller. · `docs/HARDWARE_CONNECTIONS.md`
- [Vehicle telemetry](https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/rpi/rpi_drone_bridge.py): state and health signals · Battery, GPS, flight state, and anomaly-relevant signals. · `rpi/rpi_drone_bridge.py`
- [Flight actions](https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/rpi/rpi_drone_bridge.py): constrained command set · Arm, takeoff, land, RTL, loiter, emergency land, and mode changes. · `rpi/rpi_drone_bridge.py`
- [Provisioning and deployment](https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/rpi/setup.sh): operations tooling · Sets up and deploys the Pi runtime. · `rpi/setup.sh`

### Ground control

Laptop orchestration and operator interface.

- [Local dashboard](https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/laptop/templates/index.html): browser UI · `laptop/templates/index.html`
- [Laptop GCS](https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/laptop/laptop_gcs.py): Python orchestration · Combines dashboard, command interpretation, and Pi TCP client. · `laptop/laptop_gcs.py`
- [Voice and text intake](https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/laptop/laptop_gcs.py): command interface · Converts operator requests into constrained flight actions. · `laptop/laptop_gcs.py`
- [Health and anomaly view](https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/laptop/laptop_gcs.py): monitoring · Shows telemetry, battery, GPS, and anomaly-oriented alerts. · `laptop/laptop_gcs.py`

### Adversarial simulation

Separate laptop project for resilience testing.

- [Full attack orchestrator](https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/laptop2_attacker/full_attack.py): Python simulation · Coordinates attacks against communications and telemetry. · `laptop2_attacker/full_attack.py`
- [Command injection](https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/laptop2_attacker/cmd_injector.py): attack simulation · `laptop2_attacker/cmd_injector.py`
- [Telemetry spoofing](https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/laptop2_attacker/telemetry_spoofer.py): attack simulation · `laptop2_attacker/telemetry_spoofer.py`

### Other components

- **Operator**: human
- [Wi-Fi TCP channel](https://github.com/naushikmaurya/uav-cyber-physical-system-flight-monitoring-platform/blob/main/Obsidian%20Vault/RPI%20Drone%20Bridge.md): telemetry and command link · Default bridge listener is documented as port 5760. · `Obsidian Vault/RPI Drone Bridge.md`
- **Pixhawk flight controller**: flight controller · Executes MAVLink actions and retains onboard failsafe behavior.
- **RC manual override**: independent control path · Remains available independently of Wi-Fi and GCS.

## Connections

- 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
