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.

    Config.js issues

    Scheduled Pinned Locked Moved Troubleshooting
    error
    9 Posts 3 Posters 6.0k 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.
    • M Offline
      MatthewCowell
      last edited by

      I am having some issues with the config.js file. When I turn on my pi and the Mirror client loads it tells me to create a config file. Here is the the file (with a few things removed):

      /* Magic Mirror Config Sample
       *
       * By Michael Teeuw http://michaelteeuw.nl
       * MIT Licensed.
       */
      
      var config = {
      	port: 8080,
      
      	language: 'en',
      	timeFormat: 24,
      	units: 'metric',
      
      	modules: [
      		{
      			module: 'alert'
      		},
      		{
      			module: "updatenotification",
      			position: "top_bar"
      		},
      		{
      			module: 'clock',
      			position: 'top_left'
      		},
      		{
      			module: 'calendar',
      			header: 'US Holidays',
      			position: 'top_left',
      			config: {
      				calendars: [
      					{
      						symbol: 'calendar-check-o ',
      						url: 'webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics'
      					}
      				]
      			}
      		},
      		{
      			module: 'compliments',
      			position: 'lower_third'
      		},
      		{
      			module: 'currentweather',
      			position: 'top_right',
      			config: {
      				location: 'Bolton',
      				locationID: '2655237'
      			}
      		},
      		{
      			module: 'weatherforecast',
      			position: 'top_right',
      			header: 'Weather Forecast',
      			config: {
      				location: 'Bolton',
      				locationID: '2655237'```
      			}
      		},
      		{
      			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
      			}
      		}
      	]
      
      };
      
      /*************** DO NOT EDIT THE LINE BELOW ***************/
      if (typeof module !== 'undefined') {module.exports = config;}
      

      Please tell me if you find any errors in the code. I can’t find anything online that works.

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

        @MatthewCowell

        locationID: '2655237'```
        

        remove the backticks

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

        M 1 Reply Last reply Reply Quote 1
        • M Offline
          MatthewCowell @strawberry 3.141
          last edited by

          @strawberry-3.141 I have removed them but it still doesn’t work. Thank you for helping

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

            @MatthewCowell does maybe the removed part you mentioned has syntax errors? you can check it yourself on jshint.com.

            is your file called config.js?

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

            1 Reply Last reply Reply Quote 0
            • cowboysdudeC Offline
              cowboysdude Module Developer
              last edited by cowboysdude

              This is also wrong:

              {
              						title: "New York Times",
              						url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"
              					},	//
              

              Take out the // it’s negating the next bracket…

              /* Magic Mirror Config Sample
               *
               * By Michael Teeuw http://michaelteeuw.nl
               * MIT Licensed.
               */
              var config = {
                      port: 8080,
              
                      language: 'en',
                      timeFormat: 24,
                      units: 'metric',
              
                      modules: [{
                                  module: 'alert'
                              },
                              {
                                  module: "updatenotification",
                                  position: "top_bar"
                              },
                              {
                                  module: 'clock',
                                  position: 'top_left'
                              },
                              {
                                  module: 'calendar',
                                  header: 'US Holidays',
                                  position: 'top_left',
                                  config: {
                                      calendars: [{
                                          symbol: 'calendar-check-o ',
                                          url: 'webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics'
                                      }]
                                  }
                              },
                              {
                                  module: 'compliments',
                                  position: 'lower_third'
                              },
                              {
                                  module: 'currentweather',
                                  position: 'top_right',
                                  config: {
                                      location: 'Bolton',
                                      locationID: '2655237'
                                  }
                              },
                              {
                                  module: 'weatherforecast',
                                  position: 'top_right',
                                  header: 'Weather Forecast',
                                  config: {
                                      location: 'Bolton',
                                      locationID: '2655237'
                                      ``
                                      `
              			}
              		},
              		{
              			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
              			}
              		}
              	]
              
              };
              
              M 1 Reply Last reply Reply Quote 0
              • M Offline
                MatthewCowell @cowboysdude
                last edited by

                @cowboysdude Still not working. Thank you for the help!

                1 Reply Last reply Reply Quote 1
                • cowboysdudeC Offline
                  cowboysdude Module Developer
                  last edited by cowboysdude

                  Try this: the last one I took out the // but didn’t take out the extra ‘’ strawberry suggested you take out… this one should be working.

                  /* Magic Mirror Config Sample
                   *
                   * By Michael Teeuw http://michaelteeuw.nl
                   * MIT Licensed.
                   */
                  
                  var config = {
                  	port: 8080,
                  	ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
                  
                  	language: 'en',
                  	timeFormat: 12,
                  	units: 'imperial',
                  
                  	modules: [
                  		{
                  			module: 'alert',
                  		},
                  		{
                                      module: "updatenotification",
                                      position: "top_bar"
                                  },
                                  {
                                      module: 'clock',
                                      position: 'top_left'
                                  },
                                   {
                                      module: 'calendar',
                                      header: 'US Holidays',
                                      position: 'top_left',
                                      config: {
                                          calendars: [{
                                              symbol: 'calendar-check-o ',
                                              url: 'webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics'
                                          }]
                                      }
                                  },
                                  {
                                      module: 'compliments',
                                      position: 'lower_third'
                                  },
                                   {
                                      module: 'weatherforecast',
                                      position: 'top_right',
                                      header: 'Weather Forecast',
                                      config: {
                                          location: 'Bolton',
                                          locationID: '2655237'
                  			}
                  		},
                                  {
                                      module: 'currentweather',
                                      position: 'top_right',
                                      config: {
                                          location: 'Bolton',
                                          locationID: '2655237'
                                      }
                                  },
                                  {
                  			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
                  			}
                  		},
                  		
                  	]
                  
                  };
                  
                  /*************** DO NOT EDIT THE LINE BELOW ***************/
                  if (typeof module !== 'undefined') {module.exports = config;}
                  
                  
                  M 1 Reply Last reply Reply Quote 0
                  • M Offline
                    MatthewCowell @cowboysdude
                    last edited by

                    @cowboysdude I still can’t get it to work. Ill try reinstalling NOOBS and magicmirror and see if it gets any better

                    cowboysdudeC 1 Reply Last reply Reply Quote 0
                    • cowboysdudeC Offline
                      cowboysdude Module Developer @MatthewCowell
                      last edited by cowboysdude

                      @MatthewCowell I ran it through a validator and it said no issues and I can’t find any …

                      Why are you using Noobs? I would install this:

                      https://www.raspberrypi.org/downloads/raspbian/

                      When you restart copy your sample config js file to config.js and just make sure it starts…

                      Once you do that do not delete your sample config file as that is your temp backup…

                      Once you get it working and you add a module and it works then back up your config.js to something like config.bak that way you always have a working backup…

                      in terminal window:

                      cd ~MagicMirror/config
                      then
                      cp config.js config.bak

                      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