A Ruby script for the Raspberry Pi to show how crowded a station on the Victoria line is (with fake data currently)
sudo gem install route_c
For this to work, you will need a running instance of Sir Handel, together with the correct username and password. You can then set the relevant variables like so:
export SIR_HANDEL_USERNAME=username
export SIR_HANDEL_USERNAME=password
You might also need the Treasure Map
The final setup should look something like this:
Make a note of where your inputs and outputs are connected for the config below
Create a file in your home directory at .routec/config.yaml
. The following variables are configurable:
base_url: {The base URL of your Sir Handel instance's arriving endpoint - i.e. http://example.org/stations/arriving/ }
interval: {The interval (in fractions of seconds) you want each LED to wait before turning on / off}
pause: {The interval you want to wait before turning the lights off}
lights:
{A YAML array of the GPIO ports that have LEDs connected}
button: {The GPIO port that the button is connected to}
station: {The Victoria line station that you want `routec watch` to query}
direction: {The direction you want `routec watch` to query (either `northbound` or `southbound`)}
sudo -E routec {STATION} {DIRECTION (either `northbound` or `southbound`)}
(This defaults to the current time on the 23rd September)
sudo -E routec {STATION} {DIRECTION (either `northbound` or `southbound`)} --time={DATETIME}
sudo -E routec watch
(This defaults to the current time on the 23rd September)
- Create a file in
/etc/init.d/routec
and copy the text from this example file to it. - Replace YOUR USERNAME and YOUR PASSWORD with the username and password for your Sir Handel instance
- Run
sudo update-rc.d route_c defaults
- Reboot your Pi