nischi / MMM-Face-Reco-DNN

Face recognition with opencv and deep neural network
MIT License
91 stars 46 forks source link

problem with the Config.js #102

Closed DieGamerPower closed 2 years ago

DieGamerPower commented 3 years ago

When i put the Module Usage in the config.js then tell's me my mirror that it doesn't work an i have a error.

nischi commented 3 years ago

Would you share what the error says? Or at least your Config?

DieGamerPower commented 3 years ago

/ Magic Mirror Config Sample

/ DO NOT EDIT THE LINE BELOW / if (typeof module !== "undefined") {module.exports = config;}

DieGamerPower commented 3 years ago

Don't be surprised that the information on the calendar and the other things are not correct, I've only deleted them for the post

nischi commented 3 years ago

you need to set the classes on every module. otherwise it will not work. but at least it should not show an error. what the error say?

DieGamerPower commented 3 years ago

Where i can finde the error

nischi commented 3 years ago

You wrote "then tell's me my mirror that it doesn't work an i have a error" :) Usualy in the logs

DieGamerPower commented 3 years ago

Ok i look in these thx XD

DieGamerPower commented 3 years ago

Where can i finde the logs (sorry i am a Beginner)

nischi commented 3 years ago

/home/pi/.pm2/logs/

DieGamerPower commented 3 years ago

[18.07.2021 18:03.02.511] [ERROR] 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:151 { ^

nischi commented 3 years ago

This error say it has a syntax error. Please check if there are somewhere a missing comma or brackets.

DieGamerPower commented 3 years ago

so i can finde anything in the Config here is the full error:

SyntaxError: Unexpected token '{'  at wrapSafe (internal/modules/cjs/loader.js:1060:16)  at Module._compile (internal/modules/cjs/loader.js:1108:27)  at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10)  at Module.load (internal/modules/cjs/loader.js:992:32)  at Module._load (internal/modules/cjs/loader.js:885:14)  at Function.f._load (electron/js2c/asar_bundle.js:5:12633)  at Module.require (internal/modules/cjs/loader.js:1032:19)18.07.2021 18:19.19.611  at loadConfig (/home/pi/MagicMirror/js/app.js:68:14)  at App.start (/home/pi/MagicMirror/js/app.js:211:3) [18.07.2021 18:19.19.611] [ERROR] 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:118 { ^

nischi commented 3 years ago

Remove one module after the other of the config file and you will find the issue

DieGamerPower commented 3 years ago

so when i put the Module Usage out off the config then it works but when i put it in then it doesen't work

nischi commented 3 years ago

Which module usage? All of them or just my module?

nischi commented 3 years ago

image

here is a comma missing

DieGamerPower commented 3 years ago

When i set the comma then turn my Monitor in a Black Screen

nischi commented 3 years ago

yes because you did forgot the classes as i said to beginn ;)

DieGamerPower commented 3 years ago

and where i can fill in the classes, I am sorry

nischi commented 3 years ago

Is everything documented ;) https://docs.magicmirror.builders/modules/configuration.html

DieGamerPower commented 3 years ago

is that right?

{ module: 'MMM-Face-Reco-DNN', position: 'bottom_right', // Set your classes here seperated by a space // Always shown classes: 'always' config: { logoutDelay: 15000, checkInterval: 2000, noFaceClass: 'noface', unknownClass: 'unknown', knownClass: 'known', defaultClass: 'default', everyoneClass: 'everyone', alwaysClass: 'always', cascade: 'modules/MMM-Face-Reco-DNN/tools/haarcascade_frontalface_default.xml', encodings: 'modules/MMM-Face-Reco-DNN/tools/encodings.pickle', usePiCamera: 1, source: 0, rotateCamera: 0, method: 'dnn', detectionMethod: 'hog', animationSpeed: 0, pythonPath: null, welcomeMessage: true, usernameDisplayMapping: null, extendDataset: false, dataset: 'modules/MMM-Face-Reco-DNN/dataset/', tolerance: 0.6, multiUser: 0, } }

nischi commented 3 years ago

On the other modules

DieGamerPower commented 3 years ago

is the class a own module?

nischi commented 3 years ago

Did read the Documentation i sent you? No it's not a own module, its a conifg property