Giter Club home page Giter Club logo

subwayclock's Introduction

Subwayclock

Subwayclock is a simple program used to power a Raspberry PI-based countdown clock. The display is similar to the countdown clocks that can be seen on the New York Subway platform.

Image of the subway clock on a Raspberry Pi Zero

Requirements

In order to use this library, you'll need the following:

  1. An MTA API key. You can register for an account at: http://datamine.mta.info/
  2. A Raspberry PI. I have personally tested this on a Raspberry PI Zero W, but other models should work.
  3. An Inky pHAT display.

Usage

  1. Clone this repo. git clone [email protected]:ztstewart/subwayclock.git.
  2. Modify main.go to use the correct stop ID for your home station and change the labels for your train line.
  3. Add your MTA API Key in the client.NewNYCTA(&client.Config{....}) line.
  4. Compile the tool: go build. You can compile for the Raspberry Pi a more powerful machine: GOOS=linux GOARCH=arm GOARM=5 go build
  5. (Optional) If you cross compiled (that is, compiled on another machine), copy the binary to your Raspberry Pi.
  6. Run the binary: ./subwayclock. It will continuosly update its information every minute by default.

Running on boot

For convenience, there is a subwayclock.service file included in this repo. It is a systemd compatible service configuration file that you can use to stop and start this tool in compatible Linux distributions, such as Raspbian.

This is useful if this is the main use for your Raspberry Pi.

  1. Edit subwayclock.service to point to the user and the location of the subwayclock executable on your Raspberry Pi.
  2. Copy the file to the /etc/systemd/system directory: sudo cp subwayclock.service /etc/systemd/system/subwayclock.service
  3. Start the service: sudo systemctl start subwayclock. This will make it start drawing to your e-ink screen.
  4. Enable the service, which will start it on boot: sudo systemctl enable subwayclock.

You can disable the subwayclock service by running sudo systemctl disable subwayclock. This will prevent it from running on boot. To stop it temporarily, run sudo systemctl stop subwayclock

subwayclock's People

Contributors

ztstewart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.