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.

    Syntax Errorn in Config.js

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    11 Posts 6 Posters 5.0k Views 6 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
      sollekram
      last edited by sollekram

      syntax error while strarting mm, am i forgeting something?

      /* Magic Mirror Config Sample
       *
       * By Michael Teeuw http://michaelteeuw.nl
       * MIT Licensed.
       *
       * For more information how you can configurate this file
       * See https://github.com/MichMich/MagicMirror#configuration
       *
       */
      
      var config = {
      	address: "localhost", // Address to listen on, can be:
      	                      // - "localhost", "127.0.0.1", "::1" to listen on loopback interface
      	                      // - another specific IPv4/6 to listen on a specific interface
      	                      // - "", "0.0.0.0", "::" to listen on any interface
      	                      // Default, when address config is left out, is "localhost"
      	port: 8080,
      	ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses
      	                                                       // or add a specific IPv4 of 192.168.1.5 :
      	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
      	                                                       // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
      	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],
      
      	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: "New York",
      				locationID: "",  //ID from http://www.openweathermap.org/help/city_list.txt
      				appid: "YOUR_OPENWEATHER_API_KEY"
      			}
      		},
      		{
      			module: "weatherforecast",
      			position: "top_right",
      			header: "Weather Forecast",
      			config: {
      				location: "New York",
      				locationID: "5128581",  //ID from http://www.openweathermap.org/help/city_list.txt
      				appid: "YOUR_OPENWEATHER_API_KEY"
      			}
      		},
      		{
      			module: "newsfeed",
      			position: "bottom_bar",
      			config: {
      				feeds: [
      					{
      						title: "Hot News",
      						url: "http://www.ert.gr/feed/"
      					}
      				],
      				showSourceTitle: true,
      				showPublishDate: true
      			}
      		},
      	
      		{
      		    module: 'MMM-Assistant',
      		    position: 'bottom_left',
      		    config: {
      		        assistant: {
      		            auth: {
      		                keyFilePath:     "assets/google-client-secret.json", // REQUIRED (Google Assistant API) -- OAuth2 x509 cert
      		                savedTokensPath: "assets/google-access-tokens.json"  // REQUIRED (Google Assitant API) -- accesss_token & refresh_token
      		            },
      		            conversation: {
      		                lang: 'en-US',
      		                audio: {
      		                    encodingIn: "LINEAR16",  // Default. No need to change.
      		                    sampleRateOut: 16000     // Default. No need to change.
      		                }
      		            },
      		        },
      		        snowboy: {
      		            models: [
      		                {
      		                    hotwords : "MIRROR"                           // Default model: "MIRROR". (This is not the wake word!)
      		                    file: "resources/smart_mirror.umdl", // This file define your MM wake word. (See doc notes.)
      		                    sensitivity: 0.5,                             // 0.5
      		                },
      		                {
      		                    hotwords : "ASSISTANT"                        // Default model: "ASSISTANT". (This is not the wake word!)
      		                    file: "resources/snowboy.umdl",      // This file define your GA wake word. (See doc notes.)
      		                    sensitivity: 0.5,                             // 0.5
      		                }
      		            ]
      		        },
      		        record: {
      		            threshold: 0,                 // Default. No need to change.
      		            verbose: false,               // Default: true  -- for checking recording status.
      		            recordProgram: 'rec',         // You can also use 'arecord' or 'sox', but we recommend 'rec'
      		            silence: 2.0                  // Default. No need to change.
      		        },
      		        
      		}, // END
      	]
      
      };
      
      /*************** DO NOT EDIT THE LINE BELOW ***************/
      if (typeof module !== "undefined") {module.exports = config;}
      

      UPDATE:Solved

      justjim1220J strawberry 3.141S 2 Replies Last reply Reply Quote 0
      • justjim1220J Offline
        justjim1220 Module Developer @sollekram
        last edited by

        @sollekram said in Syntax Errorn in Config.js:

        {
        module: “currentweather”,
        position: “top_right”,
        config: {
        location: “New York”,
        locationID: “”, //ID from http://www.openweathermap.org/help/city_list.txt
        appid: “YOUR_OPENWEATHER_API_KEY”
        }
        },
        {
        module: “weatherforecast”,
        position: “top_right”,
        header: “Weather Forecast”,
        config: {
        location: “New York”,
        locationID: “5128581”, //ID from http://www.openweathermap.org/help/city_list.txt
        appid: “YOUR_OPENWEATHER_API_KEY”
        }
        },

        one thing I see is a blank spot…

        {
        			module: "currentweather",
        			position: "top_right",
        			config: {
        				location: "New York",
        				locationID: "",  //ID from http://www.openweathermap.org/help/city_list.txt
        				appid: "YOUR_OPENWEATHER_API_KEY"
        			}
        		},
        		{
        			module: "weatherforecast",
        			position: "top_right",
        			header: "Weather Forecast",
        			config: {
        				location: "New York",
        				locationID: "5128581",  //ID from http://www.openweathermap.org/help/city_list.txt
        				appid: "YOUR_OPENWEATHER_API_KEY"
        			}
        		},
        

        locationID: "", can’t be left blank
        use the same code for weatherforecast: locationID: "5128581",

        "Life's Too Short To Dance With Ugly People"
        Jim Hallock - 1995

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

          @sollekram mmm-assistant has missing commas in the lines of the hotwords

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

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sollekram @strawberry 3.141
            last edited by

            @strawberry-3-141 pfff that commas…how I always stuck in such of errors…

            Anyway thank you guys for the answers , I will check the commas and the location tommorow , and I will update.

            lavolp3L 1 Reply Last reply Reply Quote 0
            • R Offline
              robiv8
              last edited by

              @sollekram said in Syntax Errorn in Config.js:
              hotwords: “MIRROR” missing comma ,
              hotwords: “ASSISTANT” missing comma ,

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

                @sollekram Next time, it’s advisable to run

                npm run config:check
                

                This will tell you the errors.

                You can then e.g.

                sudo nano -c config.js
                

                to have the line numbers in nano and look up the lines.

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

                CyruS1337C 1 Reply Last reply Reply Quote 0
                • CyruS1337C Offline
                  CyruS1337 Project Sponsor @lavolp3
                  last edited by

                  @lavolp3 Is not there somewhere a list of all the commands that are recommended for the MagicMirror.

                  Also how to drive down the Raspberry PI Properly. I found a lot of different species on the internet. I now use the following shutdown command:

                  sudo shutdown -h now
                  
                  lavolp3L 1 Reply Last reply Reply Quote 0
                  • S Offline
                    sollekram
                    last edited by

                    I finally fixed it!!
                    Thank you guys !!!

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

                      @cyrus1337 I think this command is also included in the README of MM.
                      But it may be worth setting up a list. Don’t know. Maybe I’ll try :-)

                      Your shutdown command is the one I would use as well.
                      There are different commands giving the same result. The one you mentioned is the one mostly recommended.

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

                      CyruS1337C 1 Reply Last reply Reply Quote 0
                      • CyruS1337C Offline
                        CyruS1337 Project Sponsor @lavolp3
                        last edited by

                        @lavolp3 Ok, then I’m glad I’m using the right command. Partially, the PI is not averse, for whatever reason. Then I just pull the plug.

                        The list would really be a great idea. Because I’m really a newbi in this area. I can probably do various things on the PC, but the whole programming language are hieroglyphs for me, if you have mine. Because I have no background in this field. Maybe I can help you in another area 😉

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

                          @cyrus1337 If you’re really into the magicmirror stuff, it might be worth the time to do a little javascript training. There are courses all around the net, I’m currently doing some courses that have been offered for free on udemy.
                          https://www.udemy.com/javascriptfundamentals/

                          It may help a lot with not too much effort.

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

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