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-Traffic 2.0

    Scheduled Pinned Locked Moved Transport
    21 Posts 11 Posters 11.0k Views 14 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 Offline
      SamLewis0602
      last edited by

      Hello everyone! After a very long hiatus from working on this project, I decided to revive support for MMM-Traffic by releasing version 2.0.0! The biggest change with v2 is that the module now uses the Mapbox API instead of Google Maps. I also accomplished some other goals with this release:

      • Show any config/API errors right in the module on your mirror for easy debugging
      • Simplify config options
      • Simplify and improve documentation
      • Greatly simplify code for easier contribution

      Check out the README to see instructions for getting your Mapbox API token as well as using Google Maps (lol) to get coordinates for your origin and destination. Please open Github issues if you run into any problems you can’t figure out as that’s the best way to keep them organized and share knowledge with each other.

      I hope you enjoy!

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

        @SamLewis0602 Great Sam!
        Looks great.
        I know that you’d like to be finished :-) but an option to switch between commuting roads intraday, e.g. in the morning (to work) and in the evening (back) would be great :-)
        And not difficult to implement I suppose :-)

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

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          SamLewis0602 @lavolp3
          last edited by

          @lavolp3 Interesting idea! Thanks for throwing it out there. I’d love to have a little more context about how it would apply for your case. Maybe someone at home that could see if your commute home is going to be longer or something like that?

          In the mean time, if you open an issue on the github repo I will mark it as enhancement and others can comment as well 😁

          R 1 Reply Last reply Reply Quote 0
          • R Offline
            robertybob @SamLewis0602
            last edited by

            @SamLewis0602 said in MMM-Traffic 2.0:

            Maybe someone at home that could see if your commute home is going to be longer or something like that?

            Yes that would be good! - for example, between 07:00-09:00 ‘Home To School’ and between 14:30-16:00 ‘School To Home’

            1 Reply Last reply Reply Quote 0
            • S Offline
              SamLewis0602
              last edited by

              @robertybob if you check out this example in the README, you can actually do exactly that! Just add 2 MMM-Traffic modules and set the hours accordingly for each route.

              1 Reply Last reply Reply Quote 1
              • O Offline
                ostfilinchen
                last edited by ostfilinchen

                @SamLewis0602 : I have the module 2 times (00:00-24:00) with 2 different destinations. The module shows me the same duration to arrive the destination. Is there a workaround?

                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  SamLewis0602 @ostfilinchen
                  last edited by

                  @ostfilinchen Do you expect them to be the same duration? If you are just wondering how to tell the difference between the two, look at the firstLine and secondLine options in the README.md and you can customize what you see in the module. Check out the examples in the README as well

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

                    Hello Sam
                    I’m pretty new to MagicMirror configuration. I tried installing the MM-Traffic 2.0 module.

                    I believe I have followed the steps but all I get is “Loading…” on my display.

                    I think the problem lies in the API key which i created at MapBox. I don’t really know if I created it correctly on the Mapbox website as there was no information to go by.

                    I created a project and created a key for it. is there any special steps, linkings, or guidance on the creation of the Mapbox API key?

                    I literally copied your basic module code into the config.js script and pasted my key to see if it works, but it doesn’t.

                    just an FYI I tried with both ’ and "

                    {
                    module: ‘MMM-Traffic’,
                    position: ‘top_left’,
                    config: {
                    accessToken: ‘sk.eyXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.X_XXXXXXXXXXXXXXXXXXXX’,
                    originCoords: ‘-84.398848,33.755165’,
                    destinationCoords: ‘-84.504259,33.88210’,
                    }
                    },

                    Any advise would be appreciated.

                    1 Reply Last reply Reply Quote 0
                    • J Offline
                      jimus888
                      last edited by

                      Hi Modie

                      Did you get this module working?
                      If so, what did you do to fix it as I’m also having issues with it saying “Loading…”

                      Thanks

                      1 Reply Last reply Reply Quote 0
                      • G Offline
                        Guilleam95
                        last edited by

                        Same here, I don’t even see any loading text, mirror seems to just ignore this module. I think I set it up correctly, any idea?

                        1 Reply Last reply Reply Quote 0
                        • J Offline
                          jimus888
                          last edited by

                          Hi Modie,

                          Check you have the dependencies set up correctly. I think that’s what was causing my issues. I reinstalled node-fetch and it started working.

                          Guilleam, if its not showing anything on the screen i’d check your install and your config files

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

                            Same for me and the reason seems to be this:

                            Will not show MMM-Traffic. LockStrings active: module_3_MMM-pages
                            

                            I have MMM-pages activated btw.

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

                            lavolp3L 1 Reply Last reply Reply Quote 0
                            • G Offline
                              Guilleam95 @jimus888
                              last edited by Guilleam95

                              @jimus888 Thanks for your reply, but it was just my mistake. I had it configured to show travel duration on weekdays, and I was trying to check if it worked on Saturday :man_facepalming_light_skin_tone: .

                              On the other hand, @sammay I suggest some color coded text feature? Like duration time turns red if it’s higher than usual, or green if it’s lower, something like that

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

                                @Guilleam95 You could check out MMM-MyCommute that uses the google api. It has this exact feature.

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

                                G 1 Reply Last reply Reply Quote 0
                                • G Offline
                                  Guilleam95 @lavolp3
                                  last edited by

                                  @lavolp3 thanks, I already tried that module but google api seems to be paid now. I know it is free if you don’t ask for too many directions, and setting the correct refresh interval should ensure that, but I don’t feel comfortable giving my billing information, i’d rather use mapbox.

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

                                    Hi, this Module is amazing.

                                    I did implemented in my MM and it works fine. Quick question !

                                    Is there a way to choose mode: driving, walking or bus

                                    that would be really helpful !

                                    Thanks again for everything !

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

                                      IS THERE biking or bus mode ? or walking ?

                                      1 Reply Last reply Reply Quote 0
                                      • B Offline
                                        beck0r
                                        last edited by

                                        Hello there,

                                        i’ve entered my coordinates but somehow the calculated time is 15 mins less to Google Maps. Can you say why there is such an inaccuracy compared to Google Maps? I’m very sure that I’ve used the correct coordinates. Also tested it with other coordinates.

                                        Thank you very much
                                        Kind Regards

                                        B 1 Reply Last reply Reply Quote 0
                                        • B Offline
                                          beck0r @beck0r
                                          last edited by

                                          @beck0r All good,

                                          I’ve missed that line :-)

                                          Note: Google maps coordinates are latitude,longitude, but Mapbox uses longitude,latitude so be sure to reverse what you copy from Google.

                                          1 Reply Last reply Reply Quote 0
                                          • S Offline
                                            selyjohns
                                            last edited by

                                            Hi,

                                            I’ve posted an issue on github, because duration is very different of google maps…(and google maps is more accuracy than mapbox api…)

                                            https://github.com/SamLewis0602/MMM-Traffic/issues/103

                                            Could you tell me if i’m only person with this problem ?

                                            Lat/long are reversed as indicated on the readme, this is not the problem.

                                            Thank you.

                                            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
                                            • 1 / 2
                                            • 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