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

[🐛 BUG] - Transit module stopped working #33

Closed
nipper2000h opened this issue Jul 4, 2020 · 15 comments
Closed

[🐛 BUG] - Transit module stopped working #33

nipper2000h opened this issue Jul 4, 2020 · 15 comments
Assignees
Labels
🐛 bug Something isn't working

Comments

@nipper2000h
Copy link

Describe the bug
The module stopped working after a change from the data provider

To Reproduce
I have opened a troubleshooting thread here:
https://forum.magicmirror.builders/topic/13185/transit-module-stopped-working/1?_=1593886364430

Others have confirmed the module no longer works as intended.

Expected behavior
The next three trains are displayed in a countdown clock style.

** Actual behavior**
No trains are displayed. "Next train" is displayed but no trains load.

Screenshots
Screenshot is here:
https://forum.magicmirror.builders/topic/13185/transit-module-stopped-working/1?_=1593886364430

Platform (please complete the following information):

  • Node Version:
  • Web Browser/Electron version:
  • Hardware [e.g. Raspberry Pi 2/3, Windows, Mac, Linux, System V UNIX]:

Configuration
`/* Magic Mirror Config Sample
*

*/

var config = {
address: "localhost", // Address to listen on, can be:
// - "localhost", "127.0.0.1", "::1" to listen on loopback interface
// - another specific IPv4/6 to listen on a specific interface
// - "0.0.0.0", "::" to listen on any interface
// Default, when address config is left out or empty, is "localhost"
port: 8080,
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses
// or add a specific IPv4 of 192.168.1.5 :
// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
// or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],

useHttps: false, 		// Support HTTPS or not, default "false" will use HTTP
httpsPrivateKey: "", 	// HTTPS private key path, only require when useHttps is true
httpsCertificate: "", 	// HTTPS Certificate path, only require when useHttps is true

language: "en",
timeFormat: 12,
units: "imperial",
// serverOnly:  true/false/"local" ,
		     // local for armv6l processors, default
		     //   starts serveronly and then starts chrome browser
		     // false, default for all  NON-armv6l devices
		     // true, force serveronly mode, because you want to.. no UI on this device

modules: [
	{
		module: "alert",
	},
	{
		module: "clock",
		position: "top_left"
	},
	{
		module: "calendar_monthly",
		position: "top_left",
		config: {
			// The config property is optional
			// Without a config, a default month view is shown
			// Please see the 'Configuration Options' section for more information
		}
	},
	{
		module: "MMM-TimeTreeEvent",//Positions of *_bar and *_third are not support.
		position: "top_left",
		config: {
			appid: "calendarapi",//You need to get the target calender id with Get calender id api[1]
			calenderid: "calendarid",
		}
	},
	{
		module: "MMM-Events",
		position: "top_left",
		config: {
			city: "New York",// Your City
			eventType: "performing_arts,conference_convention,festivals_parades,movies_film,food,fundraisers,support,book,music_alternative,music_dance,music_jazz,music_reggae,music_vocal,music_rap_hiphop,music_rock,music_pop,music_country,",
			when: "This Week",// "All", "Future", "Past", "Today", "Last Week", "This Week", "Next week", and months by name, e.g. "October"
			mode: "noFrame",// "Frame" or "noFrame" (around picture)
			apikey: "eventsapi",
			rotateInterval: 1 * 11 * 1000,// New Event Appears every 5 minutes
			useHeader: false,// Set to true if you want a header
			header: "",
			animationSpeed: 3000,// Event fades in and out
			picture: true,// true, false = no image
		}
	},
	{
		module: "MMM-TwitterTrendsByPlace",
		position: "bottom_right",
		config: {
		// visit the url below for the twitter keys/tokens
		// https://dev.twitter.com/oauth/overview/application-owner-access-tokens
			consumer_key: "twitterapi",
			consumer_secret: "twitterapi",
			access_token_key: "twitterapi",
			access_token_secret: "twitterapi",//set the display name/title for the place
			placeName: "New York, NY",// set the woeid for the place, see documentation for more// http://woeid.rosselliot.co.nz/lookup/
			placeWoeid: "2459115",
		}
	},
	{
		module: "MMM-nyc-transit",
		position: "bottom_left",
		header: "Next Train",
		config: {
			apiKey: "mytransitapi",
			displayType: "list",
			mtaType: "train",
			stations: [
				{
					stationId: 476,
					walkingTime: 0,
					dir: {
						upTown:true,
						downTown: false
					}
				},
			],
			updateInterval: 300000
		}
	},
	{
		module: "MMM-MTA",
		position: "bottom_left",
		header: "MTA",
		config: {
			lines: ["123", "BDFM", "456", "NQR", "ACE"],
			showDelaysOnly: false,
			delayAlertFlash: true,
			fetchInterval: 60000
		}
	},
	{
		module: "currentweather",
		position: "top_right",
		config: {
			location: "New York",
			locationID: "", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
			appid: "myweatherapi"
		}
	},
	{
		module: "weatherforecast",
		position: "top_right",
		header: "Weather Forecast",
		config: {
			location: "New York",
			locationID: "5128581", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
			appid: "myweatherapi"
		}
	},
	{
		module: "weatherforecast",
		position: "top_right",
		header: "Weather Forecast",
		config: {
			location: "Asbury Park, NJ",
			locationID: "5095281", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
			appid: "myweatherapi"
		}
	},
	{
		module: "newsfeed",
		position: "lower_third",
		config: {
			feeds: [
				{
					title: "New York Times",
					url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"
				},
				{
					title: "CNN",
					url: "http://rss.cnn.com/rss/cnn_topstories.rss"
				},
				{
					title: "BBC",
					url: "http://feeds.bbci.co.uk/news/world/us_and_canada/rss.xml"
				},
				{
					title: "NBC",
					url: "http://feeds.nbcnews.com/nbcnews/public/news"
				},
				{
					title: "Time News",
					url: "https://time.com/newsfeed/feed/"
				},
			],
			showSourceTitle: true,
			showPublishDate: true,
			broadcastNewsFeeds: true,
			broadcastNewsUpdates: true
		}
	},
]

};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = config;}

0
Ssdetweil about 18 hours ago `

Additional context

Error message from pm2 logs:

2020-06-30 09:41:59.974] [ERROR] (node:882) UnhandledPromiseRejectionWarning: Error: Error: Illegal group end indicator for Message .transit_realtime.FeedMessage: 7 (not a group) 0|mm | at /home/pi/MagicMirror/modules/MMM-nyc-transit/node_helper.js:106:15

@nipper2000h nipper2000h added the 🐛 bug Something isn't working label Jul 4, 2020
@github-actions
Copy link

github-actions bot commented Jul 4, 2020

Thank you for your feedback!' first issue

@Elaniobro
Copy link
Owner

@nipper2000h thank you for posting the bug. I am looking into this and seeing if I am able to re-create the issue you speak of. It might take me a few days or more.

FWIW: I have seen the promise reject error before, that I believe is due to polling the API to frequently with your API key. As of know, I am not sure of what the rate limit is or even if one exists. I'll continue looking into it. Please let me know if the module begins working prior to me resolving this issue. Thanks!

@nipper2000h
Copy link
Author

Thanks a lot for being so responsive and checking this out. I love this module and find it very functional, thanks again for writing it. As of today it is still down and pm2 logs are still showing the same message.. I made a second account with MTA and used a different API key but still no luck. Is yours working? What is the polling rate you are using?

@NickEngmann
Copy link

I'm having a similar issue where no Train data is being pulled anymore. The issue started occurring about 4 days ago.

@Elaniobro
Copy link
Owner

@NickEngmann thank you for your feedback.

Will you and @nipper2000h please share with me, which version of MagicMirror you are currently running? Nothing in the code was updated recently, which leads me to suspect something out side this module was updated.

In order for me to remedy/fix this bug, I would like to try and figure out what changes were introduced, which should allow me to update this module for myself and all of you.

Thanks!

@NickEngmann
Copy link

@Elaniobro I am currently on MM version 2.10.1 and I'm running my MagicMirror server only.

@Elaniobro
Copy link
Owner

@NickEngmann Thank you for this information. In reading the #1973 it looks like v2.11.0 actually broke some modules due to how the socket.io was being referenced. v2.12.0 resolved that.

I am wondering if a previous version of MagicMirror still works with this module or if v.2.12.0 works for you.

@nipper2000h
Copy link
Author

nipper2000h commented Jul 6, 2020

@Elainiobro Thank you for this information. In reading the #1973 it looks like v2.11.0 actually broke some modules due to how the socket.io was being referenced. v2.12.0 resolved that.

I am wondering if a previous version of MagicMirror still works with this module or if v.2.12.0 works for you.

I'm running 2.11.0. I updated to version 2.12.0 and still no luck. I don't see anything in the logs after updating.

@Elaniobro
Copy link
Owner

@NickEngmann & @nipper2000h I made some slight adjustments, but the module is still not populating. I do see the fetch trying to get data but the response in the payload is empty.

payload = [{ downTown: [] }, { upTown: [] }]

For some reason, just not getting any data ☹️ I am still digging into this. I am wondering if its just my API key.

@NickEngmann
Copy link

I did receive an email back in May saying that the NYC-MTA was changing its URL endpoints, could that somehow affect how this module functions?

@Elaniobro
Copy link
Owner

@NickEngmann would you please post the e-mail? I never received one. I also posted to the google forum and was told that the endpoint did in fact change, which would account for the breakage in the module.

Once I re-connect it, you should be back up and running. I just need to find out what the new endpoint is.

@NickEngmann
Copy link

Here is a screenshot of the e-mail they sent out. Looks like the new endpoint is https://api.mta.info/

Screen Shot 2020-07-11 at 6 40 56 PM

@Elaniobro
Copy link
Owner

The new API is going to require a complete re-write of this module as far as I can tell...... unless I am missing something.

It seems like the new api endpoint does not have the same data contract. Not to mention that the dependencies I use, as far as I can tell, will not be supporting the new API:

 "mta-realtime-subway-departures": "0.0.13"
 "mta-subway-stations": "0.0.2",

Thank you for the screenshot of the e-mail @NickEngmann, I see this as a challenge that I openly accept, but I am afraid this will no longer be a 1-2-3 fix. 😢

@kurtraschke
Copy link

I've opened ericandrewlewis/mta-realtime-subway-departures#4 to switch that package from datamine.mta.info to api.mta.info. The feed content is the same; it's just that the feed URLs have changed and the API key is passed as a header rather than a URL parameter (note that a new key is required for api.mta.info).

@Elaniobro
Copy link
Owner

@kurtraschke thank you for that PR, and thank you @ericandrewlewis for your module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants