• 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.

Traffic on absolute or relative basis and traffice reports with TomTom (MMM-TomTomTrafficIncidents)

Scheduled Pinned Locked Moved Transport
6 Posts 3 Posters 986 Views 4 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.
  • T Offline
    Travelbacon
    last edited by May 9, 2020, 2:00 PM

    Hi MagicMirror builders!

    I programmed, or better said configured, a module that gets the traffic data from TomTom. The result is my module called MMM-TomTomTrafficIncidents. Please feel free to comment. This module displays traffic load and information where you don’t need a Google/MS account or leave Credit Card information. The traffic can be displayed absolute like other services commonly do. Or on a relative basis. Meaning if traffic has a speed limit of 50 km/h it will be marked green when people are driving 40-50. It will be red when it congested. Do you want to know where to drive fast? Use the absolute option. Very nifty option from TomTom.

    Example in Beervana where I placed a marker on a brewery :) :
    Absolute (slow and fast traffic):
    absolute.png
    Relative traffic (slower than normal):
    relative.png
    Relative delay (showing only the differences with normal flow)
    relative-delay.png

    I’ve chosen to keep the code simple to make it clear that it is a wrap around the TomTom’s Maps SKD for Web. No things like new object().setThing().color().

    The settings you can make:

    • Location, size, and zoom level
    • Type of traffic: absolute, relative of relative delay.
    • Showing traffic reports and incidents
    • Showing a marker (and size)
    • Refresh rate
    • Get the scripts and css local or from TomTom’s website.

    I am very happy that TomTom offers the WebAPI. It is barely programming at all. I would recommend to make your own module with their MapSDK for the Web. The best part is that there is no credit card needed! A username with email address is enough. If you run out of data, you’ll get an error back. For personal use, it is very hard to reach this limit. Assuming hat you don’t refresh every 5 minutes of a very large area.

    If you want to use your own map and only use the GEO information from TomTom, I would recommend to look at their other APIs on [https://developer.tomtom.com/#](TomTom Developer Portal)

    Cheers, George!

    1 Reply Last reply Reply Quote 1
    • R Offline
      robertybob
      last edited by robertybob Aug 30, 2020, 8:55 PM Aug 30, 2020, 8:50 PM

      Hi @Travelbacon ,
      I tried installing your module as per the code your post on the TomTom Dev forums but got this:

      742c86ce-fa54-4464-b508-9af3b425ea8b-image.png

      When removing the ./ I could install it, but still getting the same errors:
      44a142ac-7ebb-4c15-9ef9-0ebf91d55222-image.png

      and like you I can’t understand where the double forward slash comes from as it’s installed in the correctly named directory

      d8baf23f-9d6a-4162-9ee0-d01098cb5daa-image.png

      S 1 Reply Last reply Aug 30, 2020, 9:06 PM Reply Quote 0
      • S Offline
        sdetweil @robertybob
        last edited by Aug 30, 2020, 9:06 PM

        @robertybob you go to the github site for the module, and click tyhe green code down button
        Screenshot at 2020-08-30 16-01-49.png

        then you click the icon that looks like a clipboard , which copies the URL to the clipboard
        Screenshot at 2020-08-30 16-03-26.png

        then u go to your terminal window, with the ~/MagicMirror/modules as the current folder and type

        git clone

        and then paste the from the clipboard to get

        git clone https://github.com/Travelbacon/MMM-TomTomTrafficIncidents.git

        and u hit enter

        NOTHING after the pasted urll

        this is the SAME for EVERY module

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        S 1 Reply Last reply Aug 30, 2020, 9:07 PM Reply Quote 0
        • S Offline
          sdetweil @sdetweil
          last edited by sdetweil Aug 30, 2020, 9:08 PM Aug 30, 2020, 9:07 PM

          @robertybob you should enable ssh on the pi, and then you can open an ssh terminal window on your pc machine

          also get winscp or bitvise ssh clients, then you can have a file manager view of files on the pi and double click to edit
          with your favorite pc editor (I use notepad++)

          this will make it so that almost NEVER have to use a keyboard/mouse ON the pi itself…

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          R 1 Reply Last reply Aug 30, 2020, 9:14 PM Reply Quote 0
          • R Offline
            robertybob @sdetweil
            last edited by robertybob Aug 30, 2020, 9:18 PM Aug 30, 2020, 9:14 PM

            @sdetweil Hi Sam, I’m doing just that - Putty and WinSCP :) (see above screenshots from said programs)

            T 1 Reply Last reply Aug 31, 2020, 8:26 PM Reply Quote 0
            • T Offline
              Travelbacon @robertybob
              last edited by Aug 31, 2020, 8:26 PM

              @robertybob
              The strangest thing is that the module refers to /modules/MM-TomTomTrafficIncidents!!//!!MM-TomTomtrafficincidents.js.

              On the TomTom forum we saw that you used sudo to read files. Don’t use root privileges to edit or view files. Alle the files in MM are from the user pi in the group users. To avoid potential user right issues, I asked to delete the whole moduel and clone a new one. Just sdetweil told you.

              Because the module sees two slashes, I start think that a config in the module is not working. Did you test any other module for the MM? To see if these works. It could be that a small user handling goes wrong, but perhaps there is in deed an issue in my code. Although I tested it on a new MM installation.

              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