qistoph / mmm-nstreinen Goto Github PK
View Code? Open in Web Editor NEWMagicMirror² module to show Dutch train information
MagicMirror² module to show Dutch train information
When an incorrect API key is specified, the module will give an error: Error (Undefined) fetching NS info.
A better error message may be desired.
HI,
Great app, I have 2 instances on my mirror.
I have a future request. Is it possible to add paramater with a kind of delay in minutes. I need 10 minutes to get to the station, so I want to see the departures within 10 minutes. The current trains will already be gone when I arrive at the station.
Thanks!
Herman
Met deze API key mogen geen deur-tot-deur adviezen opgevraagd worden
Anyone else getting this error since a day or two?
Everything worked fine on 66f9f0f but since I last pulled, the module doesn't load anymore and hangs on 'Loading..."
Hi guys,
sorry for I have not been able to get more details about it. I have updated the module and all dependencies, but I get the following error still:
LIZE - Payload: [object Object]
[2020-06-07 14:01:25.272] [LOG] Error: Error: Resource not found
at /home/pi/MagicMirror/modules/nstreinen/node_modules/ns-api/nsapi.js:69:19
at finalCallback (/home/pi/MagicMirror/modules/nstreinen/node_modules/httpreq/lib/httpreq.js:98:7)
at IncomingMessage. (/home/pi/MagicMirror/modules/nstreinen/node_modules/httpreq/lib/httpreq.js:376:9)
at IncomingMessage.emit (events.js:205:15)
at endReadableNT (_stream_readable.js:1154:12)
at processTicksAndRejections (internal/process/task_queues.js:84:9) {
statusCode: 404
}
Can someone help point me in the right direction? Thank you:)
Hi,
first of all, thnx for this great module. Looks really nice.
I was wondering if it's possible to add the stations for the "randstadrail".
Although the ns.nl website recognize the randstadrail stations, this module cant find them.
Would be a great update.
Thnx in advance.
the files are in the moved to the modules folder
installled them
i have setup the config file
but nothing on screens happen?
Maybe add some color to the rendered html with a red label for the delayed time.
For example the train is leaving 12:00 but has +12 minutes delay. The traveladvice (trip) is gone when it's 12:01. Is it possible to calculate the delay? or show the previous trip?
NS just emailed that the API will change in early 2019.
This module should be updated accordingly.
Additional information that was sent:
De NS-API zoals u die kent zal uitgefaseerd worden. Van u als gebruiker verwachten wij, als u gebruik wilt blijven maken van onze services, dat u gaat migreren naar onze nieuwe API.
Hoe u dit aan moet pakken is te lezen in de migratiehandleiding die we met deze mail meesturen.
Kort samengevat gaat het volgende voor u veranderen:
· U heeft voor het gebruik van de nieuwe API een API-key nodig. Deze is aan te vragen via het NS API portaal (https://apiportal.ns.nl/)
· URL’s naar de services veranderen
· Het response is in het JSON formaat
· De veldnamen van de parameters en de responses zijn verandert.U krijgt 6 maanden de tijd om de migratie uit te voeren. De planning is om per 1 oktober 2019 de oude API uit te schakelen en onze services niet meer beschikbaar te stellen.
Bij vragen kunt u ons bereiken via het volgende e-mailadres: [email protected]
Is it possible to only show the train from location A to B instant of every train from location A ?
is het mogelijk alleen 1 traject te laten zien?
For example / voorbeeld:
Utrecht > Heerlen 10.00
Utrecht > Maastricht 10.15
Utrecht > Maastricht 10.30 +3
Hi,
Can you please help me? The screen keeps saying "Error fetching NS info: invalid API key"
I've got an API-key for "Public-Travel-Information" on https://apiportal.ns.nl/. Tried both primaire and secondaire key and also generated new ones. Do I have the wrong API?
The code is the one from the readme file:
` {
module: "nstreinen" ,
position: " top_right" ,
header: " Treinen vanaf Schiphol Airport" ,
config: {
apiKey: "xxxxxxxxxxxxxxxxxxxxxx",
fromStation: "SHL"
}
},
Thank you,
Mike
So I tried to load up the nstreinen module but it doesn't seem to work. It is showing that it needs a helper. I am new to using a Raspberry Pi so I'm not sure if I'm doing something wrong. I tested a other 3rd party Module and that one is working fine for me.
pi@raspberrypi:~/MagicMirror $ npm start
[email protected] start /home/pi/MagicMirror
sh run-start.sh
Starting MagicMirror: v2.3.1
Loading config ...
Loading module helpers ...
No helper found for module: nstreinen.
does anyone know how to fix this issue?
Related to #10
Error fetching station when the device temporarily loses internet connection. Module does not recover on its own. Error persists until the module is rebooted.
Error:
Error fetching station: Error: getaddrinfo EAI_AGAIN webservices.ns.nl webservices.ns.nl:80
Reproduce:
Temporarily disable the wifi network that the device is connected to. (Cannot confirm this is also an issue with cable internet, but I assume it is.)
The problem i'm having, and probably all other users of the MM-NStreinenn module, is the missing message of "dit reisadvies vervalt" or roughly translated: "This travel advice is not longer valid".
What i did to show this problem:
The mirror should show the train is not driving at all (preferably), this can be shown with a cross or/and by
Strikethrough text.
The "Let op, storing" message can be shown with a explanation mark or similar.
This has basically been an issue for the past year or so. Not sure why I didnt report it earlier.
After a certain amount of days the module will just get stuck and will no longer update the trips. There doesn't seem to be a pattern as to when it gets stuck. Sometimes it's a few days, sometimes more like weeks.
There also is no connection between the times at which it gets stuck. 6:12AM or 7:11PM, it appears to be completely random.
There is a simple workaround and that is just rebooting the magic mirror. While this fixes the issue temporarily this obviously is not the intended behaviour.
After MMM-pir-sensor wake-up the MMM-nstreinen cannot load data.
error: Error fetching station: Error: read ECONNRESET
when refreshing magicmirror manually through MMM-Remotecontrol it works fine again,
cant find the problem :(
Hi,
I am quite new to this, so forgive me for saying stupid stuff. I tried to follow the instructions to add the nstreinen module, but I ran into some issues. npm install resulted in several errors. I added a screenshot of these errors. The module is stuck at loading in my magicmirror. Here is the module in my config file:
{ module: 'nstreinen', position: 'top_right', header: 'Treinen vanaf Schiphol Airport', config: { apiKey:'xxx', fromStation: 'SHL' } },
Here are the versions I use:
magicmirror v2
npm version 6.13.4
nodejs version 10.18.0
Raspbian GNU/Linux 10
Additionally, I used the primary key of the "Public-Travel-Information" for the API-key in the config file (xxx). Is that the correct way?
If I need to provide additional info, please let me know.
H
hermlam 2 days ago
Hi,
A week or two ago my MMM-nstreinen module suddenly stopped. I didn’t make any changes, the api-key is ok and valid on the ns api portal.
Error is: Error (undefined) fetching NS info
Thanks,
Herman
default is 5, any other number does not work
When running npm install I get an error on the deprecated [email protected].
Then the installation quits.
I deleted the nstreinen directory, downloaded the module and the npm install again.
I get another error message that failed to parse package.json data. I am to inform the package author to fix his package.json file JSON.parse.
Error log is attached.
npm-debug.log
I'm having trouble getting this momdule to work. I followed the example provided. I get the following console.log messages:
error on loading script: modules/nstreinen//nstreinen.js
note the double slash and the fact that the dir is refered to as nstreinen and not MMM-nstreinen
I tried renaming the nstreinen.js to MMM-nstreinen.js and renamed the module in config.js, but I still cant get it to load. any suggestions?
cheers,
marc
Using only a departure station (without arrival station) works fine. Whenever I specify the arrival station, I get the "Error fetching NS info: invalid API key". Am I doing something wrong? Are other people facing the same issue?
{ module: 'nstreinen', position: 'top_right', header: 'Treinen', config: { apiKey:'<MyKey>', fromStation: 'GN', toStation: 'UT' } },
Did a new install, and now i got question marks instead of symbolMapping i guess.
So first the symbol of a train is shown, followed by space, then the question marks ??, and then the travel time between (), or Intercity + (traveltime).
Any Clue ?
Hi,
This module keeps loading on my mirror.
What am I doing wrong?
Bastiaan
It would be cool to show the amount of available public transport bikes (OV Fietsen) for the selected train station. This data is available in json format at http://fiets.openov.nl/locaties.json, but I have insufficient knowledge about javascript to build this in to your existing version. Is this something you could implement?
Hi , I tried implementing this module. The install was pretty straightforward. Getting an API these days works with the API portal by NS. I subscribed to public transport information API (many other APIS on prices / promotion etc are available. I presume that's the appropriate API. When I sign up for the API , I get a primary and secondary API. I tried pasting both in the basic config.js text:
{
module: 'nstreinen',
position: 'top_right',
header: 'Treinen vanaf Schiphol Airport',
config: {
apiKey:'',
fromStation: 'SHL'
}
}
Ive fillin in my API-key.... no module appears.
Could someone give me a few pointers?
I would love to have the possibility to set two stations as 'destination', and only show trains to those destinations. Might that be possible?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.