I was rereading some of my old posts on this forum and recalled the issue I was having with the Mirror and the camera seeming to not work based on something I was messing up in the process. I think that’s about where it was left off. I’m going to work it back up slowly, comparing the old with the new (I’ve got a few spare Pis and monitors around so it’s easy for me to compare side by side as I go).
Read the statement by Michael Teeuw here.
Posts
-
RE: Resurrecting my mirror!
-
RE: Resurrecting my mirror!
That install script was great, thanks so much. Up and running on a fresh SD card. Now to reinstall the modules I had (I did back up the previous MM install but will start from scratch on the modules as well to relearn what I need to relearn.
-
RE: Resurrecting my mirror!
@sdetweil Thank you. I’ll start that process over the next day or two. Do you think it’s worth backing up? I can copy and paste the important bits I’ll need again and just start fully from scratch. It wouldn’t kill me to refresh my memory on how this all works again - it’s been quite a while. I’ll still back up of course, just in case but am tempted to just start over again.
I’ll pop the camera out of the case and see what version it is. It’s the OE Raspberry Pi camera, not sure what version though.
Happy new year!
-
Resurrecting my mirror!
Hello all, so happy to be back here after my mirror sat in a closet for a few years because the wife just didn’t “get it” and claimed we had no place to put it. Turns out we now have a place ot put it but more importantly, we have a mission for it to help us with.
Our teenage girls are really having a tough go at the world these days so we’ve decided to put the magic Mirror to work feeding them daily affirmations and positive thinking strategies. The mirror will be hung right at the bottom of our stairs to the front door where they will surely be at least two or three times a day. (Admittedly this “spot” didn’t exist prior to this spring when I decided to add an electrical outlet to the wall by the door so I could charge my unicycle there instead of having toe carry it up or down stairs.)
So that’s the back story. My Mirror is configured with the following modules:
Face-Reco
MMM-weatherforecast
MMM-TweetsByTimelineOrList
and MMM-Dad-Jokes (of course)Face-Reco was configured and working when I put it all away but I’m questioning whether my camera is functioning or not as it doesn’t seem to be working. My own photos are “close enough” to the same as the dataset so ‘recognition’ shouldn’t be the issue. I don’t think.
All the steps I’ve found to test the camera are not working and pointing me to reinstalling Ubuntu. Do you all have any suggestions for A) Checking the Camera for functionality or B) Reinstalling Ubuntu without losing all the configs on the Mirror side of things?
TIA for helping me finally get this mirror hung!
-
RE: MMM-TweetsByTimelineOrList - Awaiting Updates
Do you mean the Bad Words node helper? I’m not having any luck getting this loading - just have the “awaiting Updates” showing. I have triple checked my keys and they are all correct. How did you get yours going?
-
RE: Further personalization with Face-Reco
It appears to be working now (snuck to the Pi on my lunch break). I left one compliment in the afternoon class of the defaults list in compliments.js and put one into the instance tagged with my name as the class in config.js using the proper formatting. I now see where I went wrong so thanks for the help. I’ll try making multiple instances in config.js with different users tagged in the classes.
-
RE: Further personalization with Face-Reco
@JerryP said in Further personalization with Face-Reco:
Luckily @macboy is getting the hint :) :)
I don’t want to come across as daft (now or in future posts) so forgive the clarification here. Is the hint I’m getting referring to “Don’t post sensitive info” or is this in reference to “I should read the docs”?
Both equally important I agree.
I’m new to this forum and through my searches over the past few weeks setting up my mirror I haven’t seen a lot of “Don’t annoy us, read the docs” posts like I’ve seen on other development type forums. But you guys could just have a kinder way about saying the same. I feel like for the most part I’ve followed the docs - hell…I’ve made it THIS far, right?
When I set up the compliments module…well, when I customized it I should say, I really didn’t know what I was doing (this was early in the first mirror setup). I looked into config.js AND compliments.js and saw the default compliments there (in compliments.js). So, I edited them there and they worked. Now however when I try to set them up “correctly” in config.js it for some reason disables the Face-Reco setup. I’ll try the above formatting after work and post back if I still can’t figure out what I’ve done wrong to mess up the Face Recognition.
I DO appreciate everyone’s help here, don’t think that I’m a “Log in and have people lay it all out for me” kind of guy. Many, many scratches to the head happen before I throw in the towel and ask for help - my wife will be the first to confirm that ; )
-
RE: Further personalization with Face-Reco
----- Original Post #2 ------
So I just removed the list of compliments from the compliments.js ‘defaults’ section and pasted the same to config.js as per below. First the new compliments.js
Module.register("compliments", { // Module config defaults. defaults: { updateInterval: 80000, remoteFile: null, fadeSpeed: 4000, morningStartTime: 3, morningEndTime: 12, afternoonStartTime: 12, afternoonEndTime: 17, random: true, mockDate: null },
And the new config.js which disables the Face Reco and shows the compliments as undefined when the mirror loads.
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 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: ["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"], 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: "en", logLevel: ["INFO", "LOG", "WARN", "ERROR"], 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: '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, // 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: "alert", }, { module: "updatenotification", position: "top_bar" }, { module: "clock", position: "top_left", classes: 'always' }, { module: "calendar", header: "Coming Up...", position: "top_left", classes: 'anna julia kathy kelly', config: { calendars: [ { symbol: "calendar-check", url: "https://" } ] } }, { module: "compliments", position: "lower_third", classes: 'kelly', config: { anytime: ["Hey there, looking good!"], morning: ["Good morning!", "Enjoy your day!", "Attack today!"], afternoon: ["Hello, beauty!", "You look great!", "Looking good today!"], evening: ["You nailed the day!", "What a great day!", "Hi family!"], "....-01-01": ["Happy new year!"] } }, { module: "currentweather", position: "top_right", classes: 'anna julia kathy kelly', config: { location: "Sherwood Park", locationID: "5946768", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city appid: "71ddee6bbdcfb25b97866519bc4a52bc" } }, { module: "MMM-weatherforecast", position: "top_right", // This can be any of the regions. // Best results in bottom_bar region due to horizontal default layout and icon sizes. classes: 'anna julia kathy kelly', config: { // See 'Configuration options' for more information. location: "Sherwood Park", locationID: "5946768", //Location ID from http://openweathermap.org/help/city_list.txt appid: "71ddee6bbdcfb25b97866519bc4a52bc" //openweathermap.org API key. } }, { module: "newsfeed", position: "bottom_bar", classes: 'anna julia', config: { feeds: [ { title: "According to CBC", url: "https://rss.cbc.ca/lineup/canada-edmonton.xml" }, { title: "Upcoming Family Opportunities", url: "https://www.raisingedmonton.com/feed/" } ], showSourceTitle: true, showPublishDate: true, broadcastNewsFeeds: true, broadcastNewsUpdates: true } }, { module: 'MMM-TweetsByTimelineOrList', position: 'bottom_right', classes: 'kathy kelly', config: { // visit the url below for the twitter keys/tokens // https://dev.twitter.com/oauth/overview/application-owner-access-tokens consumer_key: 'XXXXX', consumer_secret: 'XXXXX', access_token_key: 'XXXXX', access_token_secret: 'XXXXX', // set the username and either timeline or listname screenName: 'XXXXXXXXXXX', listToShow: 'TIMELINE', } }, { module: 'default/MMM-Dad-Jokes', position: 'bottom_bar', // Or wherever you want classes: 'anna julia', config: { updateInterval: 600000, fadeSpeed: 4000 } }, { module: 'default/MMM-ATM', position: 'bottom_bar', // Works well anywhere classes: 'anna julia', config: { multipleChoice: "Yes", // No = just the ? then the answer useHeader: true, // true if you want a header header: "Feed your brain!", // Any text you want maxWidth: "1250px", // Stretch or constrain according to region } } ] }; /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") {module.exports = config;}
-
RE: Further personalization with Face-Reco
Just reposting the initial posts which I’ve deleted with the important info removed. (Thanks again for the heads up on what’s sensitive info and what’s not guys!)
------- Original post (in case anyone happens across this and doesn’t understand what my question/issue was) --------
With my compliments.js per below and my config.js also per below, the Face Reco works. I’ll post a second reply here showing how I tried to change both of these files.
Module.register("compliments", { // Module config defaults. defaults: { compliments: { anytime: ["Hey there, looking good!"], morning: ["Good morning!", "Enjoy your day!", "Attack today!"], afternoon: ["Hello, beauty!", "You look great!", "Looking good today!"], evening: ["You nailed the day!", "What a great day!", "Hi family!"], "....-01-01": ["Happy new year!"] }, updateInterval: 80000, remoteFile: null, fadeSpeed: 4000, morningStartTime: 3, morningEndTime: 12, afternoonStartTime: 12, afternoonEndTime: 17, random: true, mockDate: null },
And my current config.js (the whole thing since I can’t figure out why it’s reverting to no Face Reco when I change it).
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 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: ["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"], 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: "en", logLevel: ["INFO", "LOG", "WARN", "ERROR"], 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: '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, // 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: "alert", }, { module: "updatenotification", position: "top_bar" }, { module: "clock", position: "top_left", classes: 'always' }, { module: "calendar", header: "Coming Up...", position: "top_left", classes: 'anna julia kathy kelly', config: { calendars: [ { symbol: "calendar-check", url: "https://" } ] } }, { module: "compliments", position: "lower_third", classes: 'kelly' }, { module: "currentweather", position: "top_right", classes: 'anna julia kathy kelly', config: { location: "Sherwood Park", locationID: "5946768", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city appid: "71ddee6bbdcfb25b97866519bc4a52bc" } }, { module: "MMM-weatherforecast", position: "top_right", // This can be any of the regions. // Best results in bottom_bar region due to horizontal default layout and icon sizes. classes: 'anna julia kathy kelly', config: { // See 'Configuration options' for more information. location: "Sherwood Park", locationID: "5946768", //Location ID from http://openweathermap.org/help/city_list.txt appid: "71ddee6bbdcfb25b97866519bc4a52bc" //openweathermap.org API key. } }, { module: "newsfeed", position: "bottom_bar", classes: 'anna julia', config: { feeds: [ { title: "According to CBC", url: "https://rss.cbc.ca/lineup/canada-edmonton.xml" }, { title: "Upcoming Family Opportunities", url: "https://www.raisingedmonton.com/feed/" } ], showSourceTitle: true, showPublishDate: true, broadcastNewsFeeds: true, broadcastNewsUpdates: true } }, { module: 'MMM-TweetsByTimelineOrList', position: 'bottom_right', classes: 'kathy kelly', config: { // visit the url below for the twitter keys/tokens // https://dev.twitter.com/oauth/overview/application-owner-access-tokens consumer_key: 'XXXXX', consumer_secret: 'XXXXX', access_token_key: 'XXXXX', access_token_secret: 'XXXXX', // set the username and either timeline or listname screenName: 'XXXXXXXXXXX', listToShow: 'TIMELINE', } }, { module: 'default/MMM-Dad-Jokes', position: 'bottom_bar', // Or wherever you want classes: 'anna julia', config: { updateInterval: 600000, fadeSpeed: 4000 } }, { module: 'default/MMM-ATM', position: 'bottom_bar', // Works well anywhere classes: 'anna julia', config: { multipleChoice: "Yes", // No = just the ? then the answer useHeader: true, // true if you want a header header: "Feed your brain!", // Any text you want maxWidth: "1250px", // Stretch or constrain according to region } } ] }; /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") {module.exports = config;}
-
RE: Further personalization with Face-Reco
I’m unable to edit the posts above with my wife’s tokens because too much time has passed since I posted. Do one of you have the ability to either redact that portion of the code snippets (the TimelineOrList sections) in both posts above?
Possibly harmless to have that info out in public but someone could maliciously use her account for evil I guess. If the posts need to be removed that is okay as well. And if there is a method available to me to pull the posts or edit them I’m happy to do so - just let me know how. I’ll be more alert next time I start posting code. Funny enough I DID take a quick scan making sure I wasn’t posting SSIDs and passwords…haha
If anyone else knows how I can change that up just let me know.