• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

MMM-Calendar not seem to load .ics

Scheduled Pinned Locked Moved Utilities
21 Posts 2 Posters 4.0k Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    Dennis-010
    last edited by Oct 22, 2023, 12:42 AM

    Today I have installed a fresh copy of MagicMirror on my PI.

    When I edit the calendar config and a update and restart my MagicMirror pid. The calander comes with an error: " Calendar Error. Could not fetch calendar"

    When I try the URL on the raspberrry pi itself it does download an .ics file which I can open and can see lines of text.

    Anyone has an idea what could possible gowrong here.

    In did work in the past with the same URL, like a year ago.

    S 1 Reply Last reply Oct 22, 2023, 11:35 AM Reply Quote 0
    • S Offline
      sdetweil @Dennis-010
      last edited by Oct 22, 2023, 11:35 AM

      @Dennis-010 do you mean the default calendar built into mm?

      I cannot find a module called MMM-Calendar

      if u mean the default
      can you show the config.js section for the calendar

      xxx out the url

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      D 1 Reply Last reply Oct 23, 2023, 6:01 PM Reply Quote 0
      • D Offline
        Dennis-010 @sdetweil
        last edited by Oct 23, 2023, 6:01 PM

        @sdetweil
        Thank you for replying, I hope you can make something out of it.

        I posted a snap from the config and some errors from the log.

                        {
                                module: "calendar",
                                header: "Agenda",
                                position: "top_left",
                                config: {
                                    coloredText: true,
                                    fade: false,
                                    calendars: [
                                        {
                                                url: "https://www.xxx.xx/ical/xxxx@xxx.xx/Calendar.ics",
                                                symbol: "calendar-check",
                                                color:  "#ffb350"
                                        }
                                      ]
                                }
                        },
        
        
        [1917:1023/200030.144271:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: Bestand of map bestaat niet (2)
        
        
        [ERROR] Calendar Error. Could not fetch calendar:  https://www.xxx.xx/ical/xxxxs@xxx.xx/Calendar.ics TypeError: terminated
        
        
        S 1 Reply Last reply Oct 23, 2023, 6:13 PM Reply Quote 0
        • S Offline
          sdetweil @Dennis-010
          last edited by sdetweil Oct 23, 2023, 6:13 PM Oct 23, 2023, 6:13 PM

          @Dennis-010 said in MMM-Calendar not seem to load .ics:

          https://www.xxx.xx/ical TypeError: terminated

          this seems to indicate a problem with the server not sending the required info. ( and terminating the connection before the complete transmission was received) . the new internal fetch is enforcing the spec, which the prior node-fetch did not.

          can u identify what

          https://www.xxx.xx
          

          this is exactly?

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          D 1 Reply Last reply Oct 23, 2023, 6:48 PM Reply Quote 0
          • D Offline
            Dennis-010 @sdetweil
            last edited by Oct 23, 2023, 6:48 PM

            @sdetweil

            This is the url of my Kerio mailserver. It is my own dedicated server running in NL.
            You asked to xxx out the url right?

            If the connection is terminated before completion of the transmission, why is it that if I just paste the url in the default browser on raspberry, I just get to download the .ics file? What am I missing here?

            S 1 Reply Last reply Oct 23, 2023, 7:06 PM Reply Quote 0
            • S Offline
              sdetweil @Dennis-010
              last edited by Oct 23, 2023, 7:06 PM

              @Dennis-010 the browser has error recovery code that we don’t, probably. they’ve had fetch for a long time. years…

              this is one of the.problens w trying to keep up with changes and general supportability .

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              D 1 Reply Last reply Oct 23, 2023, 7:16 PM Reply Quote 0
              • D Offline
                Dennis-010 @sdetweil
                last edited by Oct 23, 2023, 7:16 PM

                @sdetweil
                Point is, it has worked before… like a charm for over 2 years.
                Recently we moved to another house and we have not been using the mirror for 8-9 months, now I reinstalled the OS and modules and now the calendar stopped working.

                Is there any way I can try and sort out what the source of this issue could be?

                S 1 Reply Last reply Oct 23, 2023, 7:22 PM Reply Quote 0
                • S Offline
                  sdetweil @Dennis-010
                  last edited by Oct 23, 2023, 7:22 PM

                  @Dennis-010 I hear you.

                  none of the code that needs to be debugged is ours(mm) it’s all lower layers.

                  let me see if there is a hacky way to help you out.

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  D 1 Reply Last reply Oct 23, 2023, 7:43 PM Reply Quote 0
                  • D Offline
                    Dennis-010 @sdetweil
                    last edited by Oct 23, 2023, 7:43 PM

                    @sdetweil

                    I’'l be happy to test and try out things or methods to fix this issue.
                    Thanks in advance

                    S 1 Reply Last reply Oct 23, 2023, 8:13 PM Reply Quote 0
                    • S Offline
                      sdetweil @Dennis-010
                      last edited by sdetweil Oct 23, 2023, 8:14 PM Oct 23, 2023, 8:13 PM

                      @Dennis-010

                      ok, lets try this

                      cd ~/MagicMirror/modules/default/calendar
                      cp calendarfetcher.js  savefetcher.js
                      nano calendarfetcher.js 
                      

                      then insert this line

                      const Log = require("logger");
                      const fetchit = require('node-fetch');   //<----- add this line
                      const NodeHelper = require("node_helper");
                      
                      

                      then add this line

                      		const nodeVersion = Number(process.version.match(/^v(\d+\.\d+)/)[1]);
                      		let fetcher = null //<------ add this line
                      		let httpsAgent = null;
                      

                      then later change this

                      		fetch(url, { headers: headers, agent: httpsAgent })
                      

                      to this

                      		if (fetcher === null) {
                      			fetcher = fetchit(url, { headers: headers, agent: httpsAgent });
                      		}
                      		fetcher
                      

                      then save, (ctrl-o)
                      and exit nano (ctrl-x)

                      then

                      cd ~/MagicMirror
                      npm install node-fetch@2
                      

                      then npm start
                      calendar should come up
                      mine works…

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      D 1 Reply Last reply Oct 23, 2023, 9:07 PM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 1 / 3
                      1 / 3
                      • First post
                        3/21
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy