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-MyCommute

    Scheduled Pinned Locked Moved Transport
    286 Posts 80 Posters 653.2k Views 77 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.
    • R Offline
      requiemmg
      last edited by

      This makes it clear why I had about 50.000 requests, which made my $400 starting balance void…well, with the new fork and some config modifications, this is much better.

      mumblebajM 1 Reply Last reply Reply Quote 0
      • mumblebajM Offline
        mumblebaj Module Developer @requiemmg
        last edited by

        @requiemmg What I have found is if you run the module in the fixed section of MMM-pages it only does the calls every so often as you set them to i.e. the MMM-Openinghours module I run in fixed as I refresh it every 4hrs.

        Check out my modules at: https://github.com/mumblebaj?tab=repositories
        Check my blog-post: https://mumblebaj.xyz/
        Check my MM Container: https://hub.docker.com/repository/docker/mumblebaj/magicmirror/general

        R 1 Reply Last reply Reply Quote 0
        • R Offline
          requiemmg @mumblebaj
          last edited by

          @mumblebaj Right, but in my design it doesn’t fit in this section. Anyhow, @qistoph made a test fork (https://github.com/qistoph/MMM-MyCommute/tree/issue17) which only makes requests if the data is outdated (=longer than set pollFrequency). See the issue thread (https://github.com/qistoph/MMM-MyCommute/issues/17) for further details

          1 Reply Last reply Reply Quote 0
          • lavolp3L Offline
            lavolp3 Module Developer
            last edited by

            It seems @qistoph 's fork is more up to date than the original repo.

            I just pushed a PR to the original repo AND to the @qistoph fork.
            It provides an origin option to every destination so you can show commuting back home.
            Just set any point as ‘origin’ and your home address as ‘destination’

            How to troubleshoot modules
            MMM-soccer v2, MMM-AVStock

            lavolp3L 1 Reply Last reply Reply Quote 0
            • lavolp3L Offline
              lavolp3 Module Developer @lavolp3
              last edited by

              @lavolp3 nevermind, it is already integrated in @qistoph fork it seems :-)
              Just not documented in the readme.

              How to troubleshoot modules
              MMM-soccer v2, MMM-AVStock

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

                Hi all.
                Wondering if there’s a way to hide the arrival time? Can’t see an option in the config.
                Thanks

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

                  Additional question - the startTime option doesn’t seem to be working correctly for me. The module doesn’t display in the morning on the pi/mirror, even after the specified startTime. Weirdly, when I browse to the mirror from my laptop or phone (http://ip:8080) that seems to trigger the module to display on the pi.
                  Any ideas there?!

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

                    @matt216 said in MMM-MyCommute:

                    Weirdly, when I browse to the mirror from my laptop or phone (http://ip:8080) that seems to trigger the module to display on the pi.
                    Any ideas there?!

                    this means the module is not written for multiple browser instances.

                    when the helper sends data back, it sends data back to ALL connected clients at the same time.
                    the clients need to check if the message is for them , but the helper needs info on the request to do it… so the modulename.js has to change too…

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    M 1 Reply Last reply Reply Quote 0
                    • lavolp3L Offline
                      lavolp3 Module Developer @matt216
                      last edited by

                      @matt216 said in MMM-MyCommute:

                      Additional question - the startTime option doesn’t seem to be working correctly for me. The module doesn’t display in the morning on the pi/mirror, even after the specified startTime. Weirdly, when I browse to the mirror from my laptop or phone (http://ip:8080) that seems to trigger the module to display on the pi.
                      Any ideas there?!

                      I think I remember with this module that it has an odd hide/show behaviour. Are you working with MMM-pages or any module scheduler being able to hide modules?
                      When you open your browser, a request is sent to node_helper and it sends the data back to the module (like Sam said, ALL instances). With receipt f the data the module.show() function gets triggered, so it gets shown again while it has been hidden for some reason before.

                      How to troubleshoot modules
                      MMM-soccer v2, MMM-AVStock

                      M 1 Reply Last reply Reply Quote 0
                      • M Offline
                        matt216 @sdetweil
                        last edited by

                        @sdetweil thanks for the help (again).
                        I’m not sure I understand… it seems to take a second browser loading the page for the main mirror to display the module.
                        As per the github page for the module, the startTime option is “The start time of the window during which this module wil be visible.” but this is not happening.
                        endTime option works fine - the module disappears, but it does not reappear at startTime.
                        Thanks

                        lavolp3L 1 Reply Last reply Reply Quote 0
                        • lavolp3L Offline
                          lavolp3 Module Developer @matt216
                          last edited by lavolp3

                          @matt216 said in MMM-MyCommute:

                          @sdetweil thanks for the help (again).
                          I’m not sure I understand… it seems to take a second browser loading the page for the main mirror to display the module.

                          See my response. Every time any instance on any browser (pi/laptop) gets created, it sends a request to the server-side node_helper. This happens with most of the modules.
                          node_helper sends it back and all the instances get fresh data and certain functions get triggered.

                          Here is the client side: running when you open the broser (note the this.getdata() function.

                          start: function() {
                          
                              Log.info('Starting module: ' + this.name);
                          
                              //start data poll
                              this.getData();
                              var self = this;
                              setInterval(function() {
                                self.getData();
                              }, this.config.pollFrequency);
                                
                            },
                          

                          and here the client side receives the data from node_helper : note the this.isHidden=false and this.show() functions at the end.

                          socketNotificationReceived: function(notification, payload) {
                              if ( notification === 'GOOGLE_TRAFFIC_RESPONSE' + this.identifier ) {
                          
                                this.predictions = payload;
                          
                                if (this.loading) {
                                  this.loading = false;
                                  if (this.isHidden) {
                                    this.updateDom();
                                    this.show(1000, {lockString: this.identifier});
                                  } else {
                                    this.updateDom(1000);
                                  }
                                } else {
                                  this.updateDom();
                                  this.show(1000, {lockString: this.identifier});        
                                }
                                this.isHidden = false;
                              }
                          

                          How to troubleshoot modules
                          MMM-soccer v2, MMM-AVStock

                          1 Reply Last reply Reply Quote 0
                          • M Offline
                            matt216 @lavolp3
                            last edited by

                            @lavolp3 thanks - the node_helper and multiple browsers makes sense now.
                            No - no MMM-pages or module schedulers being used.
                            I have my startTime option set to 05:00. I will try a cron job to pm2 restart mm at 05:15…

                            lavolp3L 1 Reply Last reply Reply Quote 0
                            • lavolp3L Offline
                              lavolp3 Module Developer @matt216
                              last edited by

                              @matt216 there might be an issue with your start and end time. Can you post your config for the module?

                              How to troubleshoot modules
                              MMM-soccer v2, MMM-AVStock

                              M 1 Reply Last reply Reply Quote 0
                              • M Offline
                                matt216 @lavolp3
                                last edited by

                                @lavolp3

                                {
                                                module: 'MMM-MyCommute',
                                                position: 'bottom_left',
                                                header: 'Google Maps',
                                                config: {
                                                        apiKey: 'xyz',
                                                        origin: 'xyz',
                                                        startTime: '05:00',
                                                        endTime: '20:00',
                                                        showUpdated: false,
                                                        destinations:
                                                                [
                                                                {
                                                                destination: 'xyz',
                                                                label: 'Erica commute',
                                                                mode: 'driving'
                                                                }
                                                                ]
                                                        }
                                                },
                                
                                

                                Thanks

                                lavolp3L 1 Reply Last reply Reply Quote 0
                                • lavolp3L Offline
                                  lavolp3 Module Developer @matt216
                                  last edited by

                                  @matt216 no errors here.
                                  You could also try @qistophs fork
                                  https://github.com/qistoph/MMM-MyCommute
                                  If you’e not doing already.
                                  The original module has been abandoned.

                                  How to troubleshoot modules
                                  MMM-soccer v2, MMM-AVStock

                                  M 1 Reply Last reply Reply Quote 0
                                  • M Offline
                                    matt216 @lavolp3
                                    last edited by

                                    @lavolp3 already using @qistoph fork, yes. I can see on github there are issues raised around this. Also another fork by @radokristof which I’ll try.

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

                                      Initial test with @radokristof fork looks good. Doesn’t come up immedately at startTime, but soon after. Guess that has to do with the poll interval.

                                      1 Reply Last reply Reply Quote 0

                                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                      With your input, this post could be even better 💗

                                      Register Login
                                      • 1
                                      • 2
                                      • 3
                                      • 4
                                      • 5
                                      • 14
                                      • 15
                                      • 1 / 15
                                      • 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