# glmatt/kindle4-weather-station architecture

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

- Interactive diagram: https://gitdiagram.com/glmatt/kindle4-weather-station
- Repository: https://github.com/glmatt/kindle4-weather-station

## Overview

This is a self-contained Kindle weather display. Scheduled runs of `meteo.py` fetch current, hourly, and daily forecasts, then render the weather panel; separate minute runs of `ora.py` update the clock and date without colliding with ten-minute panel refreshes. The scripts also preserve the last display on network failure, record battery status, and share a saved timezone offset. The README documents the icon set, Open-Meteo access, and scheduled Wi-Fi operation; source excerpts show only part of the rendering and download implementation.

Main entry points: [`kindle/meteo.py`](https://github.com/glmatt/kindle4-weather-station/blob/main/kindle/meteo.py) (Forecast and panel), [`kindle/ora.py`](https://github.com/glmatt/kindle4-weather-station/blob/main/kindle/ora.py) (Minute clock), [`kindle/icone`](https://github.com/glmatt/kindle4-weather-station/tree/main/kindle/icone) (Weather icons), [`tools/genera_icone.py`](https://github.com/glmatt/kindle4-weather-station/blob/main/tools/genera_icone.py) (Icon generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_fetch["Forecast data"]
  node_meteo["Forecast and panel<br/>[meteo.py]"]
  node_openmeteo["Open-Meteo"]
  node_weatherdata["Weather values<br/>[meteo.py]"]
end

subgraph group_display["Kindle display"]
  node_panel["Weather panel<br/>[meteo.py]"]
  node_fbink["FBInk renderer"]
  node_icons["Weather icons"]
  node_iconmaker["Icon generation<br/>[genera_icone.py]"]
  node_clock["Minute clock<br/>[ora.py]"]
end

subgraph group_operation["Device operation"]
  node_timezone["Timezone offset<br/>[meteo.py]"]
  node_batterylog["Battery log<br/>[meteo.py]"]
  node_device["Kindle device"]
end

node_scheduler(("Cron schedule"))
node_weatherapi["HTTPS service"]

node_scheduler -->|"runs every ten minutes"| node_meteo
node_scheduler -->|"runs each minute"| node_clock
node_meteo -->|"requests forecast"| node_weatherapi
node_weatherapi -->|"returns forecast data"| node_weatherdata
node_meteo -->|"renders panel"| node_panel
node_meteo -->|"saves offset"| node_timezone
node_clock -->|"reads offset"| node_timezone
node_clock -->|"uses display helpers"| node_meteo
node_panel -->|"draws with"| node_fbink
node_panel -->|"selects weather icon"| node_icons
node_iconmaker -->|"generates images"| node_icons
node_meteo -->|"appends status"| node_batterylog
node_meteo -->|"prevents screensaver"| node_device
node_fbink -->|"draws on framebuffer"| node_device

click node_meteo "https://github.com/glmatt/kindle4-weather-station/blob/main/kindle/meteo.py"
click node_weatherdata "https://github.com/glmatt/kindle4-weather-station/blob/main/kindle/meteo.py"
click node_panel "https://github.com/glmatt/kindle4-weather-station/blob/main/kindle/meteo.py"
click node_icons "https://github.com/glmatt/kindle4-weather-station/tree/main/kindle/icone"
click node_iconmaker "https://github.com/glmatt/kindle4-weather-station/blob/main/tools/genera_icone.py"
click node_clock "https://github.com/glmatt/kindle4-weather-station/blob/main/kindle/ora.py"
click node_timezone "https://github.com/glmatt/kindle4-weather-station/blob/main/kindle/meteo.py"
click node_batterylog "https://github.com/glmatt/kindle4-weather-station/blob/main/kindle/meteo.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_meteo,node_openmeteo,node_weatherdata toneBlue
class node_panel,node_fbink,node_icons,node_iconmaker,node_clock toneAmber
class node_timezone,node_batterylog,node_device toneMint
class node_scheduler,node_weatherapi toneIndigo
```

## Components

### Forecast data

- [Forecast and panel](https://github.com/glmatt/kindle4-weather-station/blob/main/kindle/meteo.py): `kindle/meteo.py`
- **Open-Meteo**
- [Weather values](https://github.com/glmatt/kindle4-weather-station/blob/main/kindle/meteo.py): `kindle/meteo.py`

### Kindle display

- [Weather panel](https://github.com/glmatt/kindle4-weather-station/blob/main/kindle/meteo.py): `kindle/meteo.py`
- **FBInk renderer**
- [Weather icons](https://github.com/glmatt/kindle4-weather-station/tree/main/kindle/icone): `kindle/icone`
- [Icon generation](https://github.com/glmatt/kindle4-weather-station/blob/main/tools/genera_icone.py): `tools/genera_icone.py`
- [Minute clock](https://github.com/glmatt/kindle4-weather-station/blob/main/kindle/ora.py): `kindle/ora.py`

### Device operation

- [Timezone offset](https://github.com/glmatt/kindle4-weather-station/blob/main/kindle/meteo.py): `kindle/meteo.py`
- [Battery log](https://github.com/glmatt/kindle4-weather-station/blob/main/kindle/meteo.py): `kindle/meteo.py`
- **Kindle device**

### Other components

- **Cron schedule**
- **HTTPS service**

## Connections

- Cron schedule → Forecast and panel: runs every ten minutes (evidence: `README.md`)
- Cron schedule → Minute clock: runs each minute (evidence: `README.md`)
- Forecast and panel → HTTPS service: requests forecast (evidence: `README.md`)
- HTTPS service → Weather values: returns forecast data (evidence: `README.md`)
- Forecast and panel → Weather panel: renders panel (evidence: `README.md`)
- Forecast and panel → Timezone offset: saves offset (evidence: `README.md`)
- Minute clock → Timezone offset: reads offset (evidence: `kindle/ora.py`)
- Minute clock → Forecast and panel: uses display helpers (evidence: `kindle/ora.py`)
- Weather panel → FBInk renderer: draws with (evidence: `kindle/meteo.py`)
- Weather panel → Weather icons: selects weather icon (evidence: `README.md`)
- Icon generation → Weather icons: generates images (evidence: `README.md`)
- Forecast and panel → Battery log: appends status (evidence: `README.md`)
- Forecast and panel → Kindle device: prevents screensaver (evidence: `kindle/meteo.py`)
- FBInk renderer → Kindle device: draws on framebuffer (evidence: `README.md`)
