Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bringing New York City to One Bus Away #123

Open
marcusraylewis opened this issue May 29, 2020 · 37 comments
Open

Bringing New York City to One Bus Away #123

marcusraylewis opened this issue May 29, 2020 · 37 comments

Comments

@marcusraylewis
Copy link

Summary:

I would like to bring one bus away to NYC

Steps to reproduce:

Looking for guidance and steps to help me make this happen. The New York City Transit (MTA) has GTFS data available in real time and static data. and would love to work to add this to One Bus Away for use on Alexa devices.

Expected behavior:

"Alexa when is my next bus?" or "Alexa when is the next bus at stop 201524?"

Observed behavior:

I haven't begun the process yet wanted to get your feedback before so doing

Device:

Echo, Dot, Flex and Show

Audio or video

Not Applicable

@barbeau
Copy link
Member

barbeau commented May 29, 2020

@marcusraylewis Thanks for reaching out! You should be able to enable "experimental regions" by saying this to Alexa:

Alexa, ask OneBusAway to enable experimental regions

NYC should then be accessible like a normal region. See a list of other commands here that you can use to switch regions, etc.:
https://github.com/OneBusAway/onebusaway-alexa#using-the-onebusaway-skill

The big question is if accurate real-time arrival information is available for NYC. Long story (more info at #92, OneBusAway/onebusaway-android#768), NYC didn't originally support real-time arrival times, so only schedule info would be returned by their OBA server - this is why they are listed as an "experimental" region.

The above may have changed since I last worked on this, so I'd love to get feedback from you if it seems to work well and give you accurate real-time arrival info!

@marcusraylewis
Copy link
Author

Greetings Mr. Barbeau,

I tried enabling NYC as an experimental region and this did not work. Alexa recognized the command but began repeating the initial setup process for onebusaway. Do you have any recommendations of what is needed to have NYC as an experimental city?

@barbeau
Copy link
Member

barbeau commented May 31, 2020

It should reinitialize after setting up experimental regions. If you answer New York for the city does it find NYC?

@barbeau
Copy link
Member

barbeau commented May 31, 2020

Or just try "Alexa ask OneBusAway to set my region to New York".

@marcusraylewis
Copy link
Author

the response I get is "OneBusAway could not locate a onebusaway region near NY". She then goes on to list the supported regions. following this she asks for my city.

@barbeau
Copy link
Member

barbeau commented May 31, 2020

Hmmm... Not sure what's going on. If I do:

  • Alexa ask OneBusAway to enable experimental refions"
  • Alexa ask OneBusAway to set my region to New York City"

... it finds NYC and asks me for my stop number like normal.

Maybe make sure you add "city" after "new york"?

@marcusraylewis
Copy link
Author

I am not getting that option at all. Any idea what the issue could be?

@barbeau
Copy link
Member

barbeau commented May 31, 2020

Not sure - what exactly does it say after you enable experimental regions?

@marcusraylewis
Copy link
Author

marcusraylewis commented May 31, 2020 via email

@marcusraylewis
Copy link
Author

I sent you a voice recording of my Alexa interaction via email

@barbeau
Copy link
Member

barbeau commented May 31, 2020

You'll need to upload somewhere or share link on Dropbox - email attachments won't work here.

@marcusraylewis
Copy link
Author

Please see dropbox link https://www.dropbox.com/s/obna26zlqlbkmme/Recording.m4a?dl=0
if you didn't receive via email.

@barbeau
Copy link
Member

barbeau commented Jun 1, 2020

@marcusraylewis Sounds like you're saying:
"Alexa, set OneBusAway to experimental regions"

Please try:

"Alexa, ask OneBusAway to enable experimental regions"

Alexa can be very finicky - you have to get it exact for some of the commands.

If that works, you should hear something like "Experimental regions are now enabled" and it should list NYC as one of the experimental regions. Then say:

"Alexa, ask OneBusAway to set my city to New York City"

You can see a list of all the exact supported commands here:
https://github.com/OneBusAway/onebusaway-alexa#using-the-onebusaway-skill

@marcusraylewis
Copy link
Author

marcusraylewis commented Jun 2, 2020 via email

@marcusraylewis
Copy link
Author

I took a look at the list of commands and I am wondering if the "beta" option would work for me. I will have to look into this. I pulled it from the list below:

EnableExperimentalRegions enable experimental region
EnableExperimentalRegions enable experimental regions
EnableExperimentalRegions turn on experimental region
EnableExperimentalRegions turn on experimental regions
EnableExperimentalRegions enable beta region
EnableExperimentalRegions enable beta regions
EnableExperimentalRegions turn on beta region
EnableExperimentalRegions turn on beta regions

@marcusraylewis
Copy link
Author

Mr. Barbeau,

Could there be something wrong with the MTA server associated with OBA. I know you said that you haven't had any issue with your Alexa device recognizing the NYC as an experimental region.I am just trying to ascertain what could be the problem. I did see in one of the google groups back in November that there was "Timeout 504 Error from the OBANYC server. Your thoughts?

@barbeau
Copy link
Member

barbeau commented Jun 3, 2020

@marcusraylewis Turning on experimental regions and discovering the New York region happens before there is any communication with the MTA server, so an MTA issue wouldn't affect this part of the skill.

In short, I'm not sure why it's not working for you. You could try disable and enabling the skill to see if that changes anything, or setting up your own version of the skill using the instructions in the README to see if it works that way:
https://github.com/OneBusAway/onebusaway-alexa#develop

If anyone else is able to test on their Alexa device to see if enabling/disabling experimental regions works for them, that would help.

@marcusraylewis
Copy link
Author

marcusraylewis commented Jun 3, 2020 via email

@marcusraylewis
Copy link
Author

marcusraylewis commented Jun 3, 2020 via email

@barbeau
Copy link
Member

barbeau commented Jun 3, 2020

Hmmm...if others can't enable experimental regions either it could be a bug that I'm not seeing with my account because I'm set up as the publisher (and possibly seeing a different version of the app), or I have an older database profile and newer profiles can't access this field for some reason.

Could you open a new issue for this problem with the exact phrases you're using, and the exact response you're getting?

@marcusraylewis
Copy link
Author

marcusraylewis commented Jun 5, 2020 via email

@marcusraylewis
Copy link
Author

The Bus arrival times are incorrect and says "Based on the schedule" after the incorrect bus time notification is announced

@barbeau
Copy link
Member

barbeau commented Jul 7, 2020

@marcusraylewis Thanks! Could you give some specific examples for incorrect arrival times (including route/stop/times), along with screenshots from apps you're comparing to?

I want to:

  • Be sure we're comparing scheduled times to scheduled times (and not real-time to scheduled times)
  • Know which stops/routes we're looking at
  • Know which data sources we're looking at

@marcusraylewis
Copy link
Author

marcusraylewis commented Jul 8, 2020 via email

@barbeau
Copy link
Member

barbeau commented Jul 8, 2020

@marcusraylewis The screenshot didn't come through - could you upload via GitHub web UI?

If you're comparing the scheduled arrival times in OBA Alexa to the real-time arrival times in Transit App, they will definitely be different. OBA Alexa for NYC is just the time the bus was scheduled to be there, and the Transit App is showing real-time predicted arrivals based on bus GPS data.

@marcusraylewis
Copy link
Author

As requested see my screenshot from 8:40 this AM...

Screenshot_20200708-084042

@marcusraylewis
Copy link
Author

How can I get real time bus data into OBA Alexa or at least the most accurate data?

@barbeau
Copy link
Member

barbeau commented Jul 9, 2020

@marcusraylewis From the above screenshot looks like all the trips except for the SIM34 route have real-time data (the little wireless symbol indicates real-time). The OBA Alexa arrival time for SIM34 should have matched the time in Transit App for this example, as it sounds like they are both providing schedule data.

How can I get real time bus data into OBA Alexa or at least the most accurate data?

Unfortunately I don't think you can get NYC real-time data via OBA Alexa right now - that's the reason the NYC region is still experimental. As I said in #123 (comment):

The big question is if accurate real-time arrival information is available for NYC. Long story (more info at #92, OneBusAway/onebusaway-android#768), NYC didn't originally support real-time arrival times, so only schedule info would be returned by their OBA server - this is why they are listed as an "experimental" region.

The above may have changed since I last worked on this, so I'd love to get feedback from you if it seems to work well and give you accurate real-time arrival info!

I'm curious if any stops/routes have real-time data in NYC in OBA Alexa. If not, I don't think there is anything as a user you can do to change this, other than ask MTA to provide real-time arrival times in OneBusAway the same way other regions are.

@marcusraylewis
Copy link
Author

My preliminary research seems to indicate that MTA Bus Time supports GTFS real time data. Please see the following links. https://bustime.mta.info/wiki/Developers/GTFSRt

What is not very clear is the relationship of the OBA Restful API especially concerning Real Time. and getting real time data to OBA Alexa. See https://bustime.mta.info/wiki/Developers/OneBusAwayRESTfulAPI and https://github.com/OneBusAway/onebusaway-application-modules/wiki/RESTful-API-Roadmap

@barbeau
Copy link
Member

barbeau commented Jul 9, 2020

OBA Alexa uses the regional OBA servers defined in the Regions API:
http://regions.onebusaway.org/regions-v3.json

Each of these servers are maintained by the local transit agency, which means that MTA NYC maintains the NYC server - the same server(s) that backs https://bustime.mta.info/ (the address is actually the same).

MTA was the first OBA deployment outside of Puget Sound, and in the process they forked the code and changed a few things. Historically MTA NYC didn't publish arrival times, just "distance to stop" (some mention of this here - https://bustime.mta.info/wiki/Developers/SIRIIntro), although that's since changed. The also chose to initially support SIRI as the real-time RESTful API instead of the real-time OBA Restful API - they do expose the OBA API now, but https://bustime.mta.info/wiki/Developers/OneBusAwayRESTfulAPI says:

The primary modification is to exclude all real-time data, which in the context of MTA Bus Time should come from the standards-based SIRI API.

tl;dr things have changed over time, and I can loop back to MTA again and see if supporting real-time info via the OBA Restful API is on their roadmap now.

It may be possible to set up your own OBA server and input the MTA GTFS and GTFS-realtime data - I assume that would work given that they are now publishing GTFS and GTFS-RT data. But it seems kind of silly to do that when MTA is already running one of their own.

I'll ask MTA and see what they say.

@marcusraylewis
Copy link
Author

marcusraylewis commented Aug 5, 2020 via email

@barbeau
Copy link
Member

barbeau commented Aug 5, 2020

@marcusraylewis I talked to MTA and they are looking into changing their system to publish this data. No promises or ETA yet, but feel free to ping me in a few more weeks if you don't hear anything.

@marcusraylewis
Copy link
Author

marcusraylewis commented Aug 5, 2020 via email

@marcusraylewis
Copy link
Author

marcusraylewis commented Sep 22, 2020 via email

@barbeau
Copy link
Member

barbeau commented Sep 22, 2020

Thanks for following up. It isn't something MTA is currently working on, but it's something they would like to pursue in the future. Unfortunately I don't have an exact timeline.

@marcusraylewis
Copy link
Author

marcusraylewis commented Dec 4, 2020 via email

@barbeau
Copy link
Member

barbeau commented Dec 4, 2020

@marcusraylewis Thanks for following up. The last response I got from them is that they're interested, but with COVID-19 issues it's (understandably) not a priority at this time.

I'd encourage you or anyone else that's interested to reach out to MTA directly at [email protected] and request that they "support real-time information via the OneBusAway REST APIs" so that OneBusAway Alexa, Android, and iOS will work with the MTA's servers. I'm sure they will record the feedback and when things aren't in such a critical state they'll have the evidence they need that customers want this to make it happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants