Closed DieGamerPower closed 2 years ago
Would you share what the error says? Or at least your Config?
/ Magic Mirror Config Sample
and https://docs.magicmirror.builders/modules/configuration.html */ let 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 or empty, is "localhost" port: 8080, basePath: "/", // The URL path where MagicMirror is hosted. If you are using a Reverse proxy // you must set the sub path here. basePath must end with a / ipWhitelist: [], // 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"],
useHttps: false, // Support HTTPS or not, default "false" will use HTTP httpsPrivateKey: "", // HTTPS private key path, only require when useHttps is true httpsCertificate: "", // HTTPS Certificate path, only require when useHttps is true
language: "de", locale: "de-EU", logLevel: ["INFO", "LOG", "WARN", "ERROR"], // Add "DEBUG" for even more logging timeFormat: 24, units: "metric", // serverOnly: true/false/"local" , // local for armv6l processors, default // starts serveronly and then starts chrome browser // false, default for all NON-armv6l devices // true, force serveronly mode, because you want to.. no UI on this device
modules: [ { module: "alert", }, { module: "updatenotification", position: "top_bar" }, { module: "clock", position: "top_left" }, { module: "calendar", header: "Mein kalender", position: "top_left", config: { calendars: [ { symbol: "calendar-check", url: "https://calendar.google.com/.calendar.google.com" } ] } }, { module: "compliments", position: "lower_third" }, { module: 'MMM-Face-Reco-DNN', config: { // Logout 15 seconds after user was not detected any more // If they are detected within this period, the delay will start again logoutDelay: 15000, // How often the recognition starts in milliseconds // With a Raspberry Pi 3+ it works well every 2 seconds checkInterval: 2000, // Module set used for when there is no face detected ie no one is in front of the camera noFaceClass: 'noface', // Module set used for when there is an unknown/unrecognised face detected unknownClass: 'unknown', // Module set used for when there is a known/recognised face detected knownClass: 'known', // Module set used for strangers and if no user is detected defaultClass: 'default', // Set of modules which should be shown for any user ie when there is any face detected everyoneClass: 'everyone', // Set of modules that are always shown - show if there is a face or no face detected alwaysClass: 'always', // XML to recognize with haarcascade cascade: 'modules/MMM-Face-Reco-DNN/tools/haarcascade_frontalface_default.xml', // Pre-encoded pickle with the faces encodings: 'modules/MMM-Face-Reco-DNN/tools/encodings.pickle', // Use Raspberry Pi camera or another type // 1 = RasPi camera, 0 = other camera usePiCamera: 1, // If using another type of camera, you can choose // i.e. 0 = /dev/video0 or 'http://link.to/live' source: 0, // Rotate camera rotateCamera: 0, // Method of facial recognition // dnn = deep neural network, haar = haarcascade method: 'dnn', // Which face detection model to use // "hog" is less accurate but faster on CPUs // "cnn" is a more accurate deep-learning model which is GPU/CUDA accelerated detectionMethod: 'hog', // How long in milliseconds modules take to hide and show animationSpeed: 0, // Path to Python to run the face recognition // null or '' means default path pythonPath: null, // Should a welcome message be shown using the MagicMirror alerts module? welcomeMessage: true, // Dictionary for person name mapping in welcome message // Allows for displaying name with complex character sets in welcome message e.g. jerome => Jérôme, hideyuki => ?? usernameDisplayMapping: null, // Capture new pictures of recognized people, if unknown we save it in folder "unknown" // So you can extend your dataset and retrain it afterwards for better recognitions extendDataset: false, // If extendDataset is true, you need to set the full path of the dataset dataset: 'modules/MMM-Face-Reco-DNN/dataset/', // How much distance between faces to consider it a match. Lower is more strict. tolerance: 0.6, // allow multiple concurrent user logins, 0=no, any other number is the maximum number of concurrent logins multiUser: 0, } } { module: "weather", position: "top_right", config: { weatherProvider: "openweathermap", type: "current", location: "In a City", locationID: "", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city apiKey: "" } }, { module: "MMM-Face-Multi-User-Recognition-SMAI", position: "bottom_right", header: "Benutzer", config: { useMMMFaceRecoDNN: true } }, { module: "weather", position: "top_right", header: "Weather Forecast", config: { weatherProvider: "openweathermap", type: "forecast", location: "In a City", locationID: "", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city apiKey: "" } }, { module: 'MMM-iFrame-Ping', position: 'top_center', // This can be any of the regions. config: { // See 'Configuration options' for more information. url: "", //url to display height:"400px", width:"800px", autoRefresh: false, //set to false for video updateInterval: 0.5, //in min. Only if autoRefresh: true displayLastUpdate: false, width: "800px", // Optional. Default: 100% height: "400px", //Optional. Default: 100px scrolling: "no", } }, { module: "newsfeed", position: "bottom_bar", config: { feeds: [ { title: "Tagesschau", url: "http://www.tagesschau.de/xml/rss2", } ], showSourceTitle: true, showPublishDate: true, broadcastNewsFeeds: true, broadcastNewsUpdates: true } },
] };
/ DO NOT EDIT THE LINE BELOW / if (typeof module !== "undefined") {module.exports = config;}
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
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?
Where i can finde the error
You wrote "then tell's me my mirror that it doesn't work an i have a error" :) Usualy in the logs
Ok i look in these thx XD
Where can i finde the logs (sorry i am a Beginner)
/home/pi/.pm2/logs/
[18.07.2021 18:03.02.511] [ERROR] [31mWARNING! 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[39m [31m{[39m [31m^[39m
This error say it has a syntax error. Please check if there are somewhere a missing comma or brackets.
so i can finde anything in the Config here is the full error:
[31mSyntaxError: Unexpected token '{'[39m [31m at wrapSafe (internal/modules/cjs/loader.js:1060:16)[39m [31m at Module._compile (internal/modules/cjs/loader.js:1108:27)[39m [31m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10)[39m [31m at Module.load (internal/modules/cjs/loader.js:992:32)[39m [31m at Module._load (internal/modules/cjs/loader.js:885:14)[39m [31m at Function.f._load (electron/js2c/asar_bundle.js:5:12633)[39m [31m at Module.require (internal/modules/cjs/loader.js:1032:19)18.07.2021 18:19.19.611[39m [31m at loadConfig (/home/pi/MagicMirror/js/app.js:68:14)[39m [31m at App.start (/home/pi/MagicMirror/js/app.js:211:3)[39m [18.07.2021 18:19.19.611] [ERROR] [31mWARNING! 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[39m [31m{[39m [31m^[39m
Remove one module after the other of the config file and you will find the issue
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
Which module usage? All of them or just my module?
here is a comma missing
When i set the comma then turn my Monitor in a Black Screen
yes because you did forgot the classes as i said to beginn ;)
and where i can fill in the classes, I am sorry
Is everything documented ;) https://docs.magicmirror.builders/modules/configuration.html
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, } }
On the other modules
is the class a own module?
Did read the Documentation i sent you? No it's not a own module, its a conifg property
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.