Skip to content

TheODI-UD2D/route_c

Repository files navigation

Build Status Dependency Status Coverage Status Code Climate Gem Version License

Route C

A Ruby script for the Raspberry Pi to show how crowded a station on the Victoria line is (with fake data currently)

Installation

Install the gem

sudo gem install route_c

Set environment variables

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

Hardware

Crudely-drawn circuit

How to Pi

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

Set config

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`)}

Running

For a one off display of station crowding

sudo -E routec {STATION} {DIRECTION (either `northbound` or `southbound`)}

(This defaults to the current time on the 23rd September)

For a one off display of station crowding for a particular datetime

sudo -E routec {STATION} {DIRECTION (either `northbound` or `southbound`)} --time={DATETIME}

To watch for a button press and return current station crowding

sudo -E routec watch

(This defaults to the current time on the 23rd September)

Running on boot

  • 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published