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-Face-Reco-DNN

    Scheduled Pinned Locked Moved Solved Troubleshooting
    8 Posts 2 Posters 2.1k Views 2 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.
    • B Offline
      Blauenfeldt
      last edited by Blauenfeldt

      When i use classes like below

      classes: 'name'
      

      i get an error for the next line in the config.js
      If I write it with a comma like this:

      Classes: 'name',
      

      Then it and the whole module: "MMM-Face-Reco-DNN"will get ignored, and all my modules will be shown, even if nobody is in front of the camera.
      Here is a log:

      0|MagicMirror  | Loading config ...
      0|MagicMirror  | WARNING! Could not validate config file. Starting with default configuration. Please correct syntax errors at or above this line: /home/pi/MagicMirror/config/config.js:65
      0|MagicMirror  | 			classes: 'name'
      0|MagicMirror  | 			^^^^^^^
      0|MagicMirror  | SyntaxError: Unexpected identifier
      0|MagicMirror  |     at new Script (vm.js:74:7)
      0|MagicMirror  |     at createScript (vm.js:246:10)
      0|MagicMirror  |     at Object.runInThisContext (vm.js:298:10)
      0|MagicMirror  |     at Module._compile (internal/modules/cjs/loader.js:678:28)
      0|MagicMirror  |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
      0|MagicMirror  |     at Module.load (internal/modules/cjs/loader.js:620:32)
      0|MagicMirror  |     at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
      0|MagicMirror  |     at Function.Module._load (internal/modules/cjs/loader.js:551:3)
      0|MagicMirror  |     at Module.require (internal/modules/cjs/loader.js:658:17)
      0|MagicMirror  |     at require (internal/modules/cjs/helpers.js:20:18)
      0|MagicMirror  | Loading module helpers ...
      
      

      Here is line 65 in my config file:

      		{
      			module: "currentweather",
      			position: "top_right",
      			config: {
      				location: "hidden",
      				locationID: "hidden",  //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
      				appid: "hidden"
      			}
      			classes: 'name'
      		},
      

      If I move classes up below position like this:

      {
      			module: "currentweather",
      			position: "top_right",
      			classes: 'name'
      			config: {
      				location: "hidden",
      				locationID: "hidden",  //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
      				appid: "hidden"
      			}
      

      Then the result will be like this:

      0|MagicMirror  | WARNING! Could not validate config file. Starting with default configuration. Please correct syntax errors at or above this line: /home/pi/MagicMirror/config/config.js:60
      0|MagicMirror  | 			config: {
      0|MagicMirror  | 			^^^^^^
      0|MagicMirror  | SyntaxError: Unexpected identifier
      0|MagicMirror  |     at new Script (vm.js:74:7)
      0|MagicMirror  |     at createScript (vm.js:246:10)
      0|MagicMirror  |     at Object.runInThisContext (vm.js:298:10)
      0|MagicMirror  |     at Module._compile (internal/modules/cjs/loader.js:678:28)
      0|MagicMirror  |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
      0|MagicMirror  |     at Module.load (internal/modules/cjs/loader.js:620:32)
      0|MagicMirror  |     at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
      0|MagicMirror  |     at Function.Module._load (internal/modules/cjs/loader.js:551:3)
      0|MagicMirror  |     at Module.require (internal/modules/cjs/loader.js:658:17)
      0|MagicMirror  |     at require (internal/modules/cjs/helpers.js:20:18)
      
      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @Blauenfeldt
        last edited by

        @Blauenfeldt said in MMM-Face-Reco-DNN:

        classes ‘name’,

        yes, it should be
        classes: ‘name’,

        u missed the colon (:) between name and value

        Sam

        How to add modules

        learning how to use browser developers window for css changes

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

          My bad. That is what i have done. I will edit my problem so it is more detailed.

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @Blauenfeldt
            last edited by sdetweil

            @Blauenfeldt can u show your whole module definition
            is there a comma on the end of the line before classes:

            Sam

            How to add modules

            learning how to use browser developers window for css changes

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

              I’ve updated it. yes, the line before classes ends with a comma.

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                sdetweil @Blauenfeldt
                last edited by sdetweil

                @Blauenfeldt thanks

                in this case

                		{
                			module: "currentweather",
                			position: "top_right",
                			config: {
                				location: "hidden",
                				locationID: "hidden",  //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
                				appid: "hidden"
                			}    // < ------  comma needed here
                			classes: 'name'
                		},
                

                in this case

                {
                			module: "currentweather",
                			position: "top_right",
                			classes: 'name'   // < --- comma needed here
                			config: {
                				location: "hidden",
                				locationID: "hidden",  //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
                				appid: "hidden"
                			}
                }
                

                so, if u see an error like

                 WARNING! Could not validate config file. Starting with default configuration. Please correct syntax errors at or above this line: /home/pi/MagicMirror/config/config.js:60
                0|MagicMirror  | 			config: {
                

                general rule, look at the line BEFORE the line referenced and add a trailing comma
                in this case, line 59 (add a comma)

                also, do

                cd ~/MagicMirror
                npm run config:check
                

                fix errors from top down
                repeat til no errors

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                B 1 Reply Last reply Reply Quote 1
                • B Offline
                  Blauenfeldt @sdetweil
                  last edited by

                  @sdetweil Thank you. I will try that.

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

                    It works like a charm now. Thank you very much.

                    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