simple lil web thing that shows ETAs for Metro Transit stops
Go to file
reese sapphire 12ae2a32b2 docker shit 2023-06-26 01:04:09 -05:00
extra add extras. delete startKiosk because it relies on outdated software. 2023-04-17 19:00:09 -05:00
static clarified readme, fixed typo in code 2023-03-10 21:05:49 -06:00
.dockerignore docker shit 2023-06-26 01:04:09 -05:00
.gitignore init module and update readme 2022-09-09 14:16:52 -05:00
Dockerfile docker shit 2023-06-26 01:04:09 -05:00
config.go moved header colors to config.go 2023-02-03 18:22:49 -06:00
docker-compose.yml docker shit 2023-06-26 01:04:09 -05:00
go.mod automatic day/night theme 2022-10-15 15:58:54 -05:00
go.sum automatic day/night theme 2022-10-15 15:58:54 -05:00
main.go moved header colors to config.go 2023-02-03 18:22:49 -06:00
nextrip.go huge overhaul 2023-02-03 15:31:34 -06:00
readme.md clarify usage of update.sh 2023-04-17 19:04:03 -05:00
screenshot.png huge overhaul 2023-02-03 15:31:34 -06:00
style.scss moved header colors to config.go 2023-02-03 18:22:49 -06:00

readme.md

 ---------------------------------------------------
             /`                       '\
             \             __ __       /
     .-----.--------.-----|__|  |--.--.--.-----.
     |  _  |        |     |  |  _  |  |  |__ --|
  ===|_____|__|__|__|__|__|__|_____|_____|_____|===
=====================================================

lil go webserver that shows departure times for Metro Transit stops

usage

  1. download this repo.
  2. edit config.go with your desired values. (see configuration)
  3. build it with go build.
  4. run the omnibus binary. you can view the page at http://localhost:8080.

ok but why?

i have this showing on a wall-mounted display inside layer zero that turns on while the cat signal is on. when you are planning to leave, you can glance to see this information while you wait for your bus or train inside :3

what's it look like?

screenshot

features

  • highly configurable
  • switches between light and dark theme depending on the sun's position
  • designed for a SBC that can run a web browser
  • statically linked binary contains (almost, see extras) everything it needs to run and functions as a webserver.

configuration

the configuration data lives in config.go and is compiled into the binary. the first few variables should be pretty self-explanatory; feel free to open an issue if they aren't.

the query struct is where it gets a bit complicated. it is essentially there to coax data from the General Transit Feed Specification into the way it is displayed for humans. because there may be multiple station numbers per location that someone might call "a stop" (on either side of the road, at intermodal transfer points, or even one for each route, for example), you can combine them into Groups under a shared name.

you can put as many Stations as you'd like into a Group. each Station results in a query to the NexTrip API, which you can filter by Route, showing the soonest from each if found.

extras

there are some extra not-totally-necessary files in extra/ to help you use it.

  • i3/config - barebones configuration for i3 window manager to start a web browser and manage the display's power.
  • scripts/catsign_listener.sh - the cat signal is our occupancy indicator at layer zero. this script checks every minute whether it is turned on, and puts the display to sleep if it's off.
  • scripts/dev.sh - run this in the background when you are developing omnibus to automatically compile and run when changes are made.
  • scripts/update.sh - this will pull the latest code (assuming you cloned the git repo), compile, and install it to /usr/sbin/omnibus. you could run a cronjob to check for changes every hour, for example.
  • omnibus.service - place this systemd unit file in /etc/systemd/system/ and you can have it start on system boot with sudo systemctl enable --now omnibus.