# dariozip/wardriving-esp32-c3 architecture

> Architecture diagram of the GitHub repository dariozip/wardriving-esp32-c3, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dariozip/wardriving-esp32-c3
- Repository: https://github.com/dariozip/wardriving-esp32-c3

## Overview

This is ESP32 firmware for a portable Wi-Fi and GPS survey device. Its intended workflow is to scan nearby networks, associate observations with GPS position, and save information to microSD; the sampled code shows Wi-Fi scanning and serial reporting, GPS input, display rendering, and SD-card setup/file operations. It does not show hashing network names or saving scan/GPS results to the card, so those intended links are not represented as implemented. The main loop coordinates features and timed updates. Some setup and loop code is omitted, so only visible calls and documented capabilities are shown.

Main entry points: [`src/main.cpp`](https://github.com/dariozip/wardriving-esp32-c3/blob/main/src/main.cpp) (Firmware runtime), [`src/wifiModule.cpp`](https://github.com/dariozip/wardriving-esp32-c3/blob/main/src/wifiModule.cpp) (Wi-Fi scanning), [`src/displayPopulate.cpp`](https://github.com/dariozip/wardriving-esp32-c3/blob/main/src/displayPopulate.cpp) (Screen rendering), [`include/main.h`](https://github.com/dariozip/wardriving-esp32-c3/blob/main/include/main.h) (State and features)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Device control"]
  node_runtime["Firmware runtime<br/>[main.cpp]"]
  node_config["State and features<br/>[main.h]"]
end

subgraph group_sensing["Sensing"]
  node_wifi["Wi-Fi scanning<br/>[wifiModule.cpp]"]
  node_position["GPS position<br/>[main.cpp]"]
end

subgraph group_output["Output and storage"]
  node_display["Screen rendering"]
  node_sdops["SD file operations<br/>[main.cpp]"]
  node_serial["Serial reporting<br/>[wifiModule.cpp]"]
end

node_networks(("Nearby networks"))
node_gps(("GPS receiver"))
node_screen["OLED display"]
node_card[("MicroSD card")]

node_runtime -->|"initializes"| node_wifi
node_runtime -->|"starts scans"| node_wifi
node_runtime -->|"checks results"| node_wifi
node_wifi -->|"scans"| node_networks
node_wifi -->|"reports results"| node_serial
node_runtime -->|"reads GPS input"| node_position
node_gps -->|"sends GPS data"| node_position
node_runtime -->|"refreshes"| node_display
node_display -->|"renders"| node_screen
node_runtime -->|"sets up card"| node_sdops
node_sdops -->|"reads and writes"| node_card
node_runtime -->|"uses feature state"| node_config

click node_runtime "https://github.com/dariozip/wardriving-esp32-c3/blob/main/src/main.cpp"
click node_config "https://github.com/dariozip/wardriving-esp32-c3/blob/main/include/main.h"
click node_wifi "https://github.com/dariozip/wardriving-esp32-c3/blob/main/src/wifiModule.cpp"
click node_position "https://github.com/dariozip/wardriving-esp32-c3/blob/main/src/main.cpp"
click node_display "https://github.com/dariozip/wardriving-esp32-c3/blob/main/src/displayPopulate.cpp"
click node_sdops "https://github.com/dariozip/wardriving-esp32-c3/blob/main/src/main.cpp"
click node_serial "https://github.com/dariozip/wardriving-esp32-c3/blob/main/src/wifiModule.cpp"

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_runtime,node_config toneBlue
class node_wifi,node_position,node_card toneAmber
class node_display,node_sdops,node_serial toneMint
class node_networks,node_gps,node_screen toneIndigo
```

## Components

### Device control

- [Firmware runtime](https://github.com/dariozip/wardriving-esp32-c3/blob/main/src/main.cpp): `src/main.cpp`
- [State and features](https://github.com/dariozip/wardriving-esp32-c3/blob/main/include/main.h): `include/main.h`

### Sensing

- [Wi-Fi scanning](https://github.com/dariozip/wardriving-esp32-c3/blob/main/src/wifiModule.cpp): `src/wifiModule.cpp`
- [GPS position](https://github.com/dariozip/wardriving-esp32-c3/blob/main/src/main.cpp): `src/main.cpp`

### Output and storage

- [Screen rendering](https://github.com/dariozip/wardriving-esp32-c3/blob/main/src/displayPopulate.cpp): `src/displayPopulate.cpp`
- [SD file operations](https://github.com/dariozip/wardriving-esp32-c3/blob/main/src/main.cpp): `src/main.cpp`
- [Serial reporting](https://github.com/dariozip/wardriving-esp32-c3/blob/main/src/wifiModule.cpp): `src/wifiModule.cpp`

### Other components

- **Nearby networks**
- **GPS receiver**
- **OLED display**
- **MicroSD card**

## Connections

- Firmware runtime → Wi-Fi scanning: initializes (evidence: `src/main.cpp`)
- Firmware runtime → Wi-Fi scanning: starts scans (evidence: `src/main.cpp`)
- Firmware runtime → Wi-Fi scanning: checks results (evidence: `src/main.cpp`)
- Wi-Fi scanning → Nearby networks: scans (evidence: `src/wifiModule.cpp`)
- Wi-Fi scanning → Serial reporting: reports results (evidence: `src/wifiModule.cpp`)
- Firmware runtime → GPS position: reads GPS input (evidence: `src/main.cpp`)
- GPS receiver → GPS position: sends GPS data (evidence: `src/main.cpp`)
- Firmware runtime → Screen rendering: refreshes (evidence: `src/main.cpp`)
- Screen rendering → OLED display: renders (evidence: `src/displayPopulate.cpp`)
- Firmware runtime → SD file operations: sets up card (evidence: `src/main.cpp`)
- SD file operations → MicroSD card: reads and writes (evidence: `src/main.cpp`)
- Firmware runtime → State and features: uses feature state (evidence: `src/main.cpp`)
