WiFi Bus Timetable
ESP32-C3 based display showing live public transport departures from SL's API. Designed for hallway deployment without phone dependency.
Hardware
- ESP32-C3 Super Mini
- 240×320 ST7789 TFT display (SPI) — connected via soldered pin header
Pin Configuration
| ESP32 | TFT |
|---|---|
| GND | G |
| 3.3V | VCC |
| GPIO4 | SCL |
| GPIO3 | SDA |
| GPIO2 | RST |
| GPIO1 | DC |
| GPIO0 | CS |
ℹ Note — Despite the labelling, the display uses SPI not I²C. SDA maps to MOSI (GPIO3), SCL to SCLK (GPIO4).
User_Setup.h
#define USER_SETUP_INFO "User_Setup"
#define ST7789_DRIVER
#define TFT_RGB_ORDER TFT_BGR
#define TFT_WIDTH 240
#define TFT_HEIGHT 320
#define TFT_MOSI 3
#define TFT_SCLK 4
#define TFT_CS 0
#define TFT_DC 1
#define TFT_RST 2
#define LOAD_GFXFF
#define SMOOTH_FONT
#define SPI_FREQUENCY 10000000Critical Requirement
⚠ Warning — Use Arduino IDE ESP32 board package (esp32 by Espressif Systems) version 2.0.14 specifically. Later versions cause boot loops with TFT_eSPI on ESP32-C3 (see GitHub issue #3284).
Key Features
- Differential screen updates — only changed rows redraw, preventing flicker
- Badge column width adapts dynamically; geometry change triggers full repaint
- Sleep mode 22:00–06:00: display powers down, API polling pauses, WiFi and OTA remain active
StaticJsonDocumentprevents heap fragmentation during 20-second fetch cycles- Zero dynamic memory allocation at runtime
- OTA serviced first in
loop()and during sleep — never starved - Midnight-crossing sleep windows handled without special casing