Live train notification tool for Raspberry Pi and Blinkt! A live UK train departure board to check before you walk out the door. Uses the OpenLDBWS service to show the live running status of direct trains between your specified stations.
There are two different versions available at present.
Each of the eight LEDs on the Blinkt represents a 5 minute time window. The colour of each LED indicates the train(s) available in that time window:
- Black/Unlit = no train.
- White = a train is imminent/on platform/just left.
- Green = an on-time train.
- Yellow = a delayed train (this is the actual delayed time, not the pre-delay scheduled time.)
- Blue = unspecified delay (there was supposed to be a train, but it is delayed and the delay period is not specified.)
- Red = a cancelled train (there was supposed to be a train, but now it's not coming.) If there are multiple trains in the time window, the "best" LED state is set - White>Green>Yellow>Blue>Red>Black.
The eight LEDs show the expected state of the next (up to) 8 trains, in order.
- Green = an on-time train.
- Yellow = a delay of up to 10 minutes.
- Blue = an unspecified delay.
- Red = a delay of more than 10 minutes, or a cancelled train.
- Make sure the time on your Pi is correct.
- Install Python blinkt package.
- Install Python nre-darwin-py package.
- Sign up for OpenLDBWS and get your API key: http://realtime.nationalrail.co.uk/OpenLDBWSRegistration/
- Create DARWIN_WEBSERVICE_API_KEY environment variable (your API key)
- Create DEPARTURE_CRS_CODE environment variable (see http://www.railwaycodes.org.uk/crs/CRS0.shtm)
- Create DESTINATION_CRS_CODE environment variable (see http://www.railwaycodes.org.uk/crs/CRS0.shtm)
- Run on cron.
If you're familiar with Ansible, you can use main.yml
to deploy PiTrains on to a fresh Pi.