Inspired by the somewhat recent talk by Till Harbaum I wanted to get the timetable of the nearest station into my appartement. As I had a Adafruit SSD1306 OLED display as well as an esp32 sitting around I started modifying the project to work on my hardware.
The fetching and parsing logic of the KVV departures is practically the same as in the snipped provided by Till, however, since the SSD1306s display is much smaller than the eInk one used in the original project we reduce the amount of displayed departures to 3 and scroll the station text.
- clone the repository
- create a file called
wifi.hwhich populatesWIFI_SSIDandWIFI_PASSWORDof your network - choose your station(s) [see this guide]
- connect up the display
- flash the firmware
I highly recommend watching the talk by Till Harbaum in order to understand what's going on.
Basically we need to look up which STOP_ID our station corresponds to in the KVVs dictionary of stations.
This can be done by querying the following endpoint with the name of the station.
https://www.kvv.de/tunnelEfaDirect.php
?action=XSLT_STOPFINDER_REQUEST
&name_sf=<YOUR_STOPNAME_HERE>
&outputFormat=JSON
&type_sf=any
In the returned JSON look for your station and take note of the corresponding stateless attribute. This is the STOP_ID, change the definition of said constant in line 36 in the kvv-oled.ino.
