Giter VIP home page Giter VIP logo

onebusaway-pebbletime's Introduction

OneBusAway for Pebble Build Status Join the OneBusAway chat

Full demo

OneBusAway for Pebble smart watches provides a OneBusAway experience tailored to the Pebble platform. This app is designed to help you figure out what bus to take as quickly and easily as possible to aid in your everyday commute.

Available on the Pebble App Store

Supported Pebble Hardware

  1. Pebble Time (basalt)
  2. Pebble Time Round (chalk)
  3. Pebble 2 (diorite)

Features

  1. At a glance, real-time arrival information for public transportation
  2. Shows to only 'favorite' stops nearby your current location
  3. Favorite buses from multiple nearby stops shown at the same time (to help you decide which bus to go take, even if they're not at the same stop)

Usage

At first launch, you will need to add some favorite stops:

How to add favorites

Data updates in real time:

Watch as buses get updated

Bus details show you all you need to know about an upcoming arrival:

Full details about each arrival Bus details update in realtime

Settings to help customize your experience:

Change the geographic search radius

- "Favorites nearby" search radius controls what arrivals are shown based on how close their stops are to your current location - "Adding favorites" search radius controls how far to look for stops when adding new favorites

Building

  1. Clone this repository
  2. Install the Pebble SDK.
  3. Run pebble build (or pebble build -- --logging to enable logging)

Important note about building - because this project uses a custom wscript file to compile correctly for ARM/math-sll, the project will not build on CloudPebble.

Running / Installing

Install as normal for pebble apps (i.e. pebble install --emulator=basalt)

onebusaway-pebbletime's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onebusaway-pebbletime's Issues

Improve sort ordering on stop, route lists

Summary:

Current ordering is dictated by the OBA responses (i.e. it's the order of the stops/routes in the JSON).
Unclear if there is a better ordering - would require some investigation to see if it can be made easier on the user to find the stop/route they're looking for.

Use Regions API instead of hard-coding regions list

Summary:

http://regions.onebusaway.org/regions-v3.json
http://regions.onebusaway.org/regions-v3.xml

It's a centralized API to dynamically pull back a list of supported OBA regions, including their geographic boundaries and server APIs. Documentation for this is hosted separately from the central OBA docs (we need to fix this), so some devs miss it.

More info at https://github.com/OneBusAway/onebusaway-application-modules/wiki/API-Webapp-Configuration-Guide#new-3rd-party-mobile-apps---api-key-generation-and-sharing-process.

Building failing via CloudPebble

I created a Pebble online account and imported this Github project, and then clicked on "Compilation" in left bar and then the "Run build" button, and the build failed with this output:

Setting top to                           : /tmp/tmpwXTc6s 
Setting out to                           : /tmp/tmpwXTc6s/build 
Checking for program webpack             : /app/node_modules/.bin/webpack 
Found Pebble SDK for diorite in:         : /app/sdk3/pebble/diorite 
Checking for program gcc,cc              : arm-none-eabi-gcc 
Checking for program ar                  : arm-none-eabi-ar 
Found Pebble SDK for chalk in:           : /app/sdk3/pebble/chalk 
Checking for program gcc,cc              : arm-none-eabi-gcc 
Checking for program ar                  : arm-none-eabi-ar 
Found Pebble SDK for basalt in:          : /app/sdk3/pebble/basalt 
Checking for program gcc,cc              : arm-none-eabi-gcc 
Checking for program ar                  : arm-none-eabi-ar 
'configure' finished successfully (0.132s)
Waf: Entering directory `/tmp/tmpwXTc6s/build'
[  2/104] message_key_header:  -> build/include/message_keys.auto.h
[  3/104] message_key_json:  -> build/js/message_keys.json
[  3/104] message_key_definitions:  -> build/src/message_keys.auto.c
[  4/104] diorite | subst: ../../app/sdk3/pebble/common/pebble_app.ld.template -> build/diorite/pebble_app.ld.auto
[  5/104] diorite | appinfo.auto.c:  -> build/diorite/appinfo.auto.c
[  7/104] diorite | appinfo.json:  -> build/appinfo.json
[  7/104] diorite | reso: resources/images/warning.png -> build/diorite/resources/images/warning.png.WARNING.reso
[  8/104] diorite | reso: resources/images/icon.png -> build/diorite/resources/images/icon.png.IMAGE_MENU_ICON.reso
[ 10/104] diorite | resource_ball: build/diorite/resources/images/warning.png.WARNING.reso build/diorite/resources/images/icon.png.IMAGE_MENU_ICON.reso -> build/diorite/system_resources.resball
[ 10/104] diorite | c: build/src/message_keys.auto.c -> build/src/message_keys.auto.c.23.o
[ 11/104] diorite | generate_resource_id_definitions: build/diorite/system_resources.resball -> build/diorite/src/resource_ids.auto.c
[ 12/104] diorite | generate_resource_id_header: build/diorite/system_resources.resball -> build/diorite/src/resource_ids.auto.h
[ 13/104] diorite | generate_pbpack: build/diorite/system_resources.resball -> build/diorite/app_resources.pbpack
[ 14/104] diorite | c: src/c/error_window.c -> build/src/c/error_window.c.23.o
[ 15/104] diorite | c: src/c/bus_details.c -> build/src/c/bus_details.c.23.o
[ 16/104] diorite | c: src/c/arrivals.c -> build/src/c/arrivals.c.23.o
[ 17/104] diorite | c: build/diorite/appinfo.auto.c -> build/diorite/appinfo.auto.c.23.o
[ 18/104] diorite | c: src/c/main_window.c -> build/src/c/main_window.c.23.o
[ 19/104] diorite | c: src/c/utility.c -> build/src/c/utility.c.23.o
[ 20/104] diorite | c: src/c/location.c -> build/src/c/location.c.23.o
[ 21/104] diorite | c: build/diorite/src/resource_ids.auto.c -> build/diorite/src/resource_ids.auto.c.23.o
[ 22/104] diorite | c: src/c/add_routes.c -> build/src/c/add_routes.c.23.o
[ 23/104] diorite | c: src/c/manage_stops.c -> build/src/c/manage_stops.c.23.o
[ 24/104] diorite | c: src/c/radus_window.c -> build/src/c/radus_window.c.23.o
/tmp/ccAoXshm.s: Assembler messages:
/tmp/ccAoXshm.s:45: Error: thumb conditional instruction should be in IT block -- `subne r5,r5,r2'
/tmp/ccAoXshm.s:47: Error: thumb conditional instruction should be in IT block -- `subne r5,r5,r0'
Waf: Leaving directory `/tmp/tmpwXTc6s/build'
Build failed
 -> task in 'diorite/pebble-app.elf' failed (exit status 1): 
	{task 140166043558096: c location.c -> location.c.23.o}
['arm-none-eabi-gcc', '-std=c99', '-mcpu=cortex-m3', '-mthumb', '-ffunction-sections', '-fdata-sections', '-g', '-fPIE', '-Os', '-D_TIME_H_', '-Wall', '-Wextra', '-Werror', '-Wno-unused-parameter', '-Wno-error=unused-function', '-Wno-error=unused-variable', '-I/app/sdk3/pebble/diorite/include', '-I/tmp/tmpwXTc6s/build', '-I/tmp/tmpwXTc6s', '-I/tmp/tmpwXTc6s/build/include', '-I/tmp/tmpwXTc6s/include', '-I/tmp/tmpwXTc6s/build/src', '-I/tmp/tmpwXTc6s/src', '-I/tmp/tmpwXTc6s/build/diorite', '-I/tmp/tmpwXTc6s/diorite', '-I/tmp/tmpwXTc6s/node_modules/pebble-math-sll/dist/include', '-I/tmp/tmpwXTc6s/node_modules/pebble-math-sll/dist/include/pebble-math-sll/diorite', '-DRELEASE', '-DPBL_PLATFORM_DIORITE', '-DPBL_BW', '-DPBL_RECT', '-DPBL_MICROPHONE', '-DPBL_HEALTH', '-DPBL_SMARTSTRAP', '-DPBL_DISPLAY_WIDTH=144', '-DPBL_DISPLAY_HEIGHT=168', '-DPBL_SDK_3', '-D__FILE_NAME__="location.c"', '../src/c/location.c', '-c', '-o', 'src/c/location.c.23.o']

Travis builds are erroring

Summary:

I just updated the README, and as part of that Travis ran a new build and it errored out. It looks like Pebble dependencies required for unit tests have moved. Here's the Travis build:
https://travis-ci.org/OneBusAway/onebusaway-pebbletime/builds/625726109

Most recent successful build prior to this is 2017, so it's been a while...

Steps to reproduce:

Push a new commit to GitHub and watch Travis run

Expected behavior:

Travis build should pass

Observed behavior:

Travis build errors out trying to download Pebble dependencies

Device:

N/A - Travis build

Phone:

N/A

MTA-specific malfuction

Summary:
Adding stops for MTA does not work - spins forever.

Steps to reproduce:
Set location to lat = 40.7617; lon = -73.9850487; & try to add stops

Logging:
[14:01:27] pkjs> TypeError: Cannot read property 'length' of undefined
at buildRoutesList (pebble-js-app.js:769:30)
at pebble-js-app.js:873:21
at xhr.onload (pebble-js-app.js:275:10)

Image for badge on onebusaway.org

Summary:

I'd like to add a badge for the OBA Pebble app to onebusaway.org:
http://onebusaway.org/

These badges are all 44 pixels tall, and variable width depending on what's standard for each platform.

@kmwoley Could you please attach (drag/drop) a badge for OBA Pebble in this issue? I'll then take care of adding it to oba.org.

Also, please let me know exactly what URL the hyperlink should point to. Thanks!

Manage favorites doesn't allow managing favorites from other OBA servers

Summary:

If the user changes cities, the user cannot manage favorites which were set in their previous city. This is bad because it doesn't allow you to remove favorites to free up space in the watch storage, which is limited to about 30 favorite stops.

Steps to reproduce:

  1. On one server/location, add a favorite, exit
  2. Change GPS location to one with a different OBA server
  3. Open "Manage favorites" and try to manage the stop added in step 1

Expected behavior:

All favorites are listed no matter where you are physically in the world.

Observed behavior:

Only favorites from the current OBA server are listed.

Device:

All.

Phone:

All.

Change red/blue/green shades for early/late/on time arrivals

In the OBA Android v2 UI redesign, I changed the shade of red, blue, and green to be a little less harsh than the pure RGB, based on the triadic colors from the green shade we're using for the theme color for Action Bar, menues, etc.

Here's what we're currently using in OBA Android:

  • Red (late) - #af504c
  • Blue (early) - #504caf
  • Green (on time) - #4CAF50
  • Gray (scheduled - no real-time info) - #777

image

@kmwoley I'd suggest taking a look at these on an actual Pebble device and see if these colors are an improvement - if not, feel free to stick with what you're currently using.

Departures and arrivals are sometimes interchanged in text

In OBA, records from the arrivals-and-departures-from-stop API can represent either arrivals at that stop, or departures at that stop. A common bug that's existed in most OBA UIs at some point is showing all of these records as arrivals when the ETA is positive, and then a departure when the ETA is negative (i.e., the bus is coming, and it just left).

For example, here are two screenshots, with positive ETA on left, and negative ETA on right:

image

Reality is a little more nuanced for these the below conditions:

  1. Transit Centers - When looking at transit centers, buses for the same route are (typically) arriving with one headsign, waiting a short time (layover), and then departing with a new headsign. You'll see records for both these arrivals and departures from arrivals-and-departures-from-stop at the transit center.
  2. Layovers - Sometimes a route will have a short layover in the middle of the route - in that case, you'll see records for the arrival to this "break" stop, and the departure from this "break" stop in arrivals-and-departures-from-stop at this stop.
  3. Loop routes - For routes in a loop, one stop in the loop will be designated as the beginning and end stop in the data. In this case, you'll see records for the arrival to this loop stop and departure from this loop stop.

When times are always shown as "arrives in" for positive ETAs, in the above cases this is incorrect - these records should say "departs in".

Additionally, when times are always shown as "departed at ..." for negative ETAs, in the normal case this is also incorrect - it should actually say "arrived at ...".

A simple way to implement this in code is the following (pulled from Android):

if (info.getStopSequence() != 0) {
    // Show arrival time
    scheduled = info.getScheduledArrivalTime();
    predicted = info.getPredictedArrivalTime();
    mIsArrival = true;
} else {
    // Show departure time
   scheduled = info.getScheduledDepartureTime();
   predicted = info.getPredictedDepartureTime();
   mIsArrival = false;
}

If mArrival is true, then the text would be "arriving in..." for positive ETAs, and "arrived at" for negative ETAs.

If mArrival is false, then the text would be "departing in..." for positive ETAs, and "departed at" for negative ETAs.

And after this code block scheduled and predicted would always contain the time used to calculate the ETA properly for the arrival or departure.

getStopSequence() == 0 is testing if the stop is the first stop in the trip.

Here's how this looks on Android:

image

More discussion at OneBusAway/onebusaway-iphone#617 (comment).

Improve favorite route ordering in "Manage Favorites" UX

Summary:

When managing favorites, the order of the bus routes listed is dictated by the order in which the routes are added to the favorites instead of an alpha/numeric sort order. This could be better if they were sorted in a logical fashion.

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.