readme.md
Markdown · 79 lines
# ESP32 + SSD1322 256x64 (8080) – TfL Arrivals (Victoria Station)

This project displays **live London Underground arrival predictions** for **Victoria Underground Station** on a **3.12" OLED SSD1322 256×64** using an **ESP32**.
It uses:
- **WiFiManager** for Wi-Fi setup (captive portal)
- **TfL Unified API**: `StopPoint/{id}/Arrivals`
- **U8g2** for SSD1322 graphics (8080 8-bit parallel mode)
---
## Hardware
- ESP32 DevKit (ESP32)
- OLED: SSD1322 256×64, **8080 8-bit parallel interface** (important!)
---
## Wiring (MOST IMPORTANT)
### Display pinout (1–16)
| Display Pin | Name | Connect to ESP32 |
|------------:|---------|------------------|
| 1 | Vss | GND |
| 2 | VBAT | 3V3 (recommended) |
| 3 | NC | Not connected |
| 4 | DB0 | GPIO32 |
| 5 | DB1 | GPIO33 |
| 6 | DB2 | GPIO25 |
| 7 | DB3 | GPIO26 |
| 8 | DB4 | GPIO27 |
| 9 | DB5 | GPIO14 |
| 10 | DB6 | GPIO13 |
| 11 | DB7 | GPIO22 |
| 12 | /RD | 3V3 (tie HIGH) |
| 13 | /WR | GPIO21 |
| 14 | DC | GPIO16 |
| 15 | /RESET | GPIO17 |
| 16 | /CS | GPIO4 |
### Critical notes
- **/RD must be HIGH** (connect it to **3V3**). This project does not read from the display.
- Start with **VBAT = 3V3** (safer for ESP32 logic levels).
- Make sure **GND is common** between ESP32 and the display.
---
## Software setup
### Libraries (Arduino Library Manager)
- **U8g2** (by oliver)
- **WiFiManager** (by tzapu)
- **ArduinoJson**
### Board
- ESP32 board package (Arduino-ESP32)
- Select your ESP32 DevKit board in Arduino IDE
---
## Wi-Fi configuration (WiFiManager)
On first boot (or if credentials are missing), the ESP32 creates an AP:
**SSID:** `ESP32-Victoria`
Connect to it and follow the captive portal to set your Wi-Fi credentials.
---
## TfL API configuration (optional but recommended)
The project works without an API key but you may hit rate limits.
You can add a TfL API key in the code:
```cpp
static const char* TFL_APP_KEY = "YOUR_APP_KEY";