mrvragec / mmm-mvgmunich Goto Github PK
View Code? Open in Web Editor NEWMagicMirror² Module to monitor public transport (U-bahn, tram, bus, S-Bahn) in Munich
License: MIT License
MagicMirror² Module to monitor public transport (U-bahn, tram, bus, S-Bahn) in Munich
License: MIT License
Everytime I am trying to fetch any data it says undefined (even with the standard config template given in your repo)
Internet working (can fetch other apis etc.)
node latest version
Running on docker bastilimbach/docker-magicmirror
I don't know if they changed their API but it is still working with station id's...
Thanks
When formatting "td.timing" this does not apply to the walking time.
Line 129/130 of mvgmunich.js should look like:
if (this.config.showWalkingTime) { htmlText += "<td class='timing'> / ";
Hi,
in my config file I wrote:
maxEntries: 6,
but only 3 departures are shown.
When don't use maxEntries at all it shows 4 departures.
What can I do to fix this?
Hi, despite a second install Fresh as You described in issue #43 (comment)
I am still not getting any data, npm start results in the following error:
Unexpected token < in JSON at position 0 at JSON.parse (<anonymous>) at Request._callback (/home/pi/MagicMirror/modules/mvgmunich/node_helper.js:59:31) at Request.self.callback (/home/pi/MagicMirror/node_modules/request/request.js:185:22) at Request.emit (events.js:315:20) at Request.<anonymous> (/home/pi/MagicMirror/node_modules/request/request.js:1154:10) at Request.emit (events.js:315:20) at Gunzip.<anonymous> (/home/pi/MagicMirror/node_modules/request/request.js:1076:12) at Object.onceWrapper (events.js:421:28) at Gunzip.emit (events.js:327:22) at endReadableNT (_stream_readable.js:1220:12)
A JSOn check of request.js retrieves that: Parse error on line 1: 'use strict'var ht ^ Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'
Any idea how to fix that?
Thanks
Hiya
great module, thx a million. Exactly what I was looking for.
Unfortunately only Hauptbahnhof works for me. I was trying to change it to Aufhausen and module is not defined.
Any idea?
Hi Folks,
no matter which station name i put in the config file,
i always get
"The name of the station is not correct, please check on MVG."
tried at least 20 different stations which definitely exists.
same with default "Hauptbahnhof".
raspbian 9 (stretch)
MagicMirror 2.9.0
any ideas?
Hello mrVragec,
I want to show two different stations.
One for me and one for my wife.
I was trying to load the module twice but then it shows the data for one station in both modules.
All the different settings how ever apply to both modules differently.
Also tried adding an array into the station field like [StationA, Station], but I guess this is not supported. So I also tried renaming everying in your module to mvgmunich2 but then this model will not start.
My Linux and JavaScript skills are limited but I am not new to programming. I would be thankful for a little bit of direction. I am even willing to help developing if needed.
Problem solved...
The modules is not showing entries for S-Bahn
Hi
I updated the magic mirror to the latest version
I tried the MVG module both from master and dev path.
Stations like Hauptbahnhof or Berg am Laim are fine but Süskindstraße
Option to show disruptions should be implemented.
Details:
I installed it, as told in you description but i get the following errors:
The mirror boots like normal, but does not show the MVG plan.
MM Version ## [2.1.3] - 2017-10-01
But tried with the newest also.
Hope you can help.
`pi@raspberrypi:~/MagicMirror $ npm install cheerio && npm install array-filter
[email protected] /home/pi/MagicMirror
├── [email protected]
└── UNMET PEER DEPENDENCY [email protected] invalid
npm WARN [email protected] requires a peer of stylelint@^8.0.0 but none was installed.
npm WARN [email protected] requires a peer of stylelint@^8.0.0 but none was installed.
[email protected] /home/pi/MagicMirror
├── [email protected]
└── UNMET PEER DEPENDENCY [email protected] invalid
npm WARN [email protected] requires a peer of stylelint@^8.0.0 but none was installed.
npm WARN [email protected] requires a peer of stylelint@^8.0.0 but none was installed.
`
I have a similar problem. I'm trying to list Karlsplatz as the station. Unfortunately I only get undefined as result
Enclosed the configuration
module: "mvgmunich",
position: "bottom_left",
header: "MVG",
config: {
haltestelle: "Karlsplatz",
maxEntries: 10, // 10 items on screen
updateInterval: 60000, // 60 s
showIcons: true, // Show transport type icon
transportTypesToShow: {
"ubahn": true, // show ubahn route
"sbahn": true, // show sbahn route
"bus": true, // show bus route
"regional_bus": true, // show regional bus route
"tram": true // show tram route
},
ignoreStations: [], // lines with destination to which should not be shown
lineFiltering: {
"active": true, // set this to active if filtering should be used
"filterType": "whitelist", // whitelist = only specified lines will be displayed, blacklist = all lines except specified lines will be displayed
"lineNumbers": ["U1", "U3", "X50"] // lines that should be on the white-/blacklist
},
timeToWalk: 10, // 10 min walking time to station. Default is 0
showWalkingTime: false, // if the walking time should be included and the starting time is displayed
showTrainDepartureTime: true, // show tran departure time
trainDepartureTimeFormat: "relative", // format of the train departure time
walkingTimeFormat: "relative", // format of the walking time
showInterruptions: true, // show interruptions as gray-out rows
showInterruptionsDetails: false, // show details of interruptions in next line
countInterruptionsAsItemShown: false, // count interruptions details lines as a line shown
}
Hier exmerimentell die direkten Abfragen bei der MVG. An sich sollte es funktionieren.
https://www.mvg.de/api/fahrinfo/location/queryWeb?q=Karlsplatz
https://www.mvg.de/api/fahrinfo/departure/de:09162:1?footway=0
Nevertheless the module give back undefined
I'm not quite sure why I can't. I've looked at other issues. I'm at Master Branch. It should work out like I read.
Hi this is what I did:
{
module: "mvgmunich",
position: "bottom_left",
header: "MVG",
config: {
haltestelle: "Hauptbahnhof",
maxEntries: 25, // 10 items on screen
updateInterval: 60000, // 60 s
showUbahn: true, //show ubahn route
showBus: true, // show bus route
showTram: true, // show tram route
showSbahn: true // show sbahn route
}
},
The module does not appear on my screen.
I tried to change the position to "top_right" but no changes.
Any ideas?
Currently Time to walk displays an absolute time when you should start walking and a relative time when the next u-bahn/s-bahn/bus/Tram/etc. departs.
I personally like it the other way round: absolute for departure, relative for when I need to go.
Hence my question: Would it be possible to have an option to configure both times being absolute or relative?
No data or incomplete data is displayed.
Enclosed is the error log from ~/.pm2/logs/
[2020-10-04 23:09:49.553] [ERROR] Error while parsing and sending departure info SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at Request._callback (/home/pi/MagicMirror/modules/mvgmunich/node_helper.js:59:31)
at Request.self.callback (/home/pi/MagicMirror/modules/mvgmunich/node_modules/request/request.js:185:22)
at Request.emit (events.js:200:13)
at Request. (/home/pi/MagicMirror/modules/mvgmunich/node_modules/request/request.js:1154:10)
at Request.emit (events.js:200:13)
at IncomingMessage. (/home/pi/MagicMirror/modules/mvgmunich/node_modules/request/request.js:1076:12)
at Object.onceWrapper (events.js:288:20)
at IncomingMessage.emit (events.js:205:15)
at endReadableNT (_stream_readable.js:1154:12)
[2020-10-05 10:15:39.514] [ERROR] Error while parsing and sending departure info SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at Request._callback (/home/pi/MagicMirror/modules/mvgmunich/node_helper.js:59:31)
at Request.self.callback (/home/pi/MagicMirror/modules/mvgmunich/node_modules/request/request.js:185:22)
at Request.emit (events.js:200:13)
at Request. (/home/pi/MagicMirror/modules/mvgmunich/node_modules/request/request.js:1154:10)
at Request.emit (events.js:200:13)
at IncomingMessage. (/home/pi/MagicMirror/modules/mvgmunich/node_modules/request/request.js:1076:12)
at Object.onceWrapper (events.js:288:20)
at IncomingMessage.emit (events.js:205:15)
at endReadableNT (_stream_readable.js:1154:12)
This is my config:
{
module: "mvgmunich",
disabled: false,
position: "bottom_right",
header: "MVG",
config: {
haltestelle: "Putzbrunn, Michael-Haslbeck-Straße",
//haltestelle: "Karlsplatz",
maxEntries: 5, // 5 items on screen
updateInterval: 60000, // 60 s
transportTypesToShow: {
"ubahn": true, // show ubahn route
"sbahn": true, // show sbahn route
"bus": true, // show bus route
"regional_bus": true, // show regional bus route
"tram": true // show tram route
},
ignoreStations: ["Neubiberg, Unterbiberg", "Grasbrunn, Kirchplatz"], // destination not to be shown
timeToWalk: 2, // min walking time to station. Default is 0
showWalkingTime: false, // if the walking time should be included and the starting time is displayed
showTrainDepartureTime: true, // if the time of train departure should be displayed
trainDepartureTimeFormat: "absolute", // time format: absolute: 21:10; relative: in 8 min
walkingTimeFormat: "relative", // time format: absolute: 21:08; relative: in 6 min
showInterruptions: true,
showInterruptionsDetails: true,
countInterruptionsAsItemShown: false,
lineFiltering: {
"active": false, // set this to active if filtering should be used
"filterType": "whitelist",
"lineNumbers": ["U1", "U3", "X50"] // lines that should be on the w
}
}
},
Hallo Simon, Ich bekomme keine Anzeige mit der Verbindungen mit folgenen Einstellungen:
{
module: "mvgmunich",
position: "top_center",
header: "MVG",
config: {
haltestelle: "Münchner Str./Würmkanal, Karlsfeld (Obb.)",
maxEntries: 5, // 10 items on screen
updateInterval: 60000, // 60 s
showIcons: true, // Show transport type icon
transportTypesToShow: {
"ubahn": true, // show ubahn route
"sbahn": true, // show sbahn route
"bus": true, // show bus route
"regional_bus": false, // show regional bus route
"tram": false // show tram route
},
ignoreStations: [], // destination not to be shown
.
Hast du eine Tipp für mich.
Danke - Günter
Hi,
I made the git pull request two days ago. Since then the great module does not show any connection. I see the header and my starting point. But then I only see "not defined".
Am I doing something wrong in my script?
{
module: "mvgmunich",
disabled: false,
position: "bottom_left",
header: "MVG",
config: {
haltestelle: "St. Quirin Platz",
maxEntries: 4, // 10 items on screen
updateInterval: 60000, // 60 s
showIcons: true, // Show transport type icon
transportTypesToShow: {
"ubahn": true, // show ubahn route
"sbahn": true, // show sbahn route
"bus": true, // show bus route
"regional_bus": false, // show regional bus route
"tram": false // show tram route
},
ignoreStations: [], // destination not to be shown
timeToWalk: 0, // 10 min walking time to station. Default is 0
showWalkingTime: false, // if the walking time should be included and the starting time is displayed
showTrainDepartureTime: true, // show tran departure time
trainDepartureTimeFormat: "relative", // format of the train departure time
walkingTimeFormat: "relative", // format of the walking time
showInterruptions: true,
showInterruptionsDetails: true,
countInterruptionsAsItemShown: false
}
},
npm-debug.log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'install', 'cherio' ]
2 info using [email protected]
3 info using [email protected]
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData cherio
8 silly fetchNamedPackageData cherio
9 silly mapToRegistry name cherio
10 silly mapToRegistry using default registry
11 silly mapToRegistry registry https://registry.npmjs.org/
12 silly mapToRegistry data Result {
12 silly mapToRegistry raw: 'cherio',
12 silly mapToRegistry scope: null,
12 silly mapToRegistry escapedName: 'cherio',
12 silly mapToRegistry name: 'cherio',
12 silly mapToRegistry rawSpec: '',
12 silly mapToRegistry spec: 'latest',
12 silly mapToRegistry type: 'tag' }
13 silly mapToRegistry uri https://registry.npmjs.org/cherio
14 verbose request uri https://registry.npmjs.org/cherio
15 verbose request no auth needed
16 info attempt registry request try #1 at 23:21:49
17 verbose request id 7698a179c8456a16
18 verbose etag W/"563ce344-190"
19 verbose lastModified Fri, 06 Nov 2015 17:28:36 GMT
20 http request GET https://registry.npmjs.org/cherio
21 http 304 https://registry.npmjs.org/cherio
22 verbose headers { date: 'Fri, 05 May 2017 21:21:49 GMT',
22 verbose headers via: '1.1 varnish',
22 verbose headers 'cache-control': 'max-age=300',
22 verbose headers etag: 'W/"563ce344-190"',
22 verbose headers age: '0',
22 verbose headers connection: 'keep-alive',
22 verbose headers 'x-served-by': 'cache-hhn1525-HHN',
22 verbose headers 'x-cache': 'HIT',
22 verbose headers 'x-cache-hits': '1',
22 verbose headers 'x-timer': 'S1494019310.995540,VS0,VE2',
22 verbose headers vary: 'Accept-Encoding' }
23 silly get cb [ 304,
23 silly get { date: 'Fri, 05 May 2017 21:21:49 GMT',
23 silly get via: '1.1 varnish',
23 silly get 'cache-control': 'max-age=300',
23 silly get etag: 'W/"563ce344-190"',
23 silly get age: '0',
23 silly get connection: 'keep-alive',
23 silly get 'x-served-by': 'cache-hhn1525-HHN',
23 silly get 'x-cache': 'HIT',
23 silly get 'x-cache-hits': '1',
23 silly get 'x-timer': 'S1494019310.995540,VS0,VE2',
23 silly get vary: 'Accept-Encoding' } ]
24 verbose etag https://registry.npmjs.org/cherio from cache
25 verbose get saving cherio to /home/pi/.npm/registry.npmjs.org/cherio/.cache.json
26 verbose correctMkdir /home/pi/.npm correctMkdir not in flight; initializing
27 verbose stack TypeError: Cannot convert undefined or null to object
27 verbose stack at pickVersionFromRegistryDocument (/usr/lib/node_modules/npm/lib/fetch-package-metadata.js:125:29)
27 verbose stack at /usr/lib/node_modules/npm/node_modules/iferr/index.js:13:50
27 verbose stack at /usr/lib/node_modules/npm/lib/utils/pulse-till-done.js:20:8
27 verbose stack at saved (/usr/lib/node_modules/npm/lib/cache/caching-client.js:174:7)
27 verbose stack at /usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:241:18
27 verbose stack at FSReqWrap.oncomplete (fs.js:123:15)
28 verbose cwd /home/pi/MagicMirror/modules/MMM-mvgmunich
29 error Linux 4.9.24-v7+
30 error argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "cherio"
31 error node v6.10.3
32 error npm v3.10.10
33 error Cannot convert undefined or null to object
Hi,
i get no Data for the the bus station "Hubertusstraße, Ottobrunn".
Any idea?
Hi,
thanks for the module. great Work!
It works for me on the surface, but.. :)
I have configured two stations like this:
modules: [{
module: "mvgmunich",
position: "bottom_left",
header: "Harras",
config: {
haltestelle: "Harras",
maxEntries: 10, // 10 items on screen
updateInterval: 30000, // 30 s
showIcons: true, // Show transport type icon
transportTypesToShow: {
"ubahn": true, // show ubahn route
"sbahn": true, // show sbahn route
"bus": false, // show bus route
"tram": false // show tram route
},
ignoreStations: [], // destination not to be shown
timeToWalk: 10, // 10 min walking time to station. Default is 0
showWalkingTime: true, // if the walking time should be included and the starting time is displayed
showTrainDepartureTime: true, // show tran departure time
trainDepartureTimeFormat: "relative", // format of the train departure time
walkingTimeFormat: "relative", // format of the walking time
}
},
{
module: "mvgmunich",
position: "bottom_right",
header: "Johann-Clanze-Straße",
config: {
haltestelle: "Johann-Clanze-Straße",
maxEntries: 10, // 10 items on screen
updateInterval: 30000, // 30 s
showIcons: true, // Show transport type icon
transportTypesToShow: {
"ubahn": false, // show ubahn route
"sbahn": false, // show sbahn route
"bus": true, // show bus route
"tram": false // show tram route
},
ignoreStations: [], // destination not to be shown
timeToWalk: 5, // 10 min walking time to station. Default is 0
showWalkingTime: true, // if the walking time should be included and the starting time is displayed
showTrainDepartureTime: true, // show tran departure time
trainDepartureTimeFormat: "relative", // format of the train departure time
walkingTimeFormat: "relative", // format of the walking time
}
}]
This results in tons of the same error in the log
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at Request._callback (/home/pi/MagicMirror/modules/mvgmunich/node_helper.js:56:27)
at Request.self.callback (/home/pi/MagicMirror/node_modules/request/request.js:185:22)
at Request.emit (events.js:182:13)
at Request.<anonymous> (/home/pi/MagicMirror/node_modules/request/request.js:1161:10)
at Request.emit (events.js:182:13)
at IncomingMessage.<anonymous> (/home/pi/MagicMirror/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:273:13)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1090:12)
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at Request._callback (/home/pi/MagicMirror/modules/mvgmunich/node_helper.js:56:27)
at Request.self.callback (/home/pi/MagicMirror/node_modules/request/request.js:185:22)
at Request.emit (events.js:182:13)
at Request.<anonymous> (/home/pi/MagicMirror/node_modules/request/request.js:1161:10)
at Request.emit (events.js:182:13)
at IncomingMessage.<anonymous> (/home/pi/MagicMirror/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:273:13)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1090:12)
Maybe it makes sense to create a catch here or to fix the issue.
Thanks for any help
Dear @mrVragec,
the module is up and running on a rpi3 as server-only.
Accessing via Chrome browser (from PC or Android devices) displays everything as expected:
However, using a variety of full-screen browsers on Android machines (eg. fully) just gives the module header and a "undefined" notification right underneath:
On a side note:
The compliments module as well never displayed on this browser. It did on any other browser though. Basically a very similar behavior which seems to be browser specific.
Any idea or hint what goes wrong with this specific browser?
Thanks!
The module was working just fine until last week. It shows undefined error for all stations. I think it's because the API (https://www.mvg.de/api/fahrinfo/departure/) is not working anymore. Anyone know what the new link is or how to solve it?
It would be great to get the option to seperate between an Express-Busline and a normal Busline. Alternatively you could add an option to ignore certain line numbers.
For excample at the Olympiaeinkaufszentrum I want to see departures of the X50 but not the other buslines...I still might be interested in the "normal" line 50 but that's less important.
Hi
There seems to be a problem related to s bahns. with the following configuration it displays everything except s-bahns. The problem reproduces for other stations as well. I believe something has changed at MVG side. It seems sbahn is treated differently than the rest.
{
module: "mvgmunich",
position: "top_bar",
header: "MVG",
config: {
haltestelle: "Hauptbahnhof",
maxEntries: 10, // 10 items on screen
updateInterval: 60000, // 60 s
showUbahn: true, //show ubahn route
showBus: true, // show bus route
showTram: true, // show tram route
showSbahn: true // show sbahn route
}
},
Since a couple of days your cool module does not load the stations anymore. Is there a problem with the API?
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.