balassy / MMM-Futar

MagicMirror module that displays Budapest public transport information.
MIT License
5 stars 2 forks source link

MMM-Futar can't start #32

Closed fenyvesi closed 9 months ago

fenyvesi commented 1 year ago

I just installed the MagicMirror latest version and can't start the module. (I can use it with an older MM version on another machine).

Do you have any clue what to do? Thanks. George

P.S. Egyébként kiváló a modul.

The PM2 error message is the following: `/home/orangepi/MagicMirror/node_modules/electron/dist/electron exited with signal SIGINT [01.08.2023 20:40.59.847] [ERROR] (node:3893) UnhandledPromiseRejectionWarning: Error: Cannot find module 'request' Require stack:

fenyvesi commented 1 year ago

I know that the constant complaints of the users are boring and disturbing but is there any chance to modify the source?

If not, I clear the MM-Futar with bleeding heart.

Köszi.

fenyvesi commented 1 year ago

Just for the record:

I managed the solve the problem. Although it can happen that there is a better solution, but it works for me.

So the main problem was the missing key: sometime in the past it became a must.

  1. You should acquire a key on the page: https://opendata.bkk.hu/keys Let's suppose that your key value is KEY_VALUE.

  2. Stop MM.

  3. Modify the .../MagicMriror/modules/MMM-FUTAR/node-helper.js file line 37. Be cautious with the apostrophs, you can't see here: (`) !!!

const url = https://futar.bkk.hu/api/query/v1/ws/otp/api/where/arrivals-and-departures-for-stop.json?stopId=${config.stopId}&onlyDepartures=true&minutesBefore=0&minutesAfter=${config.minutesAfter}&key=KEY_VALUE;

  1. start MM.
balassy commented 9 months ago

Thanks for reporting this issue. I've released version 2.0.1 that already has build-in support for API Keys with the new apiKey configuration parameter that should fix this issue.