pisub

command module
v0.0.0-...-3ec9b05 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2020 License: BSD-2-Clause Imports: 9 Imported by: 0

README

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 git@github.com: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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
client
Package client contains the required functionality to retrieve data from the MTA's NYC subway realtime data feed.
Package client contains the required functionality to retrieve data from the MTA's NYC subway realtime data feed.
models
Package models provides the internal view of the NYC subway realtime feed.
Package models provides the internal view of the NYC subway realtime feed.
render
Package render provides functionality to render images suitable for display on a limited size screen.
Package render provides functionality to render images suitable for display on a limited size screen.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL