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

Help... I need help installing 3rd party modules to Magic Mirror 2

Scheduled Pinned Locked Moved Troubleshooting
26 Posts 4 Posters 15.9k 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.
  • J Offline
    joeytuck
    last edited by Apr 16, 2017, 7:26 PM

    Hi everyone,

    I’m painfully new to any form of programming and could really use an assist on the proper way to install 3rd party modules on MagicMirror. I keep running into config.js issues on load up whenever I try to install a non factory module into the config.js file. I am trying to go by the instructions on github for mmm-traffic and to be honest I don’t even understand where or how to execute the files or where to do the npm install? Like I said, hardcore beginner. Any help would be greatly appreciated. This is a birthday present that I’m building and I’m already late with it.

    B 1 Reply Last reply Apr 16, 2017, 9:37 PM Reply Quote 0
    • A Offline
      Anhalter42
      last edited by Apr 16, 2017, 7:32 PM

      Welcome joeytuck,

      1. did you get it to run without additional 3rd party modules?
      2. if yes, share your config.js so we can have a look at it
      1 Reply Last reply Reply Quote 1
      • B Offline
        broberg Project Sponsor @joeytuck
        last edited by Apr 16, 2017, 9:37 PM

        @joeytuck

        Okey first of, when in your terminal typ cd MagicMirror/modules/ this will get you directly to your modules folder.

        after that you should type git clone https://github.com/SamLewis0602/MMM-Traffic.git
        This command will create a new folder called MMM-Traffic and copy all files for the module.
        When that is done you typ
        cd MMM-Traffic to enter the MMM-Traffic folder.

        When you have done that and are in the folder you type npm install, this will install all dependencies, i e stuff that is needed for the traffic module to work.

        Then open your config.js file and find the last ]

        Before that ] you add

        {
        	module: 'MMM-Traffic',
        	position: 'top_left',
        	classes: 'dimmed medium', //optional, default is 'bright medium', only applies to commute info not route_name
        	config: {
        		api_key: 'your_apikey_here',
        		mode: 'driving',
        		origin: '4 Pennsylvania Plaza, New York, NY 10001',
        		destination: '1 MetLife Stadium Dr, East Rutherford, NJ 07073',
        		arrival_time: '0800', //optional, but needs to be in 24 hour time if used.
        		route_name: 'Home to Work',
        		changeColor: true,
        		showGreen: false,
        		limitYellow: 5, //Greater than 5% of journey time due to traffic
        		limitRed: 20, //Greater than 20% of journey time due to traffic
        		traffic_model: 'pessimistic',
        		interval: 120000, //2 minutes
        		showWeekend: false,
        		allTime: false
        	}
        },
        

        Now you need to change the api key above where it says api_key: 'your_apikey_here',

        replace your_apikey_here with the needed api key and make sure not to remove the ' around the api key.

        1 Reply Last reply Reply Quote 2
        • J Offline
          joeytuck
          last edited by joeytuck Apr 17, 2017, 2:09 AM Apr 17, 2017, 2:05 AM

          Thank you for the replies. I did get Magic Mirror working for the initial setup prior to the 3rd party addition. I was missing the cd MMM-Traffic npm install portion. I did the npm install through Tools Open Folder in Terminal the first time. Not sure if that accomplishes the same goal? Itś still giving me the config.js error. Here is what I have for a config file with my personal info and API key copied and pasted directly from Google redacted.

          		module: "newsfeed",
          		position: "bottom_bar",
          		config: {
          			feeds: [
          				{
          					title: "New York Times",
          					url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"
          				}
          			],
          			showSourceTitle: true,
          			showPublishDate: true
          		}
          	},
          
          {
          		module:´MMM-Traffic´,
          		position: ´bottom_right´
          		classes: ´dimmed medium´,
          		config:  {
          			api_key: ´
          

          ´,
          mode: ´driving´,
          origin: ´´,
          destination: ´´,
          arrival_time: ´´,
          route_name: ´Home to Work´,
          changeColor: true,
          showgreen: false,
          limitYellow: 5,
          limitRed: 20,
          traffic_model: ´pessimistic´,
          interval: 120000,
          showWeekend: true
          allTime: true
          }
          },
          ]

          };

          1 Reply Last reply Reply Quote 0
          • J Offline
            joeytuck
            last edited by Apr 17, 2017, 2:07 AM

            		module: "newsfeed",
            		position: "bottom_bar",
            		config: {
            			feeds: [
            				{
            					title: "New York Times",
            					url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"
            				}
            			],
            			showSourceTitle: true,
            			showPublishDate: true
            		}
            	},
            
            {
            		module:´MMM-Traffic´,
            		position: ´bottom_right´
            		classes: ´dimmed medium´,
            		config:  {
            			api_key: ´´,
            			mode: ´driving´,
            			origin: ´´,
            			destination: ´´,
            			arrival_time: ´´,
            			route_name: ´Home to Work´,
            			changeColor: true,
            			showgreen: false,
            			limitYellow: 5,
            			limitRed: 20,
            			traffic_model: ´pessimistic´,
            			interval: 120000, 
            			showWeekend: true
            			allTime: true
            

            }
            },
            ]

            };

            B 1 Reply Last reply Apr 17, 2017, 2:26 AM Reply Quote 0
            • B Offline
              broberg Project Sponsor @joeytuck
              last edited by Apr 17, 2017, 2:26 AM

              @joeytuck

              you are missing a , after showWeekend: true,

              1 Reply Last reply Reply Quote 1
              • J Offline
                joeytuck
                last edited by Apr 17, 2017, 2:42 AM

                Good catch. I added the comma, saved the config file and tried pi@raspberrypi: ~/MagicMirror $ npm start To no avail. Do I need to do anything to the MMM-Traffic config.js file defaults?

                B 1 Reply Last reply Apr 17, 2017, 2:44 AM Reply Quote 0
                • B Offline
                  broberg Project Sponsor @joeytuck
                  last edited by Apr 17, 2017, 2:44 AM

                  @joeytuck there is also another comma missing after the position line

                  1 Reply Last reply Reply Quote 1
                  • J Offline
                    joeytuck
                    last edited by Apr 17, 2017, 2:46 AM

                    Added that comma as well and itś still failing. Hereś what Iḿ getting.

                    pi@raspberrypi:~/MagicMirror $ npm start

                    magicmirror@2.1.1 start /home/pi/MagicMirror
                    sh run-start.sh

                    Starting MagicMirror: v2.1.1
                    Loading config …
                    WARNING! Could not validate config file. Please correct syntax errors. Starting with default configuration.
                    Loading module helpers …
                    Initializing new module helper …
                    Module helper loaded: updatenotification
                    No helper found for module: helloworld.
                    All module helpers loaded.
                    Starting server on port 8080 …
                    Starting server op port 8080 …
                    Server started …
                    Connecting socket for: updatenotification
                    Sockets connected & modules started …
                    Launching application.

                    1 Reply Last reply Reply Quote 0
                    • J Offline
                      joeytuck
                      last edited by Apr 17, 2017, 2:48 AM

                      This has been kicking my butt for the last day and a half. Learning a lot during the beating though. Do I need to add ’ ’ around numeric values as well?

                      A 1 Reply Last reply Apr 17, 2017, 11:52 AM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 1 / 3
                      1 / 3
                      • First post
                        8/26
                        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