GithubHelp home page GithubHelp logo

Comments (22)

nwootton avatar nwootton commented on June 22, 2024

Ok, I'll try and look at that today.

from mmm-uknationalrail.

nwootton avatar nwootton commented on June 22, 2024

Did you do the npm install in the module directory prior to running the Mirror?

Using the following config:

	{
		module: 'MMM-UKNationalRail',
		position: 'bottom_left',
		config: {
	      		stationCode: 'HUD', 							// CRS code for station
			app_id: 'xxxxxxxx', 							// TransportAPI App ID
			app_key: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' 	// TransportAPI App Key
		}
	},

I get it to connect and display without issues.

screen shot 2017-06-28 at 11 53 59

from mmm-uknationalrail.

tomdpi avatar tomdpi commented on June 22, 2024

I did, i've just run it again just in case but no change
image

Using the Bus module with no issues.

from mmm-uknationalrail.

nwootton avatar nwootton commented on June 22, 2024

What other modules are you running? Is this a fresh install or an old install? Have you done an update recently?

from mmm-uknationalrail.

tomdpi avatar tomdpi commented on June 22, 2024

alert
updatenotification
clock
calendar
currentweather
weatherforecast
newsfeed
MMM-UKLiveBusStopInfo
MMM-UKNationalRail

from mmm-uknationalrail.

nwootton avatar nwootton commented on June 22, 2024

Can you copy your complete config (minus API keys) - I've stripped my test config down to the items listed and it's still runs.

from mmm-uknationalrail.

tomdpi avatar tomdpi commented on June 22, 2024
var config = {
        port: 8080,
        ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1", "192.168.0.3", "192.168.0.2", "$

        language: "en",
        timeFormat: 24,
        units: "metric",

        modules: [
                {
                        module: "alert",
                },
                {
                        module: "updatenotification",
                        position: "top_bar"
                },
                {
                        module: "clock",
                        position: "top_left"
                },
                {
                        module: "calendar",
                        header: "Calendar",
                        position: "top_left",
                        config: {
                                calendars: [
                                        {
                                                symbol: "calendar-check-o ",
                                                url: " "
                                        }
                                ]
                        }
                },
                {
                        module: "currentweather",
                        position: "top_right",
                        config: {
                                location: "Huddersfield",
                                locationID: "2646458",  //ID from http://www.openweathermap.o$
                                appid: " "
                        }
                },
                {
                        module: "weatherforecast",
                        position: "top_right",
                        header: "Weather Forecast",
                        config: {
                                location: "Huddersfield",
                                locationID: "2646458",  //ID from http://www.openweathermap.o$
                                appid: " "
                        }
                },
                {
                        module: "newsfeed",
                        position: "bottom_bar",
                        config: {
                                feeds: [
                                        {
                                                title: "BBC",
                                                url: "http://feeds.bbci.co.uk/news/rss.xml"
                                        }
                                ],
                                showSourceTitle: true,
                                showPublishDate: true,
                                ignoreOlderThan: 86400000
                        }
                },
                {
                        module: "MMM-UKLiveBusStopInfo",
                        position: "bottom_left",
                        header: "Departures",
                        config: {
                                        atcocode: "  ", //removed for sharing
                                        app_id: " ",
                                        app_key: " ",
                                        limit: 5,
                                        nextBuses: "yes",
                                        showRealTime: false,
                                        showDelay: false
                                }
                },
                {
                        module: "MMM-UKNationalRail",
                        position: "bottom_left",
                        config: {
                                        stationCode: "HUD",
                                        app_id: " ",
                                        app_key: " "
                                }
                }
        ]

};

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




from mmm-uknationalrail.

nwootton avatar nwootton commented on June 22, 2024

I've used a random bus stop for the atco and replaced the various API keys with my own and it all works. Calendar errors because of lack of url, but that's expected.
screen shot 2017-06-28 at 12 45 45
Only thing I can think of is that you have exceeded your daily allowance by using the nextBuses = "yes" for the bus stop module. This is VERY expensive (see Notes in the module) and will mean that you use up your ENTIRE daily Transport API credits in about 8 hours alone. Add the additional 1 point every 5 minutes for the rail module and this drops it to ~ 7.5 hours. So by 07:30 you could have run out of credits.

Are you sure the bus module is also working correctly?

Check the stats on the Transport API to see the usage as well - that will tell you if you are exceeding the quota.

from mmm-uknationalrail.

tomdpi avatar tomdpi commented on June 22, 2024

I wondered about this, however the mirror isnt running all the time as i'm still setting up - i only installed on Monday. I turned it on around 10 am this morning and it never worked from that point. No usage warnings on transportAPI account either.

I had to use nextBuses as without that the API doesnt return any data for my stop. In any case, the buses are loading, which i presume they wouldnt if i'd used my daily hits.

from mmm-uknationalrail.

nwootton avatar nwootton commented on June 22, 2024

Ok next step: If you run the mirror in server mode, you can use a browser to see the console messages. Instead of running it via 'npm start' run it using 'node serveronly'.

Point a normal web browser at the ip address:8080 of the mirror and it should appear. Do you know how to inspect a web page via a browser? If so have a look at the console and see if there are any errors being output.

from mmm-uknationalrail.

tomdpi avatar tomdpi commented on June 22, 2024

I'm already running serveronly mode - no errors showing there. There are however errors in the browser console

:8080/modules/MMM-UKNationalRail//MMM-UKNationalRail.js:248 Uncaught TypeError: Cannot read property 'all' of undefined
    at Class.processTrains (:8080/modules/MMM-UKNationalRail//MMM-UKNationalRail.js:248)
    at Class.socketNotificationReceived (:8080/modules/MMM-UKNationalRail//MMM-UKNationalRail.js:361)
    at module.js:183
    at n.<anonymous> (socketclient.js:26)
    at n.emit (socket.io.js:2)
    at n.onevent (socket.io.js:3)
    at n.MMSocket.self.socket.onevent (socketclient.js:19)
    at n.onpacket (socket.io.js:3)
    at n.<anonymous> (socket.io.js:3)
    at n.emit (socket.io.js:2)
:8080/modules/MMM-UKNationalRail//MMM-UKNationalRail.js:248 Uncaught TypeError: Cannot read property 'all' of undefined
    at Class.processTrains (:8080/modules/MMM-UKNationalRail//MMM-UKNationalRail.js:248)
    at Class.socketNotificationReceived (:8080/modules/MMM-UKNationalRail//MMM-UKNationalRail.js:361)
    at module.js:183
    at n.<anonymous> (socketclient.js:26)
    at n.emit (socket.io.js:2)
    at n.onevent (socket.io.js:3)
    at n.MMSocket.self.socket.onevent (socketclient.js:19)
    at n.onpacket (socket.io.js:3)
    at n.<anonymous> (socket.io.js:3)
    at n.emit (socket.io.js:2)

from mmm-uknationalrail.

nwootton avatar nwootton commented on June 22, 2024

Weird - that is an old error caused by the module NOT handling empty responses from the TransportAPI - generally due to train operators not providing information in a consistent manner. Let me go and check the various GIT branches..... How did you download the module BTW?

from mmm-uknationalrail.

tomdpi avatar tomdpi commented on June 22, 2024

Followed the steps on the Readme

from mmm-uknationalrail.

nwootton avatar nwootton commented on June 22, 2024

OK. Let me get back to you.

from mmm-uknationalrail.

nwootton avatar nwootton commented on June 22, 2024

I get the error you describe above :

MMM-UKNationalRail.js:248 Uncaught TypeError: Cannot read property 'all' of undefined
    at Class.processTrains (MMM-UKNationalRail.js:248)
    at Class.socketNotificationReceived (MMM-UKNationalRail.js:361)
    at module.js:183
    at n.<anonymous> (socketclient.js:26)
    at n.emit (universalModuleDefinition:2)
    at n.onevent (universalModuleDefinition:3)
    at n.MMSocket.self.socket.onevent (socketclient.js:19)
    at n.onpacket (universalModuleDefinition:3)
    at n.<anonymous> (universalModuleDefinition:3)
    at n.emit (universalModuleDefinition:2)

by putting in the wrong app_id or app_key. Can you check these are correct and are properly quoted?

from mmm-uknationalrail.

tomdpi avatar tomdpi commented on June 22, 2024

yeah they look ok, they're exactly the same as the entries in Bus times. I tried generating a new API key in case that was it but got the same issue. All quotes look ok, same as the config above

from mmm-uknationalrail.

nwootton avatar nwootton commented on June 22, 2024

Ok I've released a version with better error handling and debug capabilities. Firstly you'll need to do a git pull && npm install to make sure you have the latest version. You'll also need to add

	debug:	false

to your NationalRail config in the mirror config file. Hopefully we can then get a better idea of where the error is happening. Everything I do this end indicates that the request being made is wrong - either _key, or _id or even station code. BUT the config you gave me doesn't seem to support this.

Let me know what the error is in the console.

from mmm-uknationalrail.

nwootton avatar nwootton commented on June 22, 2024

There is also a 'URL Request is: ' output in the console log. If you copy this link and paste it into a browser it should return the JSON for the station departures.

from mmm-uknationalrail.

tomdpi avatar tomdpi commented on June 22, 2024

Ok, i now get a 'no info about station returned' message. No messages to STDOUT or the browser console. I set the debug setting to true, still don't see anything on STDOUT but get these in the console

:8080/modules/MMM-UKNationalRail//MMM-UKNationalRail.js:324 Objectdata: Array(0)length: 0__proto__: Array(0)concat: function concat()arguments: nullcaller: nulllength: 1name: "concat"__proto__: function ()constructor: function Array()arguments: nullcaller: nullfrom: function from()isArray: function isArray()length: 1name: "Array"of: function of()prototype: Array(0)Symbol(Symbol.species): (...)get Symbol(Symbol.species): function [Symbol.species]()__proto__: function ()copyWithin: function copyWithin()entries: function entries()every: function every()fill: function fill()filter: function filter()find: function find()findIndex: function findIndex()forEach: function forEach()includes: function includes()indexOf: function indexOf()join: function join()keys: function keys()lastIndexOf: function lastIndexOf()length: 0map: function map()pop: function pop()push: function push()reduce: function reduce()reduceRight: function reduceRight()reverse: function reverse()shift: function shift()slice: function slice()some: function some()sort: function sort()splice: function splice()toLocaleString: function toLocaleString()toString: function toString()unshift: function unshift()Symbol(Symbol.iterator): function values()Symbol(Symbol.unscopables): Object__proto__: Objectmessage: "No info about the station returned"stationName: "Departures"timestamp: Wed Jun 28 2017 14:23:49 GMT+0100 (GMT Summer Time)__proto__: Objectconstructor: function Object()hasOwnProperty: function hasOwnProperty()isPrototypeOf: function isPrototypeOf()propertyIsEnumerable: function propertyIsEnumerable()toLocaleString: function toLocaleString()toString: function toString()valueOf: function valueOf()__defineGetter__: function __defineGetter__()__defineSetter__: function __defineSetter__()__lookupGetter__: function __lookupGetter__()__lookupSetter__: function __lookupSetter__()get __proto__: function __proto__()set __proto__: function __proto__()
processTrains @ :8080/modules/MMM-UKNationalRail//MMM-UKNationalRail.js:324
:8080/modules/MMM-UKNationalRail//MMM-UKNationalRail.js:325 ^^^^^^^^^^^^^^^^^^^^^^^
processTrains @ :8080/modules/MMM-UKNationalRail//MMM-UKNationalRail.js:325

No sign of the URL Request is message though...

from mmm-uknationalrail.

tomdpi avatar tomdpi commented on June 22, 2024

Second pull and install picked up the change in your commit. I'm sorry to say this a big fat user error - in the application key being incorrect (1 and l look exactly the same in Putty).

Thanks for the great support and sorry for the wasted time

from mmm-uknationalrail.

nwootton avatar nwootton commented on June 22, 2024

Ok. Bit worried that it took 2 pulls, but glad it's working. Have a good day and enjoy your mirror.

from mmm-uknationalrail.

tomdpi avatar tomdpi commented on June 22, 2024

Threw me a bit too:

/MagicMirror/modules/MMM-UKNationalRail $ git pull
remote: Counting objects: 11, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 11 (delta 5), reused 10 (delta 4), pack-reused 0
Unpacking objects: 100% (11/11), done.
From https://github.com/nwootton/MMM-UKNationalRail
   483bb38..5c7d298  master     -> origin/master
Updating 483bb38..5c7d298
Fast-forward
 .gitignore            |   2 +
 MMM-UKNationalRail.js | 768 ++++++++++++++++++++++++++++++++++++++---------------------------------
 README.md             |  13 +-
 3 files changed, 424 insertions(+), 359 deletions(-)
~/MagicMirror/modules/MMM-UKNationalRail $ git pull
Updating 5c7d298..d747e55
Fast-forward
 MMM-UKNationalRail.js | 9 +++++++++
 1 file changed, 9 insertions(+)

from mmm-uknationalrail.

Related Issues (17)

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.