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.

    Default Calendar module frequently refreshes

    Scheduled Pinned Locked Moved General Discussion
    25 Posts 3 Posters 977 Views 3 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.
    • S Do not disturb
      sdetweil @DarrenO 0
      last edited by sdetweil

      @DarrenO-0 also can you look at the output of npm start or however you start MagicMirror
      And find the messages

      Broadcasting xxx messages for url xxxx

      Collect 15 of those messages either the timestamp
      Xxx out the url string, or match them to your 4 utls
      These messages should be on the fetchInterval time cycle

      Each url fetch is done separately, and they contribute to the shown list of events immediately , which may cause a visual flash

      Looking at the code, it uses fixed timers which is restarted for the next cycle after processing this cycle. So that means longer/larger calendar lists will take longer than shorter ones. This will cause the fetch cycles to drift apart and constantly change
      I’m guessing is this is the randomness

      The log messages should show consistent cycle times for an individual url, but varying separation between url fetches
      If your system is low on memory and utilizes swap on an sd card this could also affect processing time for larger calendar memory requirements, causing additional drift

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • D Offline
        DarrenO 0 @DarrenO 0
        last edited by

        Thanks Sam.
        I get the requested information later today and add it the conversation.

        Just to clarify the “randomness” of the refresh that I am experiencing, the listing of the calendar events would temporarily disappear and reappear as would be expected with a refresh cycle, but it would do it repeatedly in quick succession/constantly do it.

        I took a ~45sec video of the issue, but the video is 86MB and i was unable to upload.
        Is there somewhere I can upload it to?

        I run two instances of MM from the host - the first one is the primary instance, which is the one experiencing the issue. This is viewed directly on a monitor attached to the host.
        The second instance is only viewable and viewed from a browser (Chrome) on my computer.

        I also view the first instance on my computer via a second browser tab and use an Extension to switch/rotate between the two tabs on 5 min intervals. The extension does have an option to refresh/reload the next tab to be displayed but I have not enabled this feature, knowing that it would force a pull of the calendar.

        My MMs start with the following commands :
        pm2 start ~/MagicMirror/installers/pm2_MagicMirror1.json
        pm2 start ~/MagicMirror/installers/pm2_MagicMirror2.json

        {
          "apps" : [{
            "name"        : "MagicMirror1",
            "cwd"         : "/home/user",
            "script"      : "/home/user/MagicMirror/installers/mm1.sh",
            "watch"       : ["/home/user/MagicMirror/config/config1.js"]
          }]
        }
        
        {
          "apps" : [{
            "name"        : "MagicMirror2",
            "cwd"         : "/home/user",
            "script"      : "/home/user/MagicMirror/installers/mm2.sh",
            "watch"       : ["/home/user/MagicMirror/config/config2.js"]
          }]
        }
        
        

        The bash scripts referenced in the .json files above, are :

        #!/bin/bash
        cd /home/user/MagicMirror
        export MM_CONFIG_FILE=config/config1.js
        export MM_PORT=8081
        
        if [ $(ps -ef | grep -v grep | grep -i -e xway -e labwc | wc -l) -ne 0 ]; then
           npm run start:wayland
        else
           DISPLAY=:0 npm start
        fi
        
        #DISPLAY=:0 npm start
        
        #!/bin/bash
        cd /home/user/MagicMirror
        export MM_CONFIG_FILE=config/config2.js
        export MM_PORT=8082
        npm run server
        
        #DISPLAY=:0 npm start
        

        I only experience the random/constant refresh issue with the first MM instance running the default Calendar module.
        The second instance runs a different calendar module, MMM-MonthlyCalendar from kolbyjack, for a different Google Calendar that is not one of the four accessed by the first instance.

        S 2 Replies Last reply Reply Quote 0
        • S Do not disturb
          sdetweil @DarrenO 0
          last edited by

          @DarrenO-0 the calendar fetch is done on the server side,
          All browsers access that same data

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          D 1 Reply Last reply Reply Quote 0
          • S Do not disturb
            sdetweil @DarrenO 0
            last edited by

            @DarrenO-0 those calendar modules fetch the days themselves in their own way

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • D Offline
              DarrenO 0 @sdetweil
              last edited by

              @sdetweil
              i forgot to mention that i experience the same constant refresh/reload issue on both the host and browser instances of the MM that displays the default calendar module, so i guess it’s not isolated to browser on my PC where I view both MM instances.

              What would the command be that I need to run to view the npm output?

              S 1 Reply Last reply Reply Quote 0
              • S Do not disturb
                sdetweil @DarrenO 0
                last edited by sdetweil

                @DarrenO-0 as MagicMirror is started by pm2 the command would be

                pm2 logs —lines=xxxx
                

                Two dashes in front of lines
                Where xxxx is the number of most recent lines of output, default 15

                You can also examine the files the logs are collected in,
                In the ~/.pm2/logs. Folder, notice the . in front of pm2

                The fact that you see it on other browsers confirms to
                Me that this is fetch timing cycle related.
                If you look at both displays at once, my guess is the refresh at the same time

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                D 1 Reply Last reply Reply Quote 0
                • D Offline
                  DarrenO 0 @sdetweil
                  last edited by

                  @sdetweil
                  I restored my MM from an image i took of it from prior to upgrading to Debian 13 and, so far, I am not experiencing the same refresh.
                  I’ll keep an eye on things over the next few hours and see if the issue re-occurs.

                  S 1 Reply Last reply Reply Quote 0
                  • S Do not disturb
                    sdetweil @DarrenO 0
                    last edited by

                    @DarrenO-0 thx. Id really like to see the logs from both for the event broadcast cycle

                    There was a big calendar parser change in. 33 and another coming in. 34

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    D 1 Reply Last reply Reply Quote 0
                    • M Offline
                      michaelarnauts
                      last edited by

                      I just made this github issue to track this issue.

                      https://github.com/MagicMirrorOrg/MagicMirror/issues/3971

                      S 1 Reply Last reply Reply Quote 0
                      • S Do not disturb
                        sdetweil @michaelarnauts
                        last edited by

                        @michaelarnauts I replied to it, but there you have a different complaint.

                        The system design is
                        Pull the iCal file via the URL
                        It’s whatever events the source calendar wants to send , we have no control , it’s all text

                        We convert that to a usable list
                        And then figure out the repeating events and get a list that could be displayed, expired and not , as of right this second

                        Then we send that list out to other modules to use
                        MMM-CalendarExt3 for example, which displays a wall cal view, using the events in view expired or not

                        Then we process the not expired list and display the xx that you wanted

                        And repeat that whole process for the next fetchInterval
                        Once every xx minutes or whatever you have it set to

                        For each URL configured , we do the exact same process, each sending events when they are fetched. One URL processor doesn’t know about the next, they ALL run independently

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        M 1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 1 / 3
                        • First post
                          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