# cerevisis/esp32-weather-station architecture

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

- Interactive diagram: https://gitdiagram.com/cerevisis/esp32-weather-station
- Repository: https://github.com/cerevisis/esp32-weather-station

## Overview

This is an ESP32 weather-station firmware and device-hosted dashboard. The main workflow reads environmental and power/weather sensors, processes readings, presents live and historical data in the web UI, and uploads readings to configured weather services. WiFi setup and persistent configuration support operation; the README also describes logging and history retention. The firmware source was not excerpted, so its internal divisions and some wiring are represented only where the README explicitly documents them; the dashboard assets are present as compressed files.

Main entry points: [`ESP32-Weather-Station.ino`](https://github.com/cerevisis/esp32-weather-station/blob/main/ESP32-Weather-Station.ino) (Station firmware), [`data/index.html.gz`](https://github.com/cerevisis/esp32-weather-station/blob/main/data/index.html.gz) (Dashboard UI), [`data/update.js.gz`](https://github.com/cerevisis/esp32-weather-station/blob/main/data/update.js.gz) (Live charts and controls), [`data/style.css.gz`](https://github.com/cerevisis/esp32-weather-station/blob/main/data/style.css.gz) (Responsive styling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_device["Device firmware"]
  node_firmware["Station firmware"]
  node_status_led["Status LED patterns<br/>[extra.h]"]
  node_wifi["Local WiFi and setup portal"]
end

subgraph group_dashboard["Web dashboard"]
  node_dashboard_ui["Dashboard UI<br/>[index.html.gz]"]
  node_dashboard_logic["Live charts and controls<br/>[update.js.gz]"]
  node_dashboard_style["Responsive styling<br/>[style.css.gz]"]
end

subgraph group_persistence["Device persistence"]
  node_utilities["Filesystem utilities<br/>[utilities.h]"]
  node_config[("WiFi and API configuration<br/>[config.json]")]
  node_ui_state[("Persistent UI state<br/>[varVals.json]")]
  node_device_records[("Logs and raw history")]
end

subgraph group_services["Sensors and services"]
  node_sensor_inputs["Weather and power sensors"]
  node_windy["Windy"]
  node_wunderground["Wunderground"]
  node_thingspeak["ThingSpeak"]
  node_mqtt["MQTT and Home Assistant"]
end

node_operator(("Station operator"))

node_operator -->|"uses"| node_dashboard_ui
node_sensor_inputs -->|"provides readings"| node_firmware
node_firmware -->|"serves"| node_dashboard_ui
node_dashboard_ui -->|"loads"| node_dashboard_logic
node_dashboard_ui -->|"uses styling"| node_dashboard_style
node_dashboard_logic -->|"exchanges WebSocket data"| node_firmware
node_firmware -->|"persists configuration"| node_config
node_firmware -->|"persists UI state"| node_ui_state
node_firmware -->|"stores logs and history"| node_device_records
node_firmware -->|"connects or starts portal"| node_wifi
node_firmware -->|"uploads readings"| node_windy
node_firmware -->|"uploads readings"| node_wunderground
node_firmware -->|"uploads readings"| node_thingspeak
node_firmware -->|"publishes readings"| node_mqtt

click node_firmware "https://github.com/cerevisis/esp32-weather-station/blob/main/ESP32-Weather-Station.ino"
click node_status_led "https://github.com/cerevisis/esp32-weather-station/blob/main/extra.h"
click node_utilities "https://github.com/cerevisis/esp32-weather-station/blob/main/utilities.h"
click node_dashboard_ui "https://github.com/cerevisis/esp32-weather-station/blob/main/data/index.html.gz"
click node_dashboard_logic "https://github.com/cerevisis/esp32-weather-station/blob/main/data/update.js.gz"
click node_dashboard_style "https://github.com/cerevisis/esp32-weather-station/blob/main/data/style.css.gz"
click node_config "https://github.com/cerevisis/esp32-weather-station/blob/main/data/config.json"
click node_ui_state "https://github.com/cerevisis/esp32-weather-station/blob/main/data/varVals.json"
click node_device_records "https://github.com/cerevisis/esp32-weather-station/tree/main/data"

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_firmware,node_status_led,node_wifi toneBlue
class node_dashboard_ui,node_dashboard_logic,node_dashboard_style toneAmber
class node_utilities,node_config,node_ui_state,node_device_records toneMint
class node_sensor_inputs,node_windy,node_wunderground,node_thingspeak,node_mqtt toneRose
class node_operator toneIndigo
```

## Components

### Device firmware

- [Station firmware](https://github.com/cerevisis/esp32-weather-station/blob/main/ESP32-Weather-Station.ino): `ESP32-Weather-Station.ino`
- [Status LED patterns](https://github.com/cerevisis/esp32-weather-station/blob/main/extra.h): `extra.h`
- **Local WiFi and setup portal**

### Web dashboard

- [Dashboard UI](https://github.com/cerevisis/esp32-weather-station/blob/main/data/index.html.gz): `data/index.html.gz`
- [Live charts and controls](https://github.com/cerevisis/esp32-weather-station/blob/main/data/update.js.gz): `data/update.js.gz`
- [Responsive styling](https://github.com/cerevisis/esp32-weather-station/blob/main/data/style.css.gz): `data/style.css.gz`

### Device persistence

- [Filesystem utilities](https://github.com/cerevisis/esp32-weather-station/blob/main/utilities.h): `utilities.h`
- [WiFi and API configuration](https://github.com/cerevisis/esp32-weather-station/blob/main/data/config.json): `data/config.json`
- [Persistent UI state](https://github.com/cerevisis/esp32-weather-station/blob/main/data/varVals.json): `data/varVals.json`
- [Logs and raw history](https://github.com/cerevisis/esp32-weather-station/tree/main/data): `data`

### Sensors and services

- **Weather and power sensors**
- **Windy**
- **Wunderground**
- **ThingSpeak**
- **MQTT and Home Assistant**

### Other components

- **Station operator**

## Connections

- Station operator → Dashboard UI: uses (evidence: `README.md`)
- Weather and power sensors → Station firmware: provides readings (evidence: `README.md`)
- Station firmware → Dashboard UI: serves (evidence: `README.md`)
- Dashboard UI → Live charts and controls: loads (evidence: `README.md`)
- Dashboard UI → Responsive styling: uses styling (evidence: `README.md`)
- Live charts and controls → Station firmware: exchanges WebSocket data (evidence: `README.md`)
- Station firmware → WiFi and API configuration: persists configuration (evidence: `README.md`)
- Station firmware → Persistent UI state: persists UI state (evidence: `README.md`)
- Station firmware → Logs and raw history: stores logs and history (evidence: `README.md`)
- Station firmware → Local WiFi and setup portal: connects or starts portal (evidence: `README.md`)
- Station firmware → Windy: uploads readings (evidence: `README.md`)
- Station firmware → Wunderground: uploads readings (evidence: `README.md`)
- Station firmware → ThingSpeak: uploads readings (evidence: `README.md`)
- Station firmware → MQTT and Home Assistant: publishes readings (evidence: `README.md`)
