Giter Club home page Giter Club logo

onetesselaway's Introduction

OneTesselAway: Real-Time Public Transit Status IoT Device

A real-time public transit status IoT device built with Node.js, the OneBusAway API, and a Tessel 2.

I built a real-time transit IoT device that tells me when my next bus will arrive. Built with Node.js, OneBusAway, and the Tessel 2. Why? Because constantly checking my phone and the OneBusAway app every morning while waiting for the bus was annoying. I also wanted to challenge myself by learning new hardware programming and electronics assembly skills.

๐Ÿ‘‰ To learn more about this project, please see Building a Real-Time Public Transit Status IoT Device.

Photos

A couple photos of the project. For more, see the blog post.

The device itself. Bus #11 left 2 minutes ago, but there are other ones coming in 11 and 26 minutes.

The web UI which features real-time simulated hardware, advanced device controls, device logs, and more. It can also be run in "web only" mode which uses a full set of mocked hardware. By default, it runs on port 8080. To learn more about the web UI, see the blog post.

Development

Here's how to develop on the OneTesselAway device and/or the web UI.

Prerequisites

  1. Request a OneBusAway API key. (This step can take a few days.)

To request an API key for the Puget Sound One Bus Away data send an email to [email protected]. Please include the first and last names of the contact person, email address (if different) and acknowledgement that you have read and agree to the Transit Data Terms of Use. Please allow two business days for processing requests.

  1. Put the API key in a file called oba-api-key.json at the root of the project under an apiKey property.
{
    "apiKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
  1. Install NVM
  2. Use nvm use to activate the latest version of Node supported by the Tessel
  3. Install the Tessel 2 CLI

Run the Web UI from your Computer (No Device Required!)

You can run the OneTesselAway Web UI from your computer without any hardware at all.

npm start

You can use the following environment variables to configure how the Web UI runs.

  • WEB_UI_ADDRESS - The address on which to run the Web UI
  • WEB_UI_PORT - The port on which to run the Web UI

E.g., to run the web UI on a different port:

WEB_UI_PORT=8081 npm start

Start OneTesselAway on the Device from your Computer

You can run OneTesselAway on the actual Tessel 2 hardware when connected via USB. This will start the device and the Web UI.

npm run start:device

Deploy OneTesselAway to the Device

You can deploy and run the code on the Tessel 2 hardware. (Deploy is via USB by default.)

npm run deploy

Todo

  • Make mock endpoint
  • Fix alarm (why doesn't it turn itself off?)
  • Wait between calls to OBA
  • Helper for update events
  • Make mock hardware utils
  • Clean up hardware pins
  • Stagger hardware callbacks, or at least let buzzer update on its own
  • Fix startup tune: LCD message and delayed tune
  • Allow songs to be changed via Web UI
  • Fix mobile view for web ui
  • Docs: Add link to blog post when it's done
  • Docs: Match title and subtitle w/ blog

References

onetesselaway's People

Contributors

dependabot[bot] avatar robatron 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.