@Sean
haha thanks! I tried it first thing when i got home from school last night and everything worked perfectly, the clock was spot on! I’m going to call the fix to my problem being the school’s internet. At my school they have something on all the computers that freezes everything on the back to a specific time so i’m thinking that functionally maybe part of my problem… I don’t know but it works at home and that’s mostly what I care about. When I turn in the project I’ll just put in my write up that the school’s internet is messing with the security portion of the smart mirror and hope my teacher doesn’t ding me to much :/
Read the statement by Michael Teeuw here.
Posts
-
RE: MMM-Facial-Recognition and MMM-Assistant don't seem to be working together
-
RE: MMM-Facial-Recognition and MMM-Assistant don't seem to be working together
@dk7988
Found this,this, and this on stackoverflow. I’m still going through it to see if/how it applies to me but though it might be worth throwing up here. -
RE: MMM-Facial-Recognition and MMM-Assistant don't seem to be working together
@Sean
Aww… i see that sucks (talking about the ISS blah things)Yay! I have news! haha
Good first: I took it home turned it on and didn’t really change anything (except I added some more classes to some of the modules in the config file) and everything started working both fac.recon and the assistant (both snowboy and smart mirror were working).The Bad: right now i’m at the school trying the same thing that worked at home and fac.recon and half of the assistant is working (smart mirror still will not work, snowboy works fine) still getting the same error. I also tried running just the assistant and got the same thing.
After reading the error again “Check your iat and exp values and use a clock with skew to account for clock differences between systems.” is popping out to me. Do you know how i might be able to check my iat and exp values? actually what are “iat” and “exp” values? and do you know how i might be able to use a “clock with skew to account for clock differences between systems”?
1.) I ran
npm start dev
and the only thing i could see that was wrong was in the ‘console’ the last line it said[ASSTNT] Error: RECOGNIZESTREAM VM93 MMM-Assistant.js:412
am I looking in the right place? I tried researching to figure out how to find the terminal log but i had no luck. Do you have any ideas how i can find it?2.) I tried running
npm install node-aplay
in the assistant folder and got this
MMM-TelegramBot@1.0.0 /home/pi/MagicMirror/modules/MMM-Assistant
└── node-aplay@1.0.3npm WARN MMM-TelegramBot@1.0.0 No repository field.
npm WARN MMM-TelegramBot@1.0.0 No license field.I wasn’t sure what the WARN was trying to tell me (I assumed it wasn’t good) so i also ran
sudo npm install node-aplay
and got the same thing. Either way ding and dong still don’t play.3.) I think some how it’s the schools internet cause last night and Thursday night everything (including the clock) worked perfectly at home. Now the clock is back to being 12+ hours off and smart mirror won’t work. Any thoughts on the clock and smart mirror problem being related?
Thanks again for all your help!
-
RE: MMM-Facial-Recognition and MMM-Assistant don't seem to be working together
@Sean
1.) The only two places I’ve tried running it alone has been at home and at the school. At home, both ‘MIRROR’ and ‘ASSISTANT’ functions seem to be working but ding.wav and dong.wav don’t play. At the school, only ‘ASSISTANT’ functions seem to be working and the .wav files still don’t play either. If i asked it “what was the score of monday night’s fooball game?” it came back with answers but if i said “smart mirror, list all commands” or “list all modules” it wouldn’t do anything and the symbol (lower left corner) was stuck on the “#” symbol. So, I’m not quite sure how to answer that… i’m going to say kinda?2.) No worries, thanks for making it! It’s a pretty sweet module! I wish I understood it more or the MM platform in general better I have some ideas I’d like to add to it. I’ll try it with another mic and see what that does. Could you recommend some mic.s you know work?
3.)
Admins, can I get some help with these, please?
Oops I goofed can you delete this one -->[0_1510878576377_MMM-Config.txt](Uploading 100%)
[0_1510879991664_MMM-Config.txt](Uploading 100%)
[0_1510878940046_MMM-Config2.txt](Uploading 100%)
and thank you for the help last time too!Config for MMM-Facial-Recognition and MMM-Assistant plus all other modules:
/* 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: 12,
units: “imperial”,modules: [
{
module: “MMM-Facial-Recognition”,
classes: “default1”,
config: {
// 1=LBPH | 2=Fisher | 3=Eigen
recognitionAlgorithm: 1,
// Threshold for the confidence of a recognized face before it’s considered a
// positive match. Confidence values below this threshold will be considered
// a positive match because the lower the confidence value, or distance, the
// more confident tdefault1he algorithm is that the face was correctly detected.
lbphThreshold: 60,
fisherThreshold: 250,
eigenThreshold: 3000,
// force the use of a usb webcam on raspberry pi (on other platforms this is always true automatically)
useUSBCam: false,
// Path to your training xml
trainingFile: ‘/home/pi/MagicMirror/modules/MMM-Facial-Recognition/training.xml’,
// recognition intervall in seconds (smaller number = faster but CPU intens!)
interval: 0.5,
// Logout delay after last recognition so that a user does not get instantly logged out if he turns away from the mirror for a few seconds
logoutDelay: 20,
// Array with usernames (copy and paste from training script)
users: [‘Ethan’,‘Nick’,‘dakota’, ‘Michelle’,‘Tom’,
‘Rachel’],
//Module set used for strangers and if no user is detected
defaultClass: “default1”,
//Set of modules which should be shown for every user
everyoneClass: “everyone”,
// Boolean to toggle welcomeMessage
welcomeMessage: true
}
},{
module: ‘MMM-Assistant’,
position: ‘bottom_left’,
classes: “default1”,
config: {
assistant: {
auth: {
keyFilePath: “secret.json”, //When you want to change the location of this file, set this.
savedTokensPath: “resources/tokens.js” //When you want to change the location of this file, set this.
},
audio: {
encodingIn: “LINEAR16”, //Ignore this. I think you don’t need to change this.
sampleRateOut: 16000 //Ignore this. I think you don’t need to change this.
}
},
snowboy: {
models: [
{
file: “resources/smart_mirror.umdl”,
sensitivity: 0.6,
hotwords : “MIRROR” //One of models should be “MIRROR”
},
{
file: “resources/snowboy.umdl”,
sensitivity: 0.6,
hotwords : “ASSISTANT” //One of models should be “ASSISTANT”
}
]
},
record: {
threshold: 0, //Ignore this. I think you don’t need to change this.
verbose:false, //true for checking recording status.
recordProgram: ‘arecord’, //You can use ‘rec’, ‘sox’. But I recommend use ‘arecord’.
silence: 2.0 //Ignore this. I think you don’t need to change this.
},
stt: {
auth: [{
projectId: ‘’, //ProjectId from Google Console
keyFilename: ‘’
}], //You can use multi accounts for saving money.
request: {
encoding: ‘LINEAR16’, //Ignore this. I think you don’t need to change this.
sampleRateHertz: 16000, //Ignore this. I think you don’t need to change this.
languageCode: ‘en-US’ //See https://cloud.google.com/speech/docs/languages
},
},
speak: {
useAlert: true, //If you want to show the text of speech, set this true. But It could be ignored by command of modules directly.
language: ‘en-US’, //If you want to set the default language of speech of command result, set this.
},
alias: [
{
“help :command” : [“teach me :command”, “what is :command”]
}
] // You can use aliases for difficult pronunciation or easy using.
}
},// {
// module: “everyone”,
// position: “bottom_bar”,
// //Set your classes here seperated by a space.
// //Shown for all users
// classes: “everyone”
// },
// {
// module: “default1”,
// position: “top_bar”,
// //Only shown for default1
// classes: “default1”
// },
//-------------------------------------------------------------------
{
module: “clock”,
position: “top_left”,
classes: “default1”,
},
{
module: “compliments”,
position: “lower_third”,
classes: “default1”,
},
{
module: “currentweather”,
position: “top_right”,
classes: “default1”,
config: {
location: “My City”,
locationID: “My city codeId”, //ID from http://www.openweathermap.org/help/city_list.txt
appid: “My id”
}
},
{
module: “weatherforecast”,
position: “top_right”,
header: “Weather Forecast”,
classes: “default1”,
config: {
location: “My city”,
locationID: “My city codeId”, //ID from http://www.openweathermap.org/help/city_list.txt
appid: “My 2nd Id”
}
},
//-------------------------------------------------------------------
{
module: ‘MMM-Assistant’,
position: ‘bottom_left’,
classes: “Nick”,
config: {
assistant: {
auth: {
keyFilePath: “secret.json”, //When you want to change the location of this file, set this.
savedTokensPath: “resources/tokens.js” //When you want to change the location of this file, set this.
},
audio: {
encodingIn: “LINEAR16”, //Ignore this. I think you don’t need to change this.
sampleRateOut: 16000 //Ignore this. I think you don’t need to change this.
}
},
snowboy: {
models: [
{
file: “resources/hey mirror.pmdl”,
sensitivity: 0.55,
hotwords : “MIRROR” //One of models should be “MIRROR”
},
{
file: “resources/hey google.pmdl”,
sensitivity: 0.55,
hotwords : “ASSISTANT” //One of models should be “ASSISTANT”
}
]
},
record: {
threshold: 0, //Ignore this. I think you don’t need to change this.
verbose:false, //true for checking recording status.
recordProgram: ‘arecord’, //You can use ‘rec’, ‘sox’. But I recommend use ‘arecord’.
silence: 2.0 //Ignore this. I think you don’t need to change this.
},
stt: {
auth: [{
projectId: ‘’, //ProjectId from Google Console
keyFilename: ‘’
}], //You can use multi accounts for saving money.
request: {
encoding: ‘LINEAR16’, //Ignore this. I think you don’t need to change this.
sampleRateHertz: 16000, //Ignore this. I think you don’t need to change this.
languageCode: ‘en-US’ //See https://cloud.google.com/speech/docs/languages
},
},
speak: {
useAlert: true, //If you want to show the text of speech, set this true. But It could be ignored by command of modules directly.
language: ‘en-US’, //If you want to set the default language of speech of command result, set this.
},
alias: [
{
“help :command” : [“teach me :command”, “what is :command”]
}
] // You can use aliases for difficult pronunciation or easy using.
}
},
{
module: “Nick”,
position: “lower_third”,
//Only shown for Nick
classes: “Nick”
},
{
module: “alert”,
classes: “Nick”,
},
{
module: “updatenotification”,
position: “top_bar”,
classes: “Nick”,
},
{
module: “clock”,
position: “top_left”,
classes: “Nick”,
},
{
module: “calendar”,
header: “US Holidays”,
position: “top_left”,
classes: “Nick”,
config: {
calendars: [
{
symbol: "calendar-check-o ",
url: “webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics”
}
]
}
},
{
module: “currentweather”,
position: “top_right”,
classes: “Nick”,
config: {
location: “My City”,
locationID: “My CityId”, //ID from http://www.openweathermap.org/help/city_list.txt
appid: “My id”
}
},
{
module: “weatherforecast”,
position: “top_right”,
header: “Weather Forecast”,
classes: “Nick”,
config: {
location: “My City”,
locationID: “My CityId”, //ID from http://www.openweathermap.org/help/city_list.txt
appid: “My id”
}
},
{
module: “newsfeed”,
position: “bottom_bar”,
classes: “Nick”,
config: {
feeds: [
{
title: “Google News”,
url: “https://news.google.com/output=rss”
},
{
title: “CNN”,
url: “http://rss.cnn.com/rss/cnn_topstories.rss”
},
{
title: “Yahoo News”,
url: “http://news.yahoo.com/rss”
},
{
title: “ESPN”,
url: “http://www.espn.com/espn/rss/news”
},
{
title: “New York Times”,
url: “http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml”
}
],
showSourceTitle: true,
showPublishDate: true
}
},
//-------------------------------------------------------------------
{
module: “clock”,
position: “top_left”,
classes: “Michelle”,
},
{
module: “calendar”,
header: “US Holidays”,
position: “top_left”,
classes: “Michelle”,
config: {
calendars: [
{
symbol: "calendar-check-o ",
url: “webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics”
}
]
}
},
{
module: “currentweather”,
position: “top_right”,
classes: “Michelle”,
config: {
location: “My City”,
locationID: “My CityId”, //ID from http://www.openweathermap.org/help/city_list.txt
appid: “My id”
}
},
{
module: “weatherforecast”,
position: “top_right”,
header: “Weather Forecast”,
classes: “Michelle”,
config: {
location: “My City”,
locationID: “My CityId”, //ID from http://www.openweathermap.org/help/city_list.txt
appid: “My id”
}
},
//-------------------------------------------------------------------
{
module: “clock”,
position: “top_left”,
classes: “Rachel”,
},
{
module: “calendar”,
header: “US Holidays”,
position: “top_left”,
classes: “Rachel”,
config: {
calendars: [
{
symbol: "calendar-check-o ",
url: “webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics”
}
]
}
},
{
module: “currentweather”,
position: “top_right”,
classes: “Rachel”,
config: {
location: “My City”,
locationID: “My CityId”, //ID from http://www.openweathermap.org/help/city_list.txt
appid: “My id”
}
},
{
module: “weatherforecast”,
position: “top_right”,
header: “Weather Forecast”,
classes: “Rachel”,
config: {
location: “My City”,
locationID: “My CityId”, //ID from http://www.openweathermap.org/help/city_list.txt
appid: “My id”
}
},
//-------------------------------------------------------------------{
module: “dakota”,
position: “top_bar”,
//Only shown for dakota
classes: “dakota”
},
]};
/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== “undefined”) {module.exports = config;}Config for MMM-Assistant :
/* 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: 12,
units: “imperial”,modules: [
{
module: ‘MMM-Assistant’,
position: ‘bottom_left’,
config: {
assistant: {
auth: {
keyFilePath: “secret.json”, //When you want to change the location of this file, set this.
savedTokensPath: “resources/tokens.js” //When you want to change the location of this file, set this.
},
audio: {
encodingIn: “LINEAR16”, //Ignore this. I think you don’t need to change this.
sampleRateOut: 16000 //Ignore this. I think you don’t need to change this.
}
},
snowboy: {
models: [
{
file: “resources/smart_mirror.umdl”,
sensitivity: 0.6,
hotwords : “MIRROR” //One of models should be “MIRROR”
},
{
file: “resources/snowboy.umdl”,
sensitivity: 0.6,
hotwords : “ASSISTANT” //One of models should be “ASSISTANT”
}
]
},
record: {
threshold: 0, //Ignore this. I think you don’t need to change this.
verbose:false, //true for checking recording status.
recordProgram: ‘arecord’, //You can use ‘rec’, ‘sox’. But I recommend use ‘arecord’.
silence: 2.0 //Ignore this. I think you don’t need to change this.
},
stt: {
auth: [{
projectId: ‘’, //ProjectId from Google Console
keyFilename: ‘’
}], //You can use multi accounts for saving money.
request: {
encoding: ‘LINEAR16’, //Ignore this. I think you don’t need to change this.
sampleRateHertz: 16000, //Ignore this. I think you don’t need to change this.
languageCode: ‘en-US’ //See https://cloud.google.com/speech/docs/languages
},
},
speak: {
useAlert: true, //If you want to show the text of speech, set this true. But It could be ignored by command of modules directly.
language: ‘en-US’, //If you want to set the default language of speech of command result, set this.
},
alias: [
{
“help :command” : [“teach me :command”, “what is :command”]
}
] // You can use aliases for difficult pronunciation or easy using.
}
},]
};
/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== “undefined”) {module.exports = config;}4.) Off topic, but as I was going through the files for MMM-Assistant and noticed a file called ISS something (can’t remember the full name) so i clicked on it and started looking at some of the code… is the stuff in that folder for the assistant or something else?
-
MMM-Facial-Recognition and MMM-Assistant don't seem to be working together
Hello All,
I’m trying to use MMM-Assistant and MMM-Facial-Recognition together and I’m getting some weird things happening and I’m not sure if it’s because I don’t have MMM-Assistant installed correctly or what but here’s what’s happening.-
I noticed after I had everything installed and ran MMM-Assistant with the mirror ding.wav would not play and nothing would happen if I said either hotword. I started researching and messing with stuff, I had Pandora playing on the rpi in the background. By accident, I ran MMM-Assistant and I could hear ding.wav play over pandora but neither hotword would work. I kept researching and found this link to snowboy’s docs I gave it a go and YAHTZEE!! the mic and the speakers started working with the Assistant but I still can’t hear ding.wav or dong.wav play so I figured why not try it with Pandora playing in the background again… no part of the MM with load… should have guessed that… haha
-
When I tried to run both MMM-Assistant and MMM-Facial-Recognition together the facial recon. works and the hotword kind of works (meaning the symbol in the corner will flip to a different one but nothing past that). My internet was kinda left of center last nite while I was messing with everything so it was intermittently working when I finally gave up on it for the night so ctrl+q the MMM and saw all this in my terminal. I understand what some of it means but I’m lost with what the exceptions are trying to say. I tried it again at school today to make sure it wasn’t my environment at the house and got the same result.
pi@MgMrPi:~ $ cd MagicMirror pi@MgMrPi:~/MagicMirror $ npm start > magicmirror@2.1.3 start /home/pi/MagicMirror > sh run-start.sh Starting MagicMirror: v2.1.3 Loading config ... Loading module helpers ... Initializing new module helper ... Module helper loaded: MMM-Facial-Recognition Initializing new module helper ... Module helper loaded: MMM-Assistant No helper found for module: clock. No helper found for module: compliments. No helper found for module: currentweather. No helper found for module: weatherforecast. No helper found for module: Nick. No helper found for module: alert. Initializing new module helper ... Module helper loaded: updatenotification Initializing new module helper ... Module helper loaded: calendar Initializing new module helper ... Module helper loaded: newsfeed No helper found for module: dakota. All module helpers loaded. Starting server on port 8080 ... Server started ... Connecting socket for: MMM-Facial-Recognition Starting module helper: MMM-Facial-Recognition Connecting socket for: MMM-Assistant Connecting socket for: updatenotification Connecting socket for: calendar Starting node helper for: calendar Connecting socket for: newsfeed Starting module: newsfeed Sockets connected & modules started ... Launching application. Create new calendar fetcher for url: http://www.calendarlabs.com/templates/ical/US-Holidays.ics - Interval: 300000 [ASSTNT] Snowboy Activated [ASSTNT] Snowboy Activated Create new news fetcher for url: https://news.google.com/output=rss - Interval: 300000 Create new news fetcher for url: http://rss.cnn.com/rss/cnn_topstories.rss - Interval: 300000 Create new news fetcher for url: http://news.yahoo.com/rss - Interval: 300000 Create new news fetcher for url: http://www.espn.com/espn/rss/news - Interval: 300000 Create new news fetcher for url: http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml - Interval: 300000 Whoops! There was an uncaught exception... TypeError: parser.close is not a function at SAXStream.openf1 (/home/pi/MagicMirror/node_modules/feedme/lib/xmlfeedparser.js:107:14) at emitOne (events.js:96:13) at SAXStream.emit (events.js:191:7) at SAXParser.me._parser.(anonymous function) [as onopentag] (/home/pi/MagicMirror/node_modules/sax/lib/sax.js:258:17) at emit (/home/pi/MagicMirror/node_modules/sax/lib/sax.js:624:35) at emitNode (/home/pi/MagicMirror/node_modules/sax/lib/sax.js:629:5) at openTag (/home/pi/MagicMirror/node_modules/sax/lib/sax.js:825:5) at SAXParser.write (/home/pi/MagicMirror/node_modules/sax/lib/sax.js:1391:13) at SAXStream.write (/home/pi/MagicMirror/node_modules/sax/lib/sax.js:239:18) at module.exports.yoshi.write (/home/pi/MagicMirror/node_modules/feedme/lib/feedme.js:41:14) MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues [MMM-Facial-Recognition] Facerecognition started... [MMM-Facial-Recognition] Loading training data... [MMM-Facial-Recognition] ALGORITHM: LBPH [MMM-Facial-Recognition] Training data loaded! [MMM-Facial-Recognition] -------------------- [MMM-Facial-Recognition] PiCam ausgewählt... [MMM-Facial-Recognition] User Nick with confidence 55.5386130138 logged in. [ASSTNT] Assistant Activated [ASSTNT] Conversation Error: Service unavailable. [ASSTNT] Conversation Error: { Error: Unknown Error. at ClientDuplexStream._emitStatusIfDone (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:201:19) at ClientDuplexStream._receiveStatus (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:180:8) at /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:649:14 code: 2, metadata: Metadata { _internal_repr: { 'content-disposition': [Object] } } } [ASSTNT] Assistant Activated [ASSTNT] Conversation Error: Service unavailable. [ASSTNT] Conversation Error: { Error: Unknown Error. at ClientDuplexStream._emitStatusIfDone (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:201:19) at ClientDuplexStream._receiveStatus (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:180:8) at /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:649:14 code: 2, metadata: Metadata { _internal_repr: { 'content-disposition': [Object] } } } [ASSTNT] Assistant Activated [MMM-Facial-Recognition] User undefined with confidence null logged in. [ASSTNT] Conversation Error: Service unavailable. [ASSTNT] Conversation Error: { Error: Unknown Error. at ClientDuplexStream._emitStatusIfDone (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:201:19) at ClientDuplexStream._receiveStatus (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:180:8) at /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:649:14 code: 2, metadata: Metadata { _internal_repr: { 'content-disposition': [Object] } } } [ASSTNT] Assistant Activated [ASSTNT] Assistant Activated [MMM-Facial-Recognition] User undefined logged out. [ASSTNT] Conversation Error: Service unavailable. [ASSTNT] Conversation Error: { Error: Unknown Error. at ClientDuplexStream._emitStatusIfDone (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:201:19) at ClientDuplexStream._receiveStatus (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:180:8) at /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:649:14 code: 2, metadata: Metadata { _internal_repr: { 'content-disposition': [Object] } } } [ASSTNT] Assistant Activated [ASSTNT] Conversation Error: Service unavailable. [ASSTNT] Conversation Error: { Error: Unknown Error. at ClientDuplexStream._emitStatusIfDone (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:201:19) at ClientDuplexStream._receiveStatus (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:180:8) at /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:649:14 code: 2, metadata: Metadata { _internal_repr: { 'content-disposition': [Object] } } } [ASSTNT] Conversation Error: Service unavailable. [ASSTNT] Conversation Error: { Error: Unknown Error. at ClientDuplexStream._emitStatusIfDone (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:201:19) at ClientDuplexStream._receiveStatus (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:180:8) at /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:649:14 code: 2, metadata: Metadata { _internal_repr: { 'content-disposition': [Object] } } } [ASSTNT] Assistant Activated [ASSTNT] Conversation Error: Service unavailable. [ASSTNT] Conversation Error: { Error: Unknown Error. at ClientDuplexStream._emitStatusIfDone (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:201:19) at ClientDuplexStream._receiveStatus (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:180:8) at /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:649:14 code: 2, metadata: Metadata { _internal_repr: { 'content-disposition': [Object] } } } [MMM-Facial-Recognition] User Nick with confidence 51.9561007147 logged in. [ASSTNT] Assistant Activated [ASSTNT] Conversation Error: Service unavailable. [ASSTNT] Conversation Error: { Error: Unknown Error. at ClientDuplexStream._emitStatusIfDone (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:201:19) at ClientDuplexStream._receiveStatus (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:180:8) at /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:649:14 code: 2, metadata: Metadata { _internal_repr: { 'content-disposition': [Object] } } } [MMM-Facial-Recognition] User undefined with confidence null logged in. [ASSTNT] Assistant Activated [ASSTNT] Assistant Activated [MMM-Facial-Recognition] User undefined logged out. [ASSTNT] Assistant Activated [ASSTNT] Conversation Error: Service unavailable. [ASSTNT] Conversation Error: { Error: Unknown Error. at ClientDuplexStream._emitStatusIfDone (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:201:19) at ClientDuplexStream._receiveStatus (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:180:8) at /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:649:14 code: 2, metadata: Metadata { _internal_repr: { 'content-disposition': [Object] } } } Whoops! There was an uncaught exception... TypeError: parser.close is not a function at SAXStream.openf1 (/home/pi/MagicMirror/node_modules/feedme/lib/xmlfeedparser.js:107:14) at emitOne (events.js:96:13) at SAXStream.emit (events.js:191:7) at SAXParser.me._parser.(anonymous function) [as onopentag] (/home/pi/MagicMirror/node_modules/sax/lib/sax.js:258:17) at emit (/home/pi/MagicMirror/node_modules/sax/lib/sax.js:624:35) at emitNode (/home/pi/MagicMirror/node_modules/sax/lib/sax.js:629:5) at openTag (/home/pi/MagicMirror/node_modules/sax/lib/sax.js:825:5) at SAXParser.write (/home/pi/MagicMirror/node_modules/sax/lib/sax.js:1391:13) at SAXStream.write (/home/pi/MagicMirror/node_modules/sax/lib/sax.js:239:18) at module.exports.yoshi.write (/home/pi/MagicMirror/node_modules/feedme/lib/feedme.js:41:14) MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues [ASSTNT] Conversation Error: Service unavailable. [ASSTNT] Conversation Error: { Error: Unknown Error. at ClientDuplexStream._emitStatusIfDone (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:201:19) at ClientDuplexStream._receiveStatus (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:180:8) at /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:649:14 code: 2, metadata: Metadata { _internal_repr: { 'content-disposition': [Object] } } } [ASSTNT] Assistant Activated [ASSTNT] Conversation Error: Service unavailable. [ASSTNT] Conversation Error: { Error: Unknown Error. at ClientDuplexStream._emitStatusIfDone (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:201:19) at ClientDuplexStream._receiveStatus (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:180:8) at /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:649:14 code: 2, metadata: Metadata { _internal_repr: { 'content-disposition': [Object] } } } [ASSTNT] Conversation Error: Service unavailable. [ASSTNT] Conversation Error: { Error: Unknown Error. at ClientDuplexStream._emitStatusIfDone (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:201:19) at ClientDuplexStream._receiveStatus (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:180:8) at /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:649:14 code: 2, metadata: Metadata { _internal_repr: { 'content-disposition': [Object] } } } [MMM-Facial-Recognition] User Nick with confidence 56.4926497421 logged in. [ASSTNT] Assistant Activated [MMM-Facial-Recognition] User undefined with confidence null logged in. [ASSTNT] Conversation Error: Service unavailable. [ASSTNT] Conversation Error: { Error: Unknown Error. at ClientDuplexStream._emitStatusIfDone (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:201:19) at ClientDuplexStream._receiveStatus (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:180:8) at /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/google-assistant/node_modules/grpc/src/node/src/client.js:649:14 code: 2, metadata: Metadata { _internal_repr: { 'content-disposition': [Object] } } } -
- While I was at school I figure I could run just the MMM-Assistant and try to show it off a little but all the “MIRROR” commands would not work and all this showed up in the terminal.
pi@MgMrPi:~ $ cd MagicMirror pi@MgMrPi:~/MagicMirror $ npm start > magicmirror@2.1.3 start /home/pi/MagicMirror > sh run-start.sh Starting MagicMirror: v2.1.3 Loading config ... Loading module helpers ... Initializing new module helper ... Module helper loaded: MMM-Assistant All module helpers loaded. Starting server on port 8080 ... Server started ... Connecting socket for: MMM-Assistant Sockets connected & modules started ... Launching application. [ASSTNT] Snowboy Activated Auth error:Error: invalid_grant: Invalid JWT: Token must be a short-lived token (60 minutes) and in a reasonable timeframe. Check your iat and exp values and use a clock with skew to account for clock differences between systems. [ASSTNT] RecognizeStream Error: { Error: Getting metadata from plugin failed with error: invalid_grant: Invalid JWT: Token must be a short-lived token (60 minutes) and in a reasonable timeframe. Check your iat and exp values and use a clock with skew to account for clock differences between systems. at ClientDuplexStream._emitStatusIfDone (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/grpc/src/client.js:255:19) at ClientDuplexStream._receiveStatus (/home/pi/MagicMirror/modules/MMM-Assistant/node_modules/grpc/src/client.js:233:8) at /home/pi/MagicMirror/modules/MMM-Assistant/node_modules/grpc/src/client.js:757:12 code: 16, metadata: Metadata { _internal_repr: {} } } pi@MgMrPi:~/MagicMirror $ npm start > magicmirror@2.1.3 start /home/pi/MagicMirror > sh run-start.sh Starting MagicMirror: v2.1.3 Loading config ... Loading module helpers ... Initializing new module helper ... Module helper loaded: MMM-Assistant All module helpers loaded. Starting server on port 8080 ... Server started ... Connecting socket for: MMM-Assistant Sockets connected & modules started ... Launching application. [ASSTNT] Snowboy Activated [ASSTNT] Assistant Activated [ASSTNT] GA Transcription: who's playing Monday Night Football [ASSTNT] Snowboy Activated ^C pi@MgMrPi:~/MagicMirror $
I think it’s trying to say the clock on my rpi is messed up? maybe? not sure… But I did notice ever since I bought it and loaded Debian Jessie on it the clock has never been right (upper right corner of the desktop, the MMM clock has been correct a couple times). Today when this happened the rpi clock said it was 12:38 AM but it was really 1:10 PM I messed with all the time settings in “sudo raspi-config” and the only thing I could get it to do right was the timezone change it never flipped over to PM (i live in Arizona)
A.) Is the clock my problem for this? and
B.) I’ve tried what feels like a million things to get the clock right does anyone know how I can fix the clock?Sorry for writing a small book and hopefully all the events make sense. if anyone could shed any light on any of my problems I would be greatly appreciative!
-
-
RE: Help! semester project can't figure out facial recognition
@dmcinnes
You are awesome!! thank you! that did the trick! -
RE: Help! semester project can't figure out facial recognition
@dmcinnes
Oohh!! are you thinking cause the folder names is ‘MMM-Facial-Recognition-master’ and in the MagicMirror config.js file it says “module: “MMM-Facial-Recognition”,
config: { … etc” and/or in the MMM-Facial-Recognition/…/config.py file it says “Module.register(“MMM-Facial-Recognition”,
{ defaults: {…etc” and not
‘MMM-Facial-Recognition-master’? I can see how that would make since, I’ll give it a try later tonite when I get home. -
RE: Help! semester project can't figure out facial recognition
@dmcinnes
Hello, thanks for getting back to me. I’m not sure what your asking :/ I’m unfamiliar with the whole “checked out” part but the location of the node_helper.js file is at /home/pi/MagicMirror/modules/MMM-Facial-Recognition-master/node_helper.js -
Help! semester project can't figure out facial recognition
Hello all,
First I wanna say I’m new to forums in general so if I posted this in the wrong place a guiding hand would be much appreciated. Secondly I’m kinda new to rpi and super new to magic mirror. I’ve done a couple cool projects but this facial recognition is kicking my but! I’ve been researching and trying different things off and on for about two weeks now trying to figure this out with no luck. I tried using 50+ pictures with all three algorithms, I’ve completely reloaded raspbian, magic mirror^2, and MMM-Facial-Recognition with the only good that came from it was getting Facial-Recognition-Tools to start working. When I run ‘facerecognition.py’ it was able to figure out my buddy Dakota and myself but when I try to run it with the magic mirror it seems like it’s not doing anything. Below I have all three different Magic Mirror config.js files i used (in an attempt to try to figure something/ anything out), my three different “classes” (hopefully that’s what i made :/ ), MMM-Facial-Recognition-Tools-master config.py file, and the Terminal output with each config.js file (1-3) i tried and the out come. if someone could point me in the right direction of what I’m doing wrong I would GREATLY appreciated! Thanks
Magic Mirror Config.js #1:
/* 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: 12,
units: “imperial”,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: “Maricopa”,
locationID: “5303752”, //ID from http://www.openweathermap.org/help/city_list.txt
appid: “key”
}
},
{
module: “weatherforecast”,
position: “top_right”,
header: “Weather Forecast”,
config: {
location: “Maricopa”,
locationID: “5303752”, //ID from http://www.openweathermap.org/help/city_list.txt
appid: “key”
}
},
// {
// module: “MMM-Hello-Mirror”,
// position: “lower_third”,
// config: {
// language: “en”,
// voice: “US English Female”,
// wakeUp: “Hello Mirror”
// }
// },
{
module: “MMM-Facial-Recognition”,
config: {
// 1=LBPH | 2=Fisher | 3=Eigen
recognitionAlgorithm: 3,
// Threshold for the confidence of a recognized face before it’s considered a
// positive match. Confidence values below this threshold will be considered
// a positive match because the lower the confidence value, or distance, the
// more confident the algorithm is that the face was correctly detected.
lbphThreshold: 50,
fisherThreshold: 250,
eigenThreshold: 3000,
// force the use of a usb webcam on raspberry pi (on other platforms this is always true automatically)
useUSBCam: false,
// Path to your training xml
trainingFile: ‘/home/pi/MagicMirror/modules/MMM-Facial-Recognition-master’,
// recognition intervall in seconds (smaller number = faster but CPU intens!)
interval: 2,
// Logout delay after last recognition so that a user does not get instantly logged out if he turns away from the mirror for a few seconds
logoutDelay: 15,
// Array with usernames (copy and paste from training script)
users: [‘Nick’,‘nick’],
//Module set used for strangers and if no user is detected
defaultClass: “default1”,
//Set of modules which should be shown for every user
everyoneClass: “everyone”,
// Boolean to toggle welcomeMessage
welcomeMessage: true
}
},
// {
// module: “everyone”,
// position: “lower_third”,
// //Set your classes here seperated by a space.
// //Shown for all users
// classes: “everyone”
// },
// {
// module: “dakota”,
// position: “top_bar”,
// //Only shown for dakota
// classes: “dakota”
// },
{
module: “Nick”,
position: “lower_third”,
//Only shown for Nick
classes: “Nick”
},
{
module: “newsfeed”,
position: “bottom_bar”,
config: {
feeds: [
{
title: “Google News”,
url: “https://news.google.com/output=rss”
},
{
title: “CNN”,
url: “http://rss.cnn.com/rss/cnn_topstories.rss”
},
{
title: “Yahoo News”,
url: “http://news.yahoo.com/rss”
},
{
title: “ESPN”,
url: “http://www.espn.com/espn/rss/news”
},
{
title: “New York Times”,
url: “http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml”
}
],
showSourceTitle: true,
showPublishDate: true
}
},
]};
/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== “undefined”) {module.exports = config;}
Magic Mirror Config.js#2:
/* 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: 12,
units: “imperial”,modules: [
{
module: “MMM-Facial-Recognition”,
config: {
// 1=LBPH | 2=Fisher | 3=Eigen
recognitionAlgorithm: 1,
// Threshold for the confidence of a recognized face before it’s considered a
// positive match. Confidence values below this threshold will be considered
// a positive match because the lower the confidence value, or distance, the
// more confident the algorithm is that the face was correctly detected.
lbphThreshold: 50,
fisherThreshold: 250,
eigenThreshold: 3000,
// force the use of a usb webcam on raspberry pi (on other platforms this is always true automatically)
useUSBCam: false,
// Path to your training xml
trainingFile: ‘/home/pi/MagicMirror/modules/MMM-Facial-Recognition-master’,
// recognition intervall in seconds (smaller number = faster but CPU intens!)
interval: 2,
// Logout delay after last recognition so that a user does not get instantly logged out if he turns away from the mirror for a few seconds
logoutDelay: 15,
// Array with usernames (copy and paste from training script)
users: [‘Nick’],
//Module set used for strangers and if no user is detected
defaultClass: “default1”,
//Set of modules which should be shown for every user
everyoneClass: “everyone”,
// Boolean to toggle welcomeMessage
welcomeMessage: true
}
},
{
module: “everyone”,
position: “bottom_bar”,
//Set your classes here seperated by a space.
//Shown for all users
classes: “everyone”
},
{
module: “default1”,
position: “top_bar”,
//Only shown for default1
classes: “default1”
},
{
module: “Nick”,
position: “lower_third”,
//Only shown for Nick
classes: “Nick”
}
]};
/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== “undefined”) {module.exports = config;}
Magic Mirror Config.js #3:
/* 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: 12,
units: “imperial”,modules: [
{
module: “MMM-Facial-Recognition”,
config: {
// 1=LBPH | 2=Fisher | 3=Eigen
recognitionAlgorithm: 3,
// Threshold for the confidence of a recognized face before it’s considered a
// positive match. Confidence values below this threshold will be considered
// a positive match because the lower the confidence value, or distance, the
// more confident the algorithm is that the face was correctly detected.
lbphThreshold: 50,
fisherThreshold: 250,
eigenThreshold: 3000,
// force the use of a usb webcam on raspberry pi (on other platforms this is always true automatically)
useUSBCam: false,
// Path to your training xml
trainingFile: ‘/home/pi/MagicMirror/modules/MMM-Facial-Recognition-master’,
// recognition intervall in seconds (smaller number = faster but CPU intens!)
interval: 2,
// Logout delay after last recognition so that a user does not get instantly logged out if he turns away from the mirror for a few seconds
logoutDelay: 15,
// Array with usernames (copy and paste from training script)
users: [‘Nick’],
//Module set used for strangers and if no user is detected
defaultClass: “default1”,
//Set of modules which should be shown for every user
everyoneClass: “everyone”,
// Boolean to toggle welcomeMessage
welcomeMessage: true
}
}
]};
/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== “undefined”) {module.exports = config;}
MMM-Facial-Recognition-Tools-master config.py:
#!/usr/bin/env python
coding: utf8
“”"MMM-Facial-Recognition - MagicMirror Module
Face Recognition training script config
The MIT License (MIT)Copyright © 2016 Paul-Vincent Roll (MIT License)
Based on work by Tony DiCola (Copyright 2013) (MIT License)
“”"
import inspect
import os
import platform
import cv2(CV_MAJOR_VER, CV_MINOR_VER, mv1, mv2) = cv2.version.split(“.”)
_platform = platform.system().lower()
path_to_file = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))RECOGNITION_ALGORITHM = 1
POSITIVE_THRESHOLD = 80def set_recognition_algorithm(algorithm):
if algorithm < 1 or algorithm > 3:
print(“WARNING: face algorithm must be in the range 1-3”)
RECOGNITION_ALGORITHM = 1
os._exit(1)
RECOGNITION_ALGORITHM = algorithm
# Threshold for the confidence of a recognized face before it’s
# considered a positive match. Confidence values below this
# threshold will be considered a positive match because the lower
# the confidence value, or distance, the more confident the
# algorithm is that the face was correctly detected. Start with a
# value of 3000, but you might need to tweak this value down if
# you’re getting too many false positives (incorrectly recognized
# faces), or up if too many false negatives (undetected faces).
# POSITIVE_THRESHOLD = 3500.0
if RECOGNITION_ALGORITHM == 1:
POSITIVE_THRESHOLD = 80
elif RECOGNITION_ALGORITHM == 2:
POSITIVE_THRESHOLD = 250
else:
POSITIVE_THRESHOLD = 3000if (‘FACE_USERS’ in os.environ):
u = os.environ[‘FACE_USERS’]
users = u.split(‘,’)
print(users)
else:
# NOTE: Substitute your own user names here. These are just
# placeholders, and you will get errors if your training.xml file
# has more than 10 user classes.
users = [‘Nick’,‘User2’,‘User3’, ‘User4’,‘User5’,
‘User6’, ‘User7’, ‘User8’, ‘User9’, ‘User10’]
print(‘Remember to set the name list environment variable FACE_USERS’)Edit the values below to configure the training and usage of the
face recognition box.
if (‘FACE_ALGORITHM’ in os.environ):
set_recognition_algorithm(int(os.environ[‘FACE_ALGORITHM’]))
print(“Using FACE_ALGORITM: {0}”.format(RECOGNITION_ALGORITHM))
else:
set_recognition_algorithm(1)
print(“Using default FACE_ALGORITM: {0}”.format(RECOGNITION_ALGORITHM))File to save and load face recognizer model.
TRAINING_FILE = ‘training.xml’
TRAINING_DIR = ‘./training_data/’Size (in pixels) to resize images for training and prediction.
Don’t change this unless you also change the size of the training images.
FACE_WIDTH = 92
FACE_HEIGHT = 112Face detection cascade classifier configuration.
You don’t need to modify this unless you know what you’re doing.
See: http://docs.opencv.org/modules/objdetect/doc/cascade_classification.html
#HAAR_FACES = ‘lib/haarcascade_frontalface_alt.xml’
#HAAR_FACES = ‘lib/haarcascade_frontalface_alt2.xml’
#HAAR_FACES = ‘lib/haarcascade_frontalface_default.xml’
HAAR_FACES = ‘lib/haarcascade_frontalface.xml’
HAAR_EYES = ‘lib/haarcascade_eye.xml’
HAAR_SCALE_FACTOR = 1.05
HAAR_MIN_NEIGHBORS_FACE = 4 # 4 or 3 trainer/tester used different values.
HAAR_MIN_NEIGHBORS_EYES = 2
HAAR_MIN_SIZE_FACE = (30, 30)
HAAR_MIN_SIZE_EYES = (20, 20)def get_camera(preview=True):
try:
from . import picam
capture = picam.OpenCVCapture(preview)
capture.start()
return capture
except Exception:
from . import webcam
return webcam.OpenCVCapture(device_id=0)def is_cv2():
if CV_MAJOR_VER == 2:
return True
else:
return Falsedef is_cv3():
if CV_MAJOR_VER == 3:
return True
else:
return Falsedef model(algorithm, thresh):
# set the choosen algorithm
model = None
if is_cv3():
# OpenCV version renamed the face module
if algorithm == 1:
model = cv2.face.createLBPHFaceRecognizer(threshold=thresh)
elif algorithm == 2:
model = cv2.face.createFisherFaceRecognizer(threshold=thresh)
elif algorithm == 3:
model = cv2.face.createEigenFaceRecognizer(threshold=thresh)
else:
print(“WARNING: face algorithm must be in the range 1-3”)
os._exit(1)
else:
if algorithm == 1:
model = cv2.createLBPHFaceRecognizer(threshold=thresh)
elif algorithm == 2:
model = cv2.createFisherFaceRecognizer(threshold=thresh)
elif algorithm == 3:
model = cv2.createEigenFaceRecognizer(threshold=thresh)
else:
print(“WARNING: face algorithm must be in the range 1-3”)
os._exit(1)
return modeldef user_label(i):
“”" Generate the user lable. Lables are 1 indexed.
“”"
i = i - 1
if i < 0 or i > len(users):
return “User” + str(int(i))
return users[i]
default1 Module:
/* global Module */
/* Magic Mirror
- Module: HelloWorld
- By Michael Teeuw http://michaelteeuw.nl
- MIT Licensed.
*/
Module.register(“default1”,{
// Default module config.
defaults: {
text: “Hello World!”
},// Override dom generator.
getDom: function() {
var wrapper = document.createElement(“div”);
wrapper.innerHTML = this.config.text;
return wrapper;
}
});
everyone Module :
/* global Module */
/* Magic Mirror
- Module: HelloWorld
- By Michael Teeuw http://michaelteeuw.nl
- MIT Licensed.
*/
Module.register(“everyone”,{
// Default module config.
defaults: {
text: “Hello everyone!”
},// Override dom generator.
getDom: function() {
var wrapper = document.createElement(“div”);
wrapper.innerHTML = this.config.text;
return wrapper;
}
});
Nick Module:
/* global Module */
/* Magic Mirror
- Module: HelloWorld
- By Michael Teeuw http://michaelteeuw.nl
- MIT Licensed.
*/
Module.register(“Nick”,{
// Default module config.
defaults: {
text: “Hello Nick!”
},// Override dom generator.
getDom: function() {
var wrapper = document.createElement(“div”);
wrapper.innerHTML = this.config.text;
return wrapper;
}
});
Terminal output with config #1:
pi@MgMrPi:~ $ cd MagicMirror
pi@MgMrPi:~/MagicMirror $ npm startmagicmirror@2.1.3 start /home/pi/MagicMirror
sh run-start.shStarting MagicMirror: v2.1.3
Loading config …
Loading module helpers …
No helper found for module: alert.
Initializing new module helper …
Module helper loaded: updatenotification
No helper found for module: clock.
Initializing new module helper …
Module helper loaded: calendar
No helper found for module: currentweather.
No helper found for module: weatherforecast.
No helper found for module: MMM-Facial-Recognition.
No helper found for module: Nick.
Initializing new module helper …
Module helper loaded: newsfeed
All module helpers loaded.
Starting server on port 8080 …
Server started …
Connecting socket for: updatenotification
Connecting socket for: calendar
Starting node helper for: calendar
Connecting socket for: newsfeed
Starting module: newsfeed
Sockets connected & modules started …
Launching application.
Create new calendar fetcher for url: http://www.calendarlabs.com/templates/ical/US-Holidays.ics - Interval: 300000
Create new news fetcher for url: https://news.google.com/output=rss - Interval: 300000
Create new news fetcher for url: http://rss.cnn.com/rss/cnn_topstories.rss - Interval: 300000
Create new news fetcher for url: http://news.yahoo.com/rss - Interval: 300000
Create new news fetcher for url: http://www.espn.com/espn/rss/news - Interval: 300000
Create new news fetcher for url: http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml - Interval: 300000
Whoops! There was an uncaught exception…
TypeError: parser.close is not a function
at SAXStream.openf1 (/home/pi/MagicMirror/node_modules/feedme/lib/xmlfeedparser.js:107:14)
at emitOne (events.js:96:13)
at SAXStream.emit (events.js:191:7)
at SAXParser.me._parser.(anonymous function) [as onopentag] (/home/pi/MagicMirror/node_modules/sax/lib/sax.js:258:17)
at emit (/home/pi/MagicMirror/node_modules/sax/lib/sax.js:624:35)
at emitNode (/home/pi/MagicMirror/node_modules/sax/lib/sax.js:629:5)
at openTag (/home/pi/MagicMirror/node_modules/sax/lib/sax.js:825:5)
at SAXParser.write (/home/pi/MagicMirror/node_modules/sax/lib/sax.js:1391:13)
at SAXStream.write (/home/pi/MagicMirror/node_modules/sax/lib/sax.js:239:18)
at module.exports.yoshi.write (/home/pi/MagicMirror/node_modules/feedme/lib/feedme.js:41:14)
MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issuesOut Come:
Calendar, current weather, Forecast, Clock, news feed and “Hello Nick!” all show up but went i put my hand over the camera “Hello Nick!” still stays visible.
Terminal output with config #2:
pi@MgMrPi:~/MagicMirror $ npm start
magicmirror@2.1.3 start /home/pi/MagicMirror
sh run-start.shStarting MagicMirror: v2.1.3
Loading config …
Loading module helpers …
No helper found for module: MMM-Facial-Recognition.
No helper found for module: everyone.
No helper found for module: default1.
No helper found for module: Nick.
All module helpers loaded.
Starting server on port 8080 …
Server started …
Sockets connected & modules started …
Launching application.
pi@MgMrPi:~/MagicMirror $Out Come:
“Hello World!” shows up at the top, “Hello Nick!” shows up in the middle and “Hello everyone!” shows up at the bottom at mirror start up. again when i put my hand of the camera all three remain visible.
Terminal output with config #3:
pi@MgMrPi:~/MagicMirror $ npm start
magicmirror@2.1.3 start /home/pi/MagicMirror
sh run-start.shStarting MagicMirror: v2.1.3
Loading config …
Loading module helpers …
No helper found for module: MMM-Facial-Recognition.
All module helpers loaded.
Starting server on port 8080 …
Server started …
Sockets connected & modules started …
Launching application.
pi@MgMrPi:~/MagicMirror $Out Come:
Screen remains black nothing is shown