Closed ndom91 closed 2 years ago
Nevermind, just saw this already closed issue from Nov :sweat_smile:
Hallo, seit ich das update durchgeführt habe wird keine Information mehr angezeigt. Nur noch "RMV Lade...." Muss noch etwas in der Config.js geändert werden ?
Ne nicht das ich wusste, habe nur die notification Email vom RMV bekommen, wegen meines API Keys, und dachte ich leite die Info hier weiter. Habe daraufhin die bestehende issue gefunden. Read first, ask questions later :see_no_evil: :joy:
Scheinbar ist mein API - Key ungültig. habe einen neuen beantragt....
Hello, Did the last update solved the problem? khassel added some modifications for reading requests of both api versions. There was a slight change I've overseen in my update.
I will test the api-key with my mirror later the day. I also got an email regarding the key but I haven't checked it yet.
I've added another option in the config. Maybe the loading issue comes from this change while using a specific config. Could you please post your config here (without API-key :-) )?
Just checked it with the lastest patches. My mirror is working and I did not updated the api key. There was also nothing written in my mail that I have to change my key.
Please see questions in previous comment.
Made the update, but there is no change. Even did install MMM-RMV new by using "git clone...". Did not change the config.js. When I delete the API-KEY , there is no change it still say :"RMV .. Loading data", while other app does load and show their data... Any Idee ?
Try using 'npm start dev' for showing the log page during the startup. Do you see any errors of the MMM-RMV?
Please also post your config or send it to me via pm.
Following error I did get : (modified the API KEY) : [22.01.2022 15:43.43.249] [ERROR] Requesting https://www.rmv.de/hapi/departureBoard?accessId=xxxxxxxx-eb6961648689&id=&duration=60&maxJourneys=50&format=json failed with status code 500 {"serverVersion":"1.9","errorCode":"INT_ERR","errorText":"internal error"} What does it tells you ?
Form config.js (modified API-KEY) : { module: 'MMM-RMV', position: 'bottom_left', config: { apiKey: 'xxxxxxxxxxxxxx 61648689', stationID: '3011264', labelStation: true, fDestination1: 'Wiesbaden Hauptbahnhof', fDestination2: 'Niedernhausen', lines: 'S1,S2,S8,S9', maxC: 5, LabelRow: true } }, .....
Please copy this link to a browser and add your key after accessId= and check the response of the server: https://www.rmv.de/hapi/departureBoard?accessId=&id=3011264&duration=60&maxJourneys=50&format=json
In your posted link the station I'd is missing: &Id=&Duration..
The internal error means that the request you have sent is wrong.
Ok, i do get a response like : {"Departure":[{"JourneyDetailRef":{"ref":"2|#VN#1#ST#1642711627#PI#0#ZI#174636#TA#3#DA#230122#1S#3006101#1T#1003#LS#3004647#LT#1111#PU#80#RT#1#CA#S42#ZE#S2#ZB# S2#PC#3#FR#3006101#FT#1003#TO#3004647#TT#1111#"},"JourneyStatus":"P","Product":{"name":" S2","num":"3827","line":"S2","catOut":"S ","catIn":"S42","catCode":"3","catOutS":"S42","catOutL":"S-Bahn","operatorCode":"DBR","operator":"DB Regio AG S-Bahn Rhein-Main","admin":"800528"},"Notes":{"Note":[{"value":"Pflicht zum Tragen einer medizinischen Maske","key":"PB","type":"A","priority":200,"routeIdxFrom":19,"routeIdxTo":26},{"value":"Im Zug gilt bundesweit 3G-Regel: ein gültiger Nachweis ist mitzuführen","key":"3G","type":"A","priority":205,"routeIdxFrom":19,"routeIdxTo":26},{"value":"Fahrzeuggebundene Einstiegshilfe vorhanden","key":"qy","type":"A","priority":560,"routeIdxFrom":19,"routeIdxTo":26},{"value":"Klimaanlage","key":"qx","type":"A","priority":610,"routeIdxFrom":19,"routeIdxTo":26},{"value":"35229","key":"FD","type":"I","routeIdxFrom":19,"routeIdxTo":26}]},"name":" S2","type":"S","stop":"Offenbach (Main)-Westend Ledermuseum","stopid":"A=1@O=Offenbach (Main)-Westend Ledermuseum@X=8749579@Y=5010
In one of the instances "stationID: '3011264', was should have been : stationId: "30... ?
But still no change.
The response shows that your API-key is still valid and working. Please change locally on your mirror the file "node_helper.js" in the MMM-RMV directory. Line 36: //console.log(rmvUrl); Remove the "//" which normally comments out this line. Run "npm start dev" and check the console for this log entry of the request which is sent to RMV. It should be the same as the one in my comment above. If not, please post your node_helper file content or reset the module and update it again with git reset --hard and git pull in the MMM-RMV folder.
Thanks
Thanka lot for your help. Still not working....
from the log : [25.01.2022 14:34.32.347] [LOG] https://www.rmv.de/hapi/departureBoard?accessId=xxxxxxxxxxxx-ba4b34ab430f&id=3011264&duration=60&maxJourneys=50&format=json
Looks fully ok.
here the node_helper ( after git reset / git pull) : /* Magic Mirror
const https = require("https"); const NodeHelper = require("node_helper");
module.exports = NodeHelper.create({
start: function()
{
console.log("node helper: " + this.name);
},
//Built_Para - return URL parameter as string
Built_Para: function()
{
var para = this.config.apiKey;
para +="&id=" + this.config.stationId;
para +="&duration=" + this.config.maxT;
para +="&maxJourneys=" + this.config.maxJ;
para +="&format=json";
return para;
},
socketNotificationReceived: function(notification, payload)
{
if(notification === 'CONFIG')
{
this.config = payload;
var rmvUrl = this.config.apiUrl + this.Built_Para();
this.getData(rmvUrl, this.config.stationId);
//console.log(rmvUrl);
}
},
getData: function(url, stationId)
{
https.get(url, (res) => {
let data = [];
res.on("data", (chunk) => {
data.push(chunk);
});
res.on("end", () => {
let text = Buffer.concat(data).toString();
if (res.statusCode < 200 || res.statusCode > 299) {
console.error("Requesting " + url + " failed with status code " + res.statusCode + " " + text);
} else {
if (text !== "") text = JSON.parse(text);
this.sendSocketNotification("Trains" + stationId, text);
}
});
})
.on("error", (err) => {
console.error("Request failed: ", err.message);
});
}
});
But still no change.
There may one strange thing in the log : [25.01.2022 15:03.07.429] [INFO] Checking git for module: MMM-RMV [25.01.2022 15:03.07.558] [LOG] [RCREPO] Repository scanning... ... [25.01.2022 15:03.09.835] [LOG] [RCREPO] modules.json is updated.
Any Idee ?
Maybe this interseting : After git reset --hard HEAD ist jetzt bei c7976e0 Merge pull request #33 from khassel/new-api
git pull say : its actual.
Maybe this interseting : After git reset --hard HEAD ist jetzt bei c7976e0 Merge pull request #33 from khassel/new-api
git pull say : its actual.
This is ok. Now we're sure you have the exact code like it is in the repository. The git reset --hard resets the local changes.
I'll copy your config later on my mirror and check its response. If the node_helper is correct and you have a response from the server it can only be an error in the processing part.
@Com-Lum : Any further Idee ? What can I check if there is a fault in the processing part ?
I've tested your config and there is no connection available. I guess you have missunderstood the "Lines" parameter. The module ignores all lines which you have listed there. You have to emty this paramter and then you should see a few connections. Please check
Did following : { module: 'MMM-RMV', position: 'bottom_left', config: { apiKey: 'xxxxxxxx-xxx-xxx-xxxx-ba4b34ab430f', stationId: '3011264', labelStation: true, fDestination1: 'Wiesbaden Hauptbahnhof', fDestination2: 'Niedernhausen', // lines: 'S1,S2,S8,S9', maxC: 5, LabelRow: true } },
No changes sofar...
I have the excat copy of the config in use and I get the connection overview. Do you see "Loading" or "No connections available" or just nothing of the module?
Can you check it with only one instance of the module? If nothing helps you could try to delete the module and load it again. I do not know if "npm install" is really required or not but you can try it afterwards: "npm install request --save"
I have the excat copy of the config in use and I get the connection overview. Do you see "Loading" or "No connections available" or just nothing of the module?
I do see "loading"
I do run 2 instance of MMM-RMV for 2 different stations.
new install including NPM install in folder MMM-RMV did not help :
npm install audited 47 packages in 3.706s
2 packages are looking for funding
run npm fund
for details
found 0 vulnerabilities
npm fund MMM-RMV@1.0.11 ├─┬ https://github.com/sponsors/feross │ └── safe-buffer@5.2.1 ├─┬ https://www.patreon.com/feross │ └── safe-buffer@5.2.1 ├─┬ https://feross.org/support │ └── safe-buffer@5.2.1 └─┬ https://github.com/sponsors/epoberezkin └── ajv@6.12.6
npm install request --save npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
Sorry what else I can do ??
I'm running out of ideas^^ The request to the API is working. When you run npm start dev you see the response from the server. -> So the module is running into the processing part. You have nothing changed in the code --> The processing part should run without errors and display something.... We can check how far the code is running: Please add in your local version of MMM-RMV.js the following line and count up for each copy. console.log("Test_1"); After line 74, 84, 165, 209, 214, 219, 292, 506, 522, 599, 609, 619. 645, 665, 676, 694, 712, 758. 767, 982 Then run the module and check the log. Which "Test_x" lines do you see?
Another try could be the example config: { module: 'MMM-RMV', position: 'top_right', config: { apiKey: '', // see chapter below stationId: '3000001', fDest: 'false', } } This is the simplest config you can get and if that is not working its something really strange....
Well I tried the simplest config, with no change "RMV Loading".
And I did as you mention add the line in MMM-RMV.js like :
getDom: function () {
// adds the station name as header
console.log("Test_74");
function getTrainCat(trains) {
if (typeof trains.Product[0] != "undefined") {
// new api
return trains.Product[0].catOutL;
} else {
// old api
return trains.Product.catOutL;
}
};
In the Log the is NO output like Test_74.
When I try to put it like in line 40, I will get an error that consol. is not as correct syntax.
???
From the log : maybe this helps ?
[27.01.2022 12:47.16.508] [LOG] Connecting socket for: MMM-RMV [27.01.2022 12:47.16.512] [LOG] node helper: MMM-RMV [27.01.2022 12:47.16.516] [LOG] Connecting socket for: currentweather [27.01.2022 12:47.16.517] [WARN] The module 'currentweather' is deprecated in favor of the 'weather'-module, please refer to the documentation for a migration path [27.01.2022 12:47.16.520] [LOG] Connecting socket for: weatherforecast [27.01.2022 12:47.16.522] [WARN] The module 'weatherforecast' is deprecated in favor of the 'weather'-module, please refer to the documentation for a migration path [27.01.2022 12:47.16.523] [LOG] Connecting socket for: newsfeed [27.01.2022 12:47.16.527] [LOG] Starting node helper for: newsfeed [27.01.2022 12:47.16.529] [LOG] Sockets connected & modules started ... [27.01.2022 12:47.17.295] [LOG] Launching application. [25327:0127/124719.020956:ERROR:viz_main_impl.cc(161)] Exiting GPU process due to errors during initialization [25469:0127/124719.792366:ERROR:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process. [27.01.2022 12:47.26.093] [LOG] https://www.rmv.de/hapi/departureBoard?accessId=xxxxxxxx-xxxx-xxxx-8e0a-eb6961648689&id=3002698&duration=60&maxJourneys=50&format=json
One time I did see the station name and "no connection", but once I did check in config.js what was the differnece and restart it show again RMV and loading...
Can't get any progress on it.
Well I tried the simplest config, with no change "RMV Loading".
And I did as you mention add the line in MMM-RMV.js like : getDom: function () { // adds the station name as header console.log("Test_74"); function getTrainCat(trains) { if (typeof trains.Product[0] != "undefined") { // new api return trains.Product[0].catOutL; } else { // old api return trains.Product.catOutL; } };
In the Log the is NO output like Test_74.
When I try to put it like in line 40, I will get an error that consol. is not as correct syntax.
???
Its not exactly what i meant. After line 74: console.log("Test_1"); after line 84: console.log("Test_2"); ... 165, 209, 214, 219, 292, 506, 522, 599, 609, 619. 645, 665, 676, 694, 712, 758. 767, 982 and then we can see when the programm is going into an error during the processing part.
I cannot imagine why, because then all the others would see the same failure. But thats my last attemp to get a hint where the error could be. Please use for this check one time your config and for a second run the test config from above. Thanks !
I'll post some pictures from my mirror log later when I'm back from work.
Well did try again with no change.
Did put in Line 74 of MMM-RMV.js : "console.log("Test_74");"
This NO entry in the LOG like Test_74...
Means its no running into line 74. (into the function getDom ...
I also used in the "console.log(rmvUrl);" in the node_helper and the URL is shown in the LOG.
Don't you think there is a depended like the version of JSON ?
Thats strange. Line74 is right at the beginning. There is nearly no way when the api request is working, that the error is right there. Please check the spelling: console.log("Test1"); nothing in capital letters. This goes after Line 66. In Line 74 insert: console.log("Test2"); In Line 84: console.log("Test3");
then start your mirror with npm start dev the "Test1", ... should be then in the console tab.
Other question: are you working with the latest version of the mirror? there was a big change in the past and I had also to update the whole os. The automatic upgrade was not wirking. I had to update npm manually to the next bigger version.
If Test1, Test2, Test 3 is woking then please add the next Tests in the mentioned lines. If not it depends on the other answers.
Well here is a screeshot from my MMM-RMV.js :
When I run "npm start dev" I do not see any "test..."
I' working with magic Mirror 2.18.0
I do run also a new raspbian version : "Raspbian GNU/Linux 10 (buster)" Yes I did update after the raspbian also npm version which is now 8.4.0
Well I'm close to complett reinstall Magicmirror on a new SD-Card, which is a little pain, as I haveto take from the wall.
@Com-Lum Funny thing I saw. I did install MagicMirror new. ( New Directory) Did install only MMM-RMV and it worked. (happy Me). than I added MMM-Google_Maps_Traffic, as this was aother Modul I did have befor running together. Guess what now RMV shows again : Loading data... During installation I did follow instrutions as mentioned and used NPM INSTALL for MMM-RMV and MMM-Google_traffics. There has been also the request to use npm audit fix after booth installations.
What do you think ?
True. Yesterday evening I had a similar thing between todoist and calendarext.... For rmv you do not need the npm install. This has been updated in the Readme a few weeks ago. You can try the audit fix and check if it helps. If not remove the rmv and perform a npm clean and install it again for the modules which require it.
Hi, @Com-Lum trying things out as you mention. Here Error I got : ??
I trying to, but still if I use MMM-Google-traffic MMM-RMV will show only Loading data. IF a take MMM-Google-traffic out in the config.js it will work fine.
will work without google traffic for now. Still this is very strange...
Can you check the console in the npm start dev version regarding errors/exceptions of the Google module? Mabye it's the same like here. The todoist stopped due to an if clause which returned 'null' . I commented that out in the todoist.js and then the calendar showed up again. Maybe try the console.log part in the Google module to check how far it's processing.
There is no error message in log from MMM-Google_Maps : other modules after this are loading and running fime exept MMM-RMV : only loading data.. So the google thing is running and getting updates ... Newfeed, calender all does.
I also changed the sequence : firtst RMV than Google-traffic . Does no change.
The change did not help me also. I've only found other modules with the same problem that maps blocked these. There are reported issues but unanswered... The error of the google maps code is unfortunately not so obvious like the todoist one.
Well then need to go check and report the trouble there…
Hallo zusammen,
bin im Bereich der RMV-API noch neu. Möchte aktuell die Funktion journey-deatail nutzen, haben jetzt schon ewig probiert eine Anfrage zu stellen, hat aber alles nicht gebracht. Kann bitte jemand eine Beispiel Request für die Funktion Journey-Detail schreiben?
Vielen Dank im Vorfeld, Gruß Otzie
Servus, erstmal vielen Dank fur das tolle Modul!
Du hast bestimmt auch die Email bekommen, aber wenn nicht - die RMV hat mit HAFAS die API URL schon geupdated. Die alte wird ab dem 15. Februar 2022 nicht mehr gultig sein.
Hier die PDF anleitung dazu: https://www.rmv.de/c/fileadmin/documents/PDFs/_RMV_DE/Service/hafas-proxy-manual.pdf
Und die neue URL ist wie folgt sein:
https://www.rmv.de/hapi/latest