# marios2004/rf-mobile-controller architecture

> Architecture diagram of the GitHub repository marios2004/rf-mobile-controller, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/marios2004/rf-mobile-controller
- Repository: https://github.com/marios2004/rf-mobile-controller

## Overview

RF Mobile Controller lets a phone browser control RF testing through an ESP8266 web interface and a laptop Python backend. The backend dispatches serial commands to scanning, HackRF replay and rollback, jammer, and diagnostic workflows; it forwards progress and results back to the phone. Evil Crow control and the local h-RAT proxy are separate paths. The README documents the device topology and capabilities; sampled source confirms backend dispatch and selected controller behavior, but firmware internals and several backend paths were not sampled.

Main entry points: [`backend/server.py`](https://github.com/marios2004/rf-mobile-controller/blob/main/backend/server.py) (Serial command server), [`firmware/esp8266_controller/esp8266_controller.ino`](https://github.com/marios2004/rf-mobile-controller/blob/main/firmware/esp8266_controller/esp8266_controller.ino) (ESP8266 interface), [`backend/hackrf_controller.py`](https://github.com/marios2004/rf-mobile-controller/blob/main/backend/hackrf_controller.py) (HackRF control), [`backend/signal_processor.py`](https://github.com/marios2004/rf-mobile-controller/blob/main/backend/signal_processor.py) (Signal processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Mobile interface"]
  node_esp["ESP8266 interface"]
  node_proxy["Evil Crow web proxy<br/>[ecrf_proxy.py]"]
end

subgraph group_backend["Backend orchestration"]
  node_server["Serial command server<br/>[server.py]"]
  node_config["Backend configuration<br/>[config.py]"]
end

subgraph group_rf["RF operations"]
  node_hackrf["HackRF control"]
  node_rollback["Rollback sessions"]
  node_ecrf["Evil Crow control"]
  node_captures[("Capture files<br/>[config.py]")]
end

subgraph group_diagnostics["Diagnostics"]
  node_signal["Signal processing"]
  node_grc["GNU Radio flows"]
end

node_phone(("Phone browser"))
node_hackrf_device["HackRF One"]
node_ecrf_device["Evil Crow RF2"]

node_phone -->|"sends commands"| node_esp
node_esp -->|"relays serial"| node_server
node_server -->|"sends results"| node_esp
node_esp -->|"shows results"| node_phone
node_server -->|"uses settings"| node_config
node_server -->|"dispatches RF commands"| node_hackrf
node_server -->|"creates rollback handler"| node_rollback
node_server -->|"dispatches ECRF commands"| node_ecrf
node_server -->|"dispatches diagnostics"| node_signal
node_server -->|"forwards events"| node_hackrf
node_hackrf -->|"scans and transmits"| node_hackrf_device
node_rollback -->|"captures and replays"| node_hackrf_device
node_ecrf -->|"controls over HTTP/WS"| node_ecrf_device
node_hackrf -->|"saves IQ files"| node_captures
node_rollback -->|"stores sessions"| node_captures
node_signal -->|"writes decoded captures"| node_captures
node_signal -->|"monitors RF"| node_hackrf_device
node_grc -.->|"supports RF analysis"| node_hackrf_device
node_phone -.->|"opens local panel"| node_proxy
node_proxy -->|"proxies HTTP/WS"| node_ecrf_device

click node_esp "https://github.com/marios2004/rf-mobile-controller/blob/main/firmware/esp8266_controller/esp8266_controller.ino"
click node_server "https://github.com/marios2004/rf-mobile-controller/blob/main/backend/server.py"
click node_config "https://github.com/marios2004/rf-mobile-controller/blob/main/backend/config.py"
click node_hackrf "https://github.com/marios2004/rf-mobile-controller/blob/main/backend/hackrf_controller.py"
click node_rollback "https://github.com/marios2004/rf-mobile-controller/blob/main/backend/hackrf_controller.py"
click node_ecrf "https://github.com/marios2004/rf-mobile-controller/blob/main/backend/evil_crow_controller.py"
click node_signal "https://github.com/marios2004/rf-mobile-controller/blob/main/backend/signal_processor.py"
click node_grc "https://github.com/marios2004/rf-mobile-controller/tree/main/grc"
click node_captures "https://github.com/marios2004/rf-mobile-controller/blob/main/backend/config.py"
click node_proxy "https://github.com/marios2004/rf-mobile-controller/blob/main/ecrf_proxy.py"

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_esp,node_proxy,node_phone toneBlue
class node_server,node_config toneAmber
class node_hackrf,node_rollback,node_ecrf,node_captures toneMint
class node_signal,node_grc toneRose
class node_hackrf_device,node_ecrf_device toneIndigo
```

## Components

### Mobile interface

- [ESP8266 interface](https://github.com/marios2004/rf-mobile-controller/blob/main/firmware/esp8266_controller/esp8266_controller.ino): `firmware/esp8266_controller/esp8266_controller.ino`
- [Evil Crow web proxy](https://github.com/marios2004/rf-mobile-controller/blob/main/ecrf_proxy.py): `ecrf_proxy.py`

### Backend orchestration

- [Serial command server](https://github.com/marios2004/rf-mobile-controller/blob/main/backend/server.py): `backend/server.py`
- [Backend configuration](https://github.com/marios2004/rf-mobile-controller/blob/main/backend/config.py): `backend/config.py`

### RF operations

- [HackRF control](https://github.com/marios2004/rf-mobile-controller/blob/main/backend/hackrf_controller.py): `backend/hackrf_controller.py`
- [Rollback sessions](https://github.com/marios2004/rf-mobile-controller/blob/main/backend/hackrf_controller.py): `backend/hackrf_controller.py`
- [Evil Crow control](https://github.com/marios2004/rf-mobile-controller/blob/main/backend/evil_crow_controller.py): `backend/evil_crow_controller.py`
- [Capture files](https://github.com/marios2004/rf-mobile-controller/blob/main/backend/config.py): `backend/config.py`

### Diagnostics

- [Signal processing](https://github.com/marios2004/rf-mobile-controller/blob/main/backend/signal_processor.py): `backend/signal_processor.py`
- [GNU Radio flows](https://github.com/marios2004/rf-mobile-controller/tree/main/grc): `grc`

### Other components

- **Phone browser**
- **HackRF One**
- **Evil Crow RF2**

## Connections

- Phone browser → ESP8266 interface: sends commands (evidence: `README.md`)
- ESP8266 interface → Serial command server: relays serial (evidence: `README.md`)
- Serial command server → ESP8266 interface: sends results (evidence: `README.md`)
- ESP8266 interface → Phone browser: shows results (evidence: `README.md`)
- Serial command server → Backend configuration: uses settings (evidence: `backend/server.py`)
- Serial command server → HackRF control: dispatches RF commands (evidence: `backend/server.py`)
- Serial command server → Rollback sessions: creates rollback handler (evidence: `backend/server.py`)
- Serial command server → Evil Crow control: dispatches ECRF commands (evidence: `backend/server.py`)
- Serial command server → Signal processing: dispatches diagnostics (evidence: `backend/server.py`)
- Serial command server → HackRF control: forwards events (evidence: `backend/server.py`)
- HackRF control → HackRF One: scans and transmits (evidence: `README.md`)
- Rollback sessions → HackRF One: captures and replays (evidence: `README.md`)
- Evil Crow control → Evil Crow RF2: controls over HTTP/WS (evidence: `README.md`)
- HackRF control → Capture files: saves IQ files (evidence: `backend/hackrf_controller.py`)
- Rollback sessions → Capture files: stores sessions (evidence: `backend/hackrf_controller.py`)
- Signal processing → Capture files: writes decoded captures (evidence: `backend/signal_processor.py`)
- Signal processing → HackRF One: monitors RF (evidence: `README.md`)
- GNU Radio flows → HackRF One: supports RF analysis (evidence: `README.md`)
- Phone browser → Evil Crow web proxy: opens local panel (evidence: `ecrf_proxy.py`)
- Evil Crow web proxy → Evil Crow RF2: proxies HTTP/WS (evidence: `ecrf_proxy.py`)
