Original - https://github.com/chrishutchinson/train-departure-screen
I have modified Chris Hutchinson version of the code to rahter use the Huxley 2 cross-platform JSON proxy for the GB railway Live Departure Boards. It is using their demo server comes with zero guarantees of uptime. It can (and regularly does) go down or break.
Python script to display replica real-time UK railway station departure screens for SSD13xx devices
To run this code, you will need Python 3.6+.
If you're using Raspbian Lite, you'll also need to install:
libopenjp2-7
with:
$ sudo apt-get install libopenjp2-7-
Clone this repo
-
Install dependencies
$ pip install -r requirements.txt-
Sign up for API access token from NRE - https://realtime.nationalrail.co.uk/OpenLDBWSRegistration/Registration
-
Copy
config.sample.jsontoconfig.jsonand complete the values, including your NRE access token from step 3 to be entered in the apiKey variable. appId is not in use in this version. Note: station names should be provided as their three-letter station code, all available here.
eg:
{
"journey": {
"departureStation": "rmd",
"destinationStation": null
},
"refreshTime": 180,
"transportApi": {
"appId": "",
"apiKey": "xxxxxxyourxtokenxherexxxxxxx"
}
}- Start the app with:
$ python ./src/main.py --display pygame --width 256 --height 64Change the --display flag to alter the output mechanism (a list of options can be found in this README: https://github.com/rm-hull/luma.examples). Use capture to save to images, and pygame to run a visual emulator.
Remember to pass --interface spi if you are using SPI to communicate with your screen. Otherwise, the default of i2c should suffice.
$ python ./src/main.py --display ssd1322 --width 256 --height 64 --interface spiI've tweeted a video demo of the software running on a real device: https://twitter.com/ericktruter/status/1792897298243924400
Thanks to Chris Hutchinson for the original version.
The fonts used were painstakingly put together by DanielHartUK and can be found on GitHub at https://github.com/DanielHartUK/Dot-Matrix-Typeface - A huge thanks for making that resource available!
