Read the statement by Michael Teeuw here.
MMM-MyCalendar stopped working on MagicMirror 2.25
-
@svoe88 for MyCalendar
always look to the module github first
see https://github.com/jclarke0000/MMM-MyCalendar/issues/40
config template file not exists, no envsubst
this is a new optional feature where you can have a file of properties
and apply them to the config.js, not having them hard coded -
“My mirror is up now, but the calendar is just stuck loading.”
magic@magic:~/MagicMirror $ npm start > magicmirror@2.25.0 start > DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js [26.10.2023 23:03.29.952] [LOG] Starting MagicMirror: v2.25.0 [26.10.2023 23:03.29.957] [LOG] Loading config ... [26.10.2023 23:03.29.960] [DEBUG] config template file not exists, no envsubst [26.10.2023 23:03.29.965] [LOG] Loading module helpers ... [26.10.2023 23:03.29.967] [LOG] No helper found for module: alert. [26.10.2023 23:03.29.993] [LOG] Initializing new module helper ... [26.10.2023 23:03.29.993] [LOG] Module helper loaded: updatenotification [26.10.2023 23:03.29.994] [LOG] No helper found for module: clock. [26.10.2023 23:03.30.170] [LOG] Initializing new module helper ... [26.10.2023 23:03.30.171] [LOG] Module helper loaded: calendar [26.10.2023 23:03.30.184] [LOG] Initializing new module helper ... [26.10.2023 23:03.30.185] [LOG] Module helper loaded: MMM-MyCalendar [26.10.2023 23:03.30.185] [LOG] All module helpers loaded. [26.10.2023 23:03.30.197] [LOG] Starting server on port 8080 ... [26.10.2023 23:03.30.436] [LOG] Server started ... [26.10.2023 23:03.30.437] [LOG] Connecting socket for: updatenotification [26.10.2023 23:03.30.438] [LOG] Starting module helper: updatenotification [26.10.2023 23:03.30.439] [LOG] Connecting socket for: calendar [26.10.2023 23:03.30.439] [LOG] Starting node helper for: calendar [26.10.2023 23:03.30.440] [LOG] Connecting socket for: MMM-MyCalendar [26.10.2023 23:03.30.441] [LOG] Starting node helper for: MMM-MyCalendar [26.10.2023 23:03.30.441] [LOG] Sockets connected & modules started ... [26.10.2023 23:03.30.465] [LOG] Launching application. [8619:1026/230331.393892:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.394518:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.395120:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.395594:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.396030:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.396460:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.396903:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.398914:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.399422:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.399961:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.401074:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.401555:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.402996:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.403694:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [26.10.2023 23:03.32.519] [LOG] Create new calendarfetcher for url: https://mitstudie.au.dk/calendar?icalkey=65872d73a3fdacbf72ef30a86e962830&lang=da&getLmsEvents=false - Interval: 3600000 [26.10.2023 23:03.32.622] [LOG] Create new calendarfetcher for url: https://mitstudie.au.dk/calendar?icalkey=65872d73a3fdacbf72ef30a86e962830&lang=da&getLmsEvents=false - Interval: 300000 [26.10.2023 23:03.32.623] [ERROR] Whoops! There was an uncaught exception... [26.10.2023 23:03.32.625] [ERROR] ReferenceError: fetcher is not defined at fetchCalendar (/home/magic/MagicMirror/modules/MMM-MyCalendar/calendarfetcher.js:62:3) at CalendarFetcher.startFetch (/home/magic/MagicMirror/modules/MMM-MyCalendar/calendarfetcher.js:107:3) at Class.createFetcher (/home/magic/MagicMirror/modules/MMM-MyCalendar/node_helper.js:81:11) at Class.socketNotificationReceived (/home/magic/MagicMirror/modules/MMM-MyCalendar/node_helper.js:29:9) at Socket.<anonymous> (/home/magic/MagicMirror/js/node_helper.js:104:11) at Socket.emit (node:events:513:28) at Socket.emitUntyped (/home/magic/MagicMirror/node_modules/socket.io/dist/typed-events.js:69:22) at /home/magic/MagicMirror/node_modules/socket.io/dist/socket.js:704:39 at process.processTicksAndRejections (node:internal/process/task_queues:77:11) [26.10.2023 23:03.32.625] [ERROR] MagicMirror² will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? [26.10.2023 23:03.32.626] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues [26.10.2023 23:03.32.627] [INFO] Checking git for module: MMM-MyCalendar [26.10.2023 23:03.32.654] [INFO] Checking git for module: MagicMirror [26.10.2023 23:03.32.919] [INFO] Calendar-Fetcher: Broadcasting 77 events from https://mitstudie.au.dk/calendar?icalkey=65872d73a3fdacbf72ef30a86e962830&lang=da&getLmsEvents=false. [8619:1026/230338.077679:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times! [8619:1026/230342.063208:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times! [8619:1026/230344.071380:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!
{ module: "MMM-MyCalendar", position: "top_left", // This can be any of the regions. Best results in left or right regions. config: { colored: true, calendars: [ { url: ".........", color: "#ffb350" }, ], } },
But I’m still new to getting it all up and running
-
@sdetweil
My mirror is up now, but the calendar is just stuck loadingmagic@magic:~/MagicMirror $ npm start > magicmirror@2.25.0 start > DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js [26.10.2023 23:03.29.952] [LOG] Starting MagicMirror: v2.25.0 [26.10.2023 23:03.29.957] [LOG] Loading config ... [26.10.2023 23:03.29.960] [DEBUG] config template file not exists, no envsubst [26.10.2023 23:03.29.965] [LOG] Loading module helpers ... [26.10.2023 23:03.29.967] [LOG] No helper found for module: alert. [26.10.2023 23:03.29.993] [LOG] Initializing new module helper ... [26.10.2023 23:03.29.993] [LOG] Module helper loaded: updatenotification [26.10.2023 23:03.29.994] [LOG] No helper found for module: clock. [26.10.2023 23:03.30.170] [LOG] Initializing new module helper ... [26.10.2023 23:03.30.171] [LOG] Module helper loaded: calendar [26.10.2023 23:03.30.184] [LOG] Initializing new module helper ... [26.10.2023 23:03.30.185] [LOG] Module helper loaded: MMM-MyCalendar [26.10.2023 23:03.30.185] [LOG] All module helpers loaded. [26.10.2023 23:03.30.197] [LOG] Starting server on port 8080 ... [26.10.2023 23:03.30.436] [LOG] Server started ... [26.10.2023 23:03.30.437] [LOG] Connecting socket for: updatenotification [26.10.2023 23:03.30.438] [LOG] Starting module helper: updatenotification [26.10.2023 23:03.30.439] [LOG] Connecting socket for: calendar [26.10.2023 23:03.30.439] [LOG] Starting node helper for: calendar [26.10.2023 23:03.30.440] [LOG] Connecting socket for: MMM-MyCalendar [26.10.2023 23:03.30.441] [LOG] Starting node helper for: MMM-MyCalendar [26.10.2023 23:03.30.441] [LOG] Sockets connected & modules started ... [26.10.2023 23:03.30.465] [LOG] Launching application. [8619:1026/230331.393892:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.394518:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.395120:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.395594:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.396030:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.396460:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.396903:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.398914:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.399422:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.399961:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.401074:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.401555:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.402996:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [8619:1026/230331.403694:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2) [26.10.2023 23:03.32.519] [LOG] Create new calendarfetcher for url: https://mitstudie.au.dk/calendar?icalkey=65872d73a3fdacbf72ef30a86e962830&lang=da&getLmsEvents=false - Interval: 3600000 [26.10.2023 23:03.32.622] [LOG] Create new calendarfetcher for url: https://mitstudie.au.dk/calendar?icalkey=65872d73a3fdacbf72ef30a86e962830&lang=da&getLmsEvents=false - Interval: 300000 [26.10.2023 23:03.32.623] [ERROR] Whoops! There was an uncaught exception... [26.10.2023 23:03.32.625] [ERROR] ReferenceError: fetcher is not defined at fetchCalendar (/home/magic/MagicMirror/modules/MMM-MyCalendar/calendarfetcher.js:62:3) at CalendarFetcher.startFetch (/home/magic/MagicMirror/modules/MMM-MyCalendar/calendarfetcher.js:107:3) at Class.createFetcher (/home/magic/MagicMirror/modules/MMM-MyCalendar/node_helper.js:81:11) at Class.socketNotificationReceived (/home/magic/MagicMirror/modules/MMM-MyCalendar/node_helper.js:29:9) at Socket.<anonymous> (/home/magic/MagicMirror/js/node_helper.js:104:11) at Socket.emit (node:events:513:28) at Socket.emitUntyped (/home/magic/MagicMirror/node_modules/socket.io/dist/typed-events.js:69:22) at /home/magic/MagicMirror/node_modules/socket.io/dist/socket.js:704:39 at process.processTicksAndRejections (node:internal/process/task_queues:77:11) [26.10.2023 23:03.32.625] [ERROR] MagicMirror² will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? [26.10.2023 23:03.32.626] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues [26.10.2023 23:03.32.627] [INFO] Checking git for module: MMM-MyCalendar [26.10.2023 23:03.32.654] [INFO] Checking git for module: MagicMirror [26.10.2023 23:03.32.919] [INFO] Calendar-Fetcher: Broadcasting 77 events from https://mitstudie.au.dk/calendar?icalkey=65872d73a3fdacbf72ef30a86e962830&lang=da&getLmsEvents=false. [8619:1026/230338.077679:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times! [8619:1026/230342.063208:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times! [8619:1026/230344.071380:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!
But I’m still new to getting it all up and running
-
@svoe88 said in config template file not exists:
ReferenceError: fetcher is not defined
at fetchCalendar (/home/magic/MagicMirror/modules/MMM-MyCalendar/didn’t do the patch right
-
title of this thread has nothing to do with the problem
-
@karsten13 I fixed the title
-
@sdetweil
How do I get it done? -
@svoe88 you missed one of the changes in the workaround. the author needs to fix their module.
-
@sdetweil
It works nowFor others it doesn’t work too then I copy this code into calendarutils.js
cd ~/MagicMirror/modules/MMM-MyCalendar
/* MagicMirror² * Node Helper: Calendar - CalendarFetcher * * By Michael Teeuw https://michaelteeuw.nl * MIT Licensed. */ const CalendarUtils = require("./calendarutils"); const Log = require("logger"); const NodeHelper = require("node_helper"); const ical = require("node-ical"); /*const fetch = require("fetch");*/ /*const digest = require("digest-fetch");*/ const https = require("https"); /** * * @param {string} url The url of the calendar to fetch * @param {number} reloadInterval Time in ms the calendar is fetched again * @param {string[]} excludedEvents An array of words / phrases from event titles that will be excluded from being shown. * @param {number} maximumEntries The maximum number of events fetched. * @param {number} maximumNumberOfDays The maximum number of days an event should be in the future. * @param {object} auth The object containing options for authentication against the calendar. * @param {boolean} includePastEvents If true events from the past maximumNumberOfDays will be fetched too * @param {boolean} selfSignedCert If true, the server certificate is not verified against the list of supplied CAs. * @class */ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEntries, maximumNumberOfDays, auth, includePastEvents, selfSignedCert) { let reloadTimer = null; let events = []; let fetchFailedCallback = function () {}; let eventsReceivedCallback = function () {}; /** * Initiates calendar fetch. */ const fetchCalendar = () => { clearTimeout(reloadTimer); reloadTimer = null; const nodeVersion = Number(process.version.match(/^v(\d+\.\d+)/)[1]); /* let fetcher = null;*/ let httpsAgent = null; let headers = { "User-Agent": "Mozilla/5.0 (Node.js " + nodeVersion + ") MagicMirror/" + global.version }; if (selfSignedCert) { httpsAgent = new https.Agent({ rejectUnauthorized: false }); } if (auth) { if (auth.method === "bearer") { headers.Authorization = "Bearer " + auth.pass; /* } else if (auth.method === "digest") { fetcher = new digest(auth.user, auth.pass).fetch(url, { headers: headers, agent: httpsAgent });*/ } else { headers.Authorization = "Basic " + Buffer.from(auth.user + ":" + auth.pass).toString("base64"); } } /* if (fetcher === null) { fetcher = fetch(url, { headers: headers, agent: httpsAgent }); }*/ fetch(url, { headers: headers, agent: httpsAgent }) .then(NodeHelper.checkFetchStatus) .then((response) => response.text()) .then((responseData) => { let data = []; try { data = ical.parseICS(responseData); Log.debug("parsed data=" + JSON.stringify(data)); events = CalendarUtils.filterEvents(data, { excludedEvents, includePastEvents, maximumEntries, maximumNumberOfDays }); } catch (error) { fetchFailedCallback(this, error); scheduleTimer(); return; } this.broadcastEvents(); scheduleTimer(); }) .catch((error) => { fetchFailedCallback(this, error); scheduleTimer(); }); }; /** * Schedule the timer for the next update. */ const scheduleTimer = function () { clearTimeout(reloadTimer); reloadTimer = setTimeout(function () { fetchCalendar(); }, reloadInterval); }; /* public methods */ /** * Initiate fetchCalendar(); */ this.startFetch = function () { fetchCalendar(); }; /** * Broadcast the existing events. */ this.broadcastEvents = function () { Log.info("Calendar-Fetcher: Broadcasting " + events.length + " events."); eventsReceivedCallback(this); }; /** * Sets the on success callback * * @param {Function} callback The on success callback. */ this.onReceive = function (callback) { eventsReceivedCallback = callback; }; /** * Sets the on error callback * * @param {Function} callback The on error callback. */ this.onError = function (callback) { fetchFailedCallback = callback; }; /** * Returns the url of this fetcher. * * @returns {string} The url of this fetcher. */ this.url = function () { return url; }; /** * Returns current available events for this fetcher. * * @returns {object[]} The current available events for this fetcher. */ this.events = function () { return events; }; }; module.exports = CalendarFetcher;