A live train departure board using the Pimoroni Badger 2040 W.
Live departure board data provided by the Rail Delivery Group.
- Install the latest Badger 2040 firmware on your device (select the regular build, not
with-badger-os). - Copy the files in the
mpydirectory to your device. - Set
CRS_LOCATION,WIFI_COUNTRY,WIFI_NETWORK, andWIFI_PASSWORD(and optionallyCRS_FILTER) withinconfig.json. If you're not sure what the CRS code is for your local station, you can find it on the National Rail website.
There are several configurable values set in config.json:
Your board will not work without these configueation items:
CRS_LOCATION: the CRS code for the station to show departures from.WIFI_COUNTRY: the ISO 3166-2 country where the board is operating.WIFI_NETWORK: the network name (SSID) that the board should connect to.WIFI_PASSWORD: the password (PSK) for the network that the board should connect to.
All of these items are optional, and have sensible defaults:
API_URL_PREFIX: the prefix used for the API URL. The default value,https://www.beh.uk/api/raildata, is implemented using Cloudflare Functions as part of my personal website.CRS_FILTER: filter departures to only include trains calling at the given station.DISPLAY_UPDATE_INTERVAL_SECS: how often to update the display, in seconds. The default value is60(seconds), but this could be increased for stations with infrequent departures.EINK_REFRESH_INTERVAL: how often to perform a "full" refresh of the e ink display, to remove ghosting. The default value is to60-- i.e. a full refresh every 60th update. Set to 0 to disable.EINK_UPDATE_SPEED: how quickly to update the display -- see the Badger 2040 docs for details. The default value is2(i.e.UPDATE_FAST).NTP_HOST: the hostname of the server to use for NTP, when setting the time on boot. The default value istime.cloudflare.com, which is Cloudflare's secure time service.NTP_INTERVAL_HOURS: how often to update the time using NTP, in hours. The default value is4(hours), but this may need to be reduced due to issues with clock drift. Set to 0 to disable.SLEEP_MODE: when to enter "sleep mode", where the display does not update. The default value is 6pm to 8am (i.e.1800-0800). Set to an empty string to disable.