Project note: The ESP32 firmware and project code were written by Hermès Reisner. The GitHub Pages showcase website in docs was written by Hermès Reisner with AI assistance from Codex.
The showcase website is available at: https://herrei.github.io/Sbb_Tracker_Sissach/
A hardened, robust departure display for Swiss public transport. This project uses an ESP32 and an ST7789 display to fetch real-time stationboard data from the OpenData.ch Transport API.
- Robust Error Handling: Implements a hardware Watchdog Timer (WDT) that reboots the device on hangs or HTTP failures.
- JSON Filtering: Uses
ArduinoJsonfiltering to minimize memory usage and prevent stack overflows. - Configurable Transport Modes: Supports the API transport filters
train,tram,ship,bus, andcableway. - Custom Display Filters: Lets you prioritize or restrict departures by destination text and line labels.
- Real-time Updates: Fetches the next 4 departures for a selected Swiss station or stop.
- Display Logic: Sorts departures by time and handles delay indicators (green for on time, red for delayed).
- ESP32 Development Board
- ST7789 TFT Display (240x320 or similar, configuration may vary)
Based on the current sketch configuration:
| Display Pin | ESP32 Pin |
|---|---|
| MOSI | GPIO 6 |
| SCLK | GPIO 7 |
| CS | GPIO 14 |
| DC | GPIO 15 |
| RST | GPIO 21 |
| BL (Backlight) | GPIO 22 |
You need the Arduino IDE with the ESP32 Board Manager installed.
Install the following libraries via the Arduino Library Manager:
- ArduinoJson (by Benoit Blanchon)
- Adafruit GFX Library
- Adafruit ST7789 Library
- Open the
.inofile. - Locate the User Configuration section at the top.
- Update the
STATIONvariable to your desired Swiss station or stop (e.g., "Sissach", "Bern", "Zürich HB"). - Choose API transport modes in
TRANSPORTATION_TYPES(train,tram,ship,bus,cableway) or setUSE_TRANSPORTATION_FILTERtofalseto request all modes. - Adjust
DESTINATION_FILTERS,LINE_FILTERS, andONLY_SHOW_FILTER_MATCHESto control which departures are prioritized or displayed. - Update
ssidandpasswordwith your WiFi credentials.
Note: For security, it is recommended to move credentials to a separate header file that is not committed to GitHub.
This project is licensed under the MIT License - see the LICENSE file for details.