Skip to content
/ kvv Public

Epaper time table for KVV, Karlsruhe, Germany

Notifications You must be signed in to change notification settings

harbaum/kvv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

Update 11.05.2022: The KVV time table service this project made use of is gone. This code has been updated to support the newer API.

KVV

We recently (Nov 2020) got a new tram extension in Karlsruhe, Germany. To celebrate the fact that there's now a station pretty close to our home I decided to build a virtual timetable. And since I had some spare ESP8266 powered Wemos D1 and a 2.9" tricolor e-paper display I decided to use these.

Final setup

Breadboard setup

The whole setup is pretty simple and can be wired on a breadboard as depicted.

Wiring

Since the epaper display keeps the data even if not powered at all the ESP8266 simply boots up, connects to the (hardcoded) WiFi network, downloads the live data, updates the display and then powers down/goes into deep sleep. The whole setup can thus be run from a battery with the reset button exposed so it can be pushed to boot the ESP8266 and to update the display.

Breadboard setup

Final setup

For the final setup depicted above I unsoldered the connector on the displays rear and used double sided tape to stick the Wemos D1 to the display. A total of eight short wires are needed to connect both PCBs. The resulting setup is sufficiently small and robust.

Final setup rear view

Where does the data come from?

The KVV offers a live timetable. A quick look at the network traffic (or at the embedded Javascript code) reveals that some easy to handle JSON can be downloaded e.g. for the tram stop "Pionierstraße" using this http get request.

The station ID of the station to be displayed is hardcoded into the sketch. By default this is set to 7000238 which is the ID of the station named Pionierstraße. The API allows to search for IDs by station names and even parts of it. E.g. to search for any station including "Pionier" in its name use the following search: https://www.kvv.de/tunnelEfaDirect.php?action=XSLT_STOPFINDER_REQUEST&name_sf=pionier&outputFormat=JSON&type_sf=any. For other stations replace "Pionier" with the phrase you are searching for. The station IDs can then be read from the '''stateless''' field in the JSON reply.

The sketch

The sketch is based on the BasicHttpsClient.ino for the ESP8266. The display is driven using the Adafruit EPD library. And finally the JSON parsing is done using the ArduinoJson library. All these dependencies can be installed from the library manager within the Arduino IDE.

A custom generated font is being used since the fonts distributed by Adafruit with the Adafruit GFX library only include 7 bit fonts and we need an 8 bit font for the german umlauts used by the KVV.

Related projects

About

Epaper time table for KVV, Karlsruhe, Germany

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages