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.

    What other factors are affecting the updateInterval?

    Scheduled Pinned Locked Moved Development
    8 Posts 2 Posters 2.5k 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.
    • E Offline
      E3V3A
      last edited by

      I’m running with a config updateInterval set to 60 seconds, but for some reason it get’s updated every 30 seconds! Any idea what’s going on?

      Here is the only place using this:

          socketNotificationReceived: function (notification, payload) {
              if (notification === "START_RADAR") {
                  //console.log("Received START_RADAR");
                  this.config = payload;
                  this.radarPing();
                  setInterval(() => {
                      this.radarPing();
                  }, this.config.updateInterval * 1000 );
              }
          }
      

      I should mention that I was measuring on the second server instance. Can it be that the time interval doubles/halfs, for every client connected?

      "Everything I do (here) is for free – altruism is the way!"
      MMM-FlightsAbove, MMM-Tabulator, MMM-Assistant (co-maintainer)

      1 Reply Last reply Reply Quote 0
      • E Offline
        E3V3A
        last edited by

        Yep, just confirmed. Running 1 instance with serveronlygives the correct updateInterval. Connecting more, messes that up. How would you guys deal with this?

        "Everything I do (here) is for free – altruism is the way!"
        MMM-FlightsAbove, MMM-Tabulator, MMM-Assistant (co-maintainer)

        strawberry 3.141S 1 Reply Last reply Reply Quote 0
        • strawberry 3.141S Offline
          strawberry 3.141 Project Sponsor Module Developer @E3V3A
          last edited by

          @E3V3A every client instance is connecting to the same nodehelper, so what some people did is having a start boolean variable so they can check if the nodehelper already initialised e.g.

          https://github.com/paviro/MMM-Wunderlist/blob/master/node_helper.js#L19
          https://github.com/paviro/MMM-Wunderlist/blob/master/node_helper.js#L94
          https://github.com/paviro/MMM-Wunderlist/blob/master/node_helper.js#L106

          Please create a github issue if you need help, so I can keep track

          E 1 Reply Last reply Reply Quote 1
          • E Offline
            E3V3A @strawberry 3.141
            last edited by

            @strawberry-3.141 That worked like charm! Spot on. Thank you! Just have to remember for long timers, the following clients need to wait for the first to timeout, before getting any data.

            "Everything I do (here) is for free – altruism is the way!"
            MMM-FlightsAbove, MMM-Tabulator, MMM-Assistant (co-maintainer)

            strawberry 3.141S 1 Reply Last reply Reply Quote 0
            • strawberry 3.141S Offline
              strawberry 3.141 Project Sponsor Module Developer @E3V3A
              last edited by

              @E3V3A you can store the data in a variable in the node helper, every time someone connects and your start flag is already set you just send him the data from your variable

              Please create a github issue if you need help, so I can keep track

              E 1 Reply Last reply Reply Quote 1
              • E Offline
                E3V3A @strawberry 3.141
                last edited by E3V3A

                @strawberry-3.141 Great idea! Do you have any code examples for doing this? (I’m still a JS dummy.)

                "Everything I do (here) is for free – altruism is the way!"
                MMM-FlightsAbove, MMM-Tabulator, MMM-Assistant (co-maintainer)

                strawberry 3.141S 1 Reply Last reply Reply Quote 0
                • strawberry 3.141S Offline
                  strawberry 3.141 Project Sponsor Module Developer @E3V3A
                  last edited by

                  @E3V3A here is your example https://github.com/E3V3A/MMM-FlightsAbove/pull/16

                  Please create a github issue if you need help, so I can keep track

                  E 1 Reply Last reply Reply Quote 1
                  • E Offline
                    E3V3A @strawberry 3.141
                    last edited by

                    @strawberry-3.141 Thanks a lot! PR merged.

                    "Everything I do (here) is for free – altruism is the way!"
                    MMM-FlightsAbove, MMM-Tabulator, MMM-Assistant (co-maintainer)

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • 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