I have to check when i get home but i have been tired, long work hours and no patience left on me anymore lol but i feel optimistic like we are getting close like our keys are not matching now or the api
i will check and let you know
Read the statement by Michael Teeuw here.
Posts
-
RE: MMM-MirrorMirrorOnTheWall installation issue
-
RE: MM + Alexa + Logitech C170?
I used this https://www.youtube.com/watch?v=aN5NgqCw_i4&t=0s&index=55&list=PLiXGtogi1Y6cqXadodxYSQFGgVGCI79ym and than installed Alexa
However i am definitely moving away from the webcam and using a usb mic or audio card for it because the webcams and especially Logitech’s sucks for mic and video input as they compete for resources and voltage. i will be using the Rpi’s own cam module for camera and usb audio card attached to a mic for audio.
I have heard also the Sony PS2 webcams with a mic array inside re pretty good and only for 5-0 bucks on ebay but i am reluctant to spent the money for something that i may or may not use
D
-
RE: MMM-MirrorMirrorOnTheWall installation issue
As far as the “alexa-skills-kit-sdk-for-nodejs” goes… it wont hurt to try i guess… but i remember i have gone before and “npm install” individually all those 4 most important dependencies listed on section 2 of instructions (granted that we had many other errors before that would have ruined anything good) but that made no difference than.
As far as hard coding the paths of certs in the mirrormirro.js file in the Skill before zipping it up…i have read it too that it should be done there also but it makes absolutely no sense to me. Because when the zip file gets unzipped in Lambda servers everything gets stored in “/var/task/…” (node_modules or etc etc directories) after /task/ so basically we are telling it to look at /pi/home/MirrorMirrorskill or whatever that does not exist. That does not exist in Lambda, unless it mirrors a mini Rpi server or whatever, but i doubt it because if you look at the other previous error logs the node_modules and its under diretories are now at /var/task/ not where we all have it locally respectively. However that syntax __dirname + “/certs/MagicMirror.private.key” in our case, means the directory stored plus the file name in nodejs as far as i can tell from a quick search since i do not know nodejs other than from here. So what i am trying to say it seems to me like its the right thing to have.
D -
RE: MMM-MirrorMirrorOnTheWall installation issue
Here it is
'use strict'; /** * A Lambda function for handling Alexa Skill MirrorMirrorOnTheWall requests. * * Examples: * One-shot model: * User: "Alexa On The Wall, find Snow White." * Alexa: "Yes my Queen, showing images of Snow White." */ const Alexa = require('alexa-sdk'); /** * App ID for the skill * * replace with your app ID */ const appId = "amzn1.ask.skill.XXXXXXXXXX-48bd-9b1c-3d309a950fcf"; const MirrorMirror = require('./MirrorMirror'); MirrorMirror.setup(); const Keys = require("./certs/keys.json"); const GoogleImages = require('google-images'); var googleImages = new GoogleImages(Keys.cse.ID, Keys.cse.API_key); const YouTube = require('youtube-node'); var youTube = new YouTube(); youTube.setKey(Keys.youtube.API_key); exports.handler = function(event, context, callback) { let alexa = Alexa.handler(event, context); alexa.appId = appId; // To enable string internationalization (i18n) features, set a resources object. alexa.resources = languageStrings; alexa.registerHandlers(handlers); alexa.execute(); }; var languageStrings = { "en-US": { "translation": { "WELCOME_MESSAGE": "Hello my Queen, what can I do for you? ", "WELCOME_REPROMPT": "I can show you text and images, if you give me commands like 'say you are the fairest of them all' or 'find Snow White'. I can also open or close a magic mirror module, if you say commands like 'open compliments', or 'close weather forecast'. What can I do for you, my Queen?", "WELCOME_CARD": "Hello", "HELP_MESSAGE": "Hello my Queen, I can show you text and images, if you give me commands like 'say you are the fairest of them all' or 'find Snow White'. I can also open or close a magic mirror module, if you say commands like 'open compliments', or 'close weather forecast'. What can I do for you, my Queen?", "HELP_CARD": "Help", "STOP_MESSAGE": "See you next time, my Queen!", "STOP_CARD": "Goodbye", "SHOW_TEXT": "Yes, my Queen. %s.", "SHOW_TEXT_ERR": "Sorry, my Queen, I didn't get that. You can give me commands like 'display text of hello', or 'say you are the fairest of them all'. What can I do for you, my Queen?", "SHOW_TEXT_CARD": "Display Text", "SHOW_IMAGE": "Yes, my Queen, showing images of %s.", "SHOW_IMAGE_ERR": "Sorry, my Queen, I didn't get that. You can give me commands like 'find Snow White' or 'show me images of Bill Gates'. What can I do for you, my Queen?", "SHOW_IMAGE_CARD": "Show Image", "TURN_ON_MODULE": "Yes, my Queen, opening module %s.", "TURN_ON_MODULE_ERR": "Sorry, my Queen, I didn't get that. You can give me commands like 'open current weather' or 'turn on compliments'. What can I do for you, my Queen?", "TURN_ON_MODULE_CARD": "Open Module", "TURN_ON_ALL_MODULES": "Yes, my Queen, opening all modules.", "TURN_ON_ALL_MODULES_CARD": "Open All Modules", "TURN_OFF_MODULE": "Yes, my Queen, closing module %s.", "TURN_OFF_MODULE_ERR": "Sorry, my Queen, I didn't get that. You can give me commands like 'close current weather' or 'turn off compliments'. What can I do for you, my Queen?", "TURN_OFF_MODULE_CARD": "Close Module", "TURN_OFF_ALL_MODULES": "Yes, my Queen, closing all modules.", "TURN_OFF_ALL_MODULES_CARD": "Close All Modules", "SHOW_VIDEO": "Yes, my Queen, showing a video of %s.", "SHOW_VIDEO_ERR": "Sorry, my Queen, I didn't get that. You can give me commands like 'find a video of Snow White' or 'show me a video of Bill Gates'. What can I do for you, my Queen?", "SHOW_VIDEO_CARD": "Play Video", "ERROR_CARD": "Error" } }, "en-GB": { "translation": { "WELCOME_MESSAGE": "Hello my Queen, what can I do for you? ", "WELCOME_REPROMPT": "I can show you text and images, if you give me commands like 'say you are the fairest of them all' or 'find Snow White'. I can also open or close a magic mirror module, if you say commands like 'open compliments', or 'close weather forecast'. What can I do for you, my Queen?", "WELCOME_CARD": "Hello", "HELP_MESSAGE": "Hello my Queen, I can show you text and images, if you give me commands like 'say you are the fairest of them all' or 'find Snow White'. I can also open or close a magic mirror module, if you say commands like 'open compliments', or 'close weather forecast'. What can I do for you, my Queen?", "HELP_CARD": "Help", "STOP_MESSAGE": "See you next time, my Queen!", "STOP_CARD": "Goodbye", "SHOW_TEXT": "Yes, my Queen. %s.", "SHOW_TEXT_ERR": "Sorry, my Queen, I didn't get that. You can give me commands like 'display text of hello', or 'say you are the fairest of them all'. What can I do for you, my Queen?", "SHOW_TEXT_CARD": "Display Text", "SHOW_IMAGE": "Yes, my Queen, showing images of %s.", "SHOW_IMAGE_ERR": "Sorry, my Queen, I didn't get that. You can give me commands like 'find Snow White' or 'show me images of Bill Gates'. What can I do for you, my Queen?", "SHOW_IMAGE_CARD": "Show Image", "TURN_ON_MODULE": "Yes, my Queen, opening module %s.", "TURN_ON_MODULE_ERR": "Sorry, my Queen, I didn't get that. You can give me commands like 'open current weather' or 'turn on compliments'. What can I do for you, my Queen?", "TURN_ON_MODULE_CARD": "Open Module", "TURN_ON_ALL_MODULES": "Yes, my Queen, opening all modules.", "TURN_ON_ALL_MODULES_CARD": "Open All Modules", "TURN_OFF_MODULE": "Yes, my Queen, closing module %s.", "TURN_OFF_MODULE_ERR": "Sorry, my Queen, I didn't get that. You can give me commands like 'close current weather' or 'turn off compliments'. What can I do for you, my Queen?", "TURN_OFF_MODULE_CARD": "Close Module", "TURN_OFF_ALL_MODULES": "Yes, my Queen, closing all modules.", "TURN_OFF_ALL_MODULES_CARD": "Close All Modules", "SHOW_VIDEO": "Yes, my Queen, showing a video of %s.", "SHOW_VIDEO_ERR": "Sorry, my Queen, I didn't get that. You can give me commands like 'find a video of Snow White' or 'show me a video of Bill Gates'. What can I do for you, my Queen?", "SHOW_VIDEO_CARD": "Play Video", "ERROR_CARD": "Error" } } }; var handlers = { 'LaunchRequest': function() { this.emit('SayHello'); }, 'MirrorMirrorHelloIntent': function() { this.emit('SayHello'); }, 'SayHello': function() { this.emit(':askWithCard', this.t("WELCOME_MESSAGE"), this.t("WELCOME_REPROMPT"), this.t("WELCOME_CARD"), this.t("WELCOME_MESSAGE") + this.t("WELCOME_REPROMPT")); }, 'AMAZON.HelpIntent': function() { this.emit(':askWithCard', this.t("HELP_MESSAGE"), this.t("HELP_MESSAGE"), this.t("HELP_CARD"), this.t("HELP_MESSAGE")); }, 'AMAZON.StopIntent': function() { this.emit('StopCommand'); }, 'AMAZON.CancelIntent': function() { this.emit('StopCommand'); }, 'StopCommand': function() { this.emit(':tellWithCard', this.t("STOP_MESSAGE"), this.t("STOP_CARD"), this.t("STOP_MESSAGE")); }, 'ShowTextIntent': function() { let displayText = this.event.request.intent.slots.displayText.value; if (displayText) { let alexa = this // Alexa voice/card response to invoke after text is published to AWS IoT successfully let alexaEmit = function() { alexa.emit(':tellWithCard', alexa.t("SHOW_TEXT", displayText), alexa.t("SHOW_TEXT_CARD"), displayText) } // Send publish attempt to AWS IoT MirrorMirror.displayText(displayText, alexaEmit); } else { this.emit(':askWithCard', this.t("SHOW_TEXT_ERR"), this.t("SHOW_TEXT_ERR"), this.t("ERROR_CARD"), this.t("SHOW_TEXT_ERR")) } }, 'ShowImagesIntent': function() { let searchTerm = this.event.request.intent.slots.searchTerm.value; if (searchTerm) { let alexa = this // Search for images googleImages.search(searchTerm).then(function(images) { // Only https urls are allowed for the Alexa cards let imageObj = { smallImageUrl: images[0].thumbnail.url, largeImageUrl: images[0].thumbnail.url }; let alexaEmit = function() { alexa.emit(':tellWithCard', alexa.t("SHOW_IMAGE", searchTerm), alexa.t("SHOW_IMAGE_CARD"), searchTerm, imageObj) } // Send publish attempt to AWS IoT MirrorMirror.showImages(images, searchTerm, alexaEmit); }) } else { this.emit(':askWithCard', this.t("SHOW_IMAGE_ERR"), this.t("SHOW_IMAGE_ERR"), this.t("ERROR_CARD"), this.t("SHOW_IMAGE_ERR")) } }, 'TurnOnModuleIntent': function() { let moduleName = this.event.request.intent.slots.moduleName.value; if (moduleName) { let alexa = this let alexaEmit = function() { alexa.emit(':tellWithCard', alexa.t("TURN_ON_MODULE", moduleName), alexa.t("TURN_ON_MODULE_CARD"), alexa.t("TURN_ON_MODULE", moduleName)) } // Send publish attempt to AWS IoT MirrorMirror.changeModule(moduleName, true, alexaEmit); } else { this.emit(':askWithCard', this.t("TURN_ON_MODULE_ERR"), this.t("TURN_ON_MODULE_ERR"), this.t("ERROR_CARD"), this.t("TURN_ON_MODULE_ERR")) } }, 'TurnOnAllModuleIntent': function() { let alexa = this let alexaEmit = function() { alexa.emit(':tellWithCard', alexa.t("TURN_ON_ALL_MODULES"), alexa.t("TURN_ON_ALL_MODULES_CARD"), alexa.t("TURN_ON_ALL_MODULES")) } MirrorMirror.changeModule('all_modules', true, alexaEmit); }, 'TurnOffModuleIntent': function() { let moduleName = this.event.request.intent.slots.moduleName.value; if (moduleName) { let alexa = this let alexaEmit = function() { alexa.emit(':tellWithCard', alexa.t("TURN_OFF_MODULE", moduleName), alexa.t("TURN_OFF_MODULE_CARD"), alexa.t("TURN_OFF_MODULE", moduleName)) } // Send publish attempt to AWS IoT MirrorMirror.changeModule(moduleName, false, alexaEmit); } else { this.emit(':askWithCard', this.t("TURN_OFF_MODULE_ERR"), this.t("TURN_OFF_MODULE_ERR"), this.t("ERROR_CARD"), this.t("TURN_OFF_MODULE_ERR")) } }, 'TurnOffAllModuleIntent': function() { let alexa = this let alexaEmit = function() { alexa.emit(':tellWithCard', alexa.t("TURN_OFF_ALL_MODULES"), alexa.t("TURN_OFF_ALL_MODULES_CARD"), alexa.t("TURN_OFF_ALL_MODULES")) } MirrorMirror.changeModule('all_modules', false, alexaEmit); }, 'ShowVideoIntent': function() { let searchTerm = this.event.request.intent.slots.searchTermVideo.value; if (searchTerm) { let alexa = this // search for Youtube video youTube.search(searchTerm, 1, function(error, result) { if (error) { console.log(error); } else { console.log(JSON.stringify(result, null, 2)); let imageObj = { smallImageUrl: result.items[0].snippet.thumbnails.default.url, largeImageUrl: result.items[0].snippet.thumbnails.high.url }; let alexaEmit = function() { alexa.emit(':tellWithCard', alexa.t("SHOW_VIDEO", searchTerm), alexa.t("SHOW_VIDEO_CARD"), searchTerm, imageObj) } // Send publish attempt to AWS IoT MirrorMirror.showVideo(result.items[0].id.videoId, searchTerm, alexaEmit); } }); } else { this.emit(':askWithCard', this.t("SHOW_VIDEO_ERR"), this.t("SHOW_VIDEO_ERR"), this.t("ERROR_CARD"), this.t("SHOW_VIDEO_ERR")) } }, 'Unhandled': function () { this.emit(':ask', 'Sorry I didnt understand that. Say help for assistance.'); } };Remember to change the appId
-
RE: MMM-MirrorMirrorOnTheWall installation issue
Oh after that step 5 zip it back again and upload it to Lamda and save it
you should see no more errorsDenis
-
RE: MMM-MirrorMirrorOnTheWall installation issue
@OceanK Well now i get no errors in Lamda but i dont think its working still this is what i did after a lot of reading in the internet and in the MM forums.
Step 1. Delete your archive.zip you have on your Rpi
2. Go to “MirrorMirrorOnTheWallSkill” open “src” folder and open to edit “index.js”
3. At the very end of that file right before the very last } bracket
enter the following:, 'Unhandled': function () { this.emit(':ask', 'Sorry I didnt understand that. Say help for assistance.'); }notice the “,” right after the prior to last } before 'Unhandled" … so it wont give you a syntax error.
4. Go all the way up almost at the beginning of the file “index.js” and replace the following:const appId = "amzn1.ask.skill.XXXXXXXXXXX-XXXXX-9b1c-3d309a950fcf"; const MirrorMirror = require('./MirrorMirror'); MirrorMirror.setup(); const Keys = require("./certs/keys.json"); const GoogleImages = require('google-images'); var googleImages = new GoogleImages(Keys.cse.ID, Keys.cse.API_key); const YouTube = require('youtube-node'); var youTube = new YouTube(); youTube.setKey(Keys.youtube.API_key); exports.handler = function(event, context, callback) { let alexa = Alexa.handler(event, context); alexa.appId = appId;Make sure to change your appId with your own
You will see no more errors on Lamda and if you ask after on the wall it will say i am sorry i dont understand and if you ask for help it will tell you what help it can provide but nothing more than that… yet.
To be continued
Denis -
RE: MMM-MirrorMirrorOnTheWall - Alexa voice control to hide/show modules and display text/images
@d3r Hi there could you please help me out to install this module fully if you have time. i really need to have this figured out.
I have AlexaPi running fine i also have the Lamda and the Alexa skill installed the mirror responds with “Hello my queen how can i help you” but when i ask of anything that is related to this module such as turn on or off a MM module or display text or images it says “There was a problem with the requested skills response” here is what comes in the log file at CloudWatch on AWS Lamda

After some searching around the intenet the majority of them say that i need to add this ;
var handlers = { 'Unhandled': function () { this.emit(':ask', HelpMessage, HelpMessage); },But where and why why do we have to mess around with index.js file
anyhow any help will be greatly appreciated
Denis
-
RE: MirrorMirrorOntheWall Alexa Skill trouble
@torresfm Here is the issue i have now after the Mirror responds with hello my queen what can i do for you than when i ask about anything it says there is an error with your skills response and nothing happens
here is the error that i get on Lamda CloudWatch after that
Any ideas on how to solve this
Denis -
RE: MMM-MirrorMirrorOnTheWall installation issue
@OceanK Absolutely nothing i have to do much more research and read everything on the forums when it comes to this.
It seems like it has a problem with: No handler function was defined for event AMAZON.FallbackIntent and no ‘Unhandled’ function was defined.Here is my error log as well and it is exactly like yours

We need to continue reading
Denis -
RE: MMM-Gas
@cowboysdude I am interested in this as well …very cool thank you.
I have two questions does it include on the listing Costco and Sam’s (which are club member prices and what i use mostly) ??? and also is there an option you can add to it so it will start listing from the top with the lowest price instead of by the distance.Denis
-
RE: MMM-MirrorMirrorOnTheWall installation issue
Where do you find these log files at?? so i can look at mine??
it seems like it doesn’t find the way to sent the results back and where to send them?? -
RE: MMM-MirrorMirrorOnTheWall installation issue
Ok so here is my hardcoding of certs path on the Magic Mirror module
keyPath: “/home/pi/MagicMirror/modules/MMM-MirrorMirrorOnTheWall/certs/MagicMirror.private.key”,
certPath: “/home/pi/MagicMirror/modules/MMM-MirrorMirrorOnTheWall/certs/MagicMirror.cert.pem”,
caPath: “/home/pi/MagicMirror/modules/MMM-MirrorMirrorOnTheWall/certs/root-CA.crt”,Also dont forget to add your iot-endpoint
region: “us-east-1”,
host: “aonu6XXXX8o.iot.us-east-1.amazonaws.com”,I kept the config on module just as yours or the default for testing purposses
-
RE: MMM-MirrorMirrorOnTheWall Clarification
Exactly …I made some progress last night and found out that it needed a iot-endpoint which should go in the instructions of the MirrorMirrorOnTheWallSkill somewhere before the start of part 3… that MirrorMirror.js file should be edited to add iot endpoint that you get from Aws Iot-Core site at the bottom left if you click on settings, than zip them in Archive folder and upload them to Lambda.
Another thing or two that are missing from the instructions, on the MM module part now, of MirrorMirror is that a “npm install” is needed after cloning the module …also the key path for the certificates needs to be explained better for non coders on what the proper syntax is on how to do that.
Now the Alexa part works, however its not doing what it is supposed to be doing and for that i do not know where to start troubleshooting after it says Hello my Queen (lol me a queen hahaha) when you ask her to preform any task related to that skill such as turn on and off a module such as compliments or displaying any video it says there is a problem with your skill try again later …so no idea where to start on that???
Denis -
RE: MMM-MirrorMirrorOnTheWall installation issue
@OceanK Well i meant i got the MMM-MirrorMirrorOnTheWall module for Magic Mirror figured out but it is not working right if that makes sense. :rolling_on_the_floor_laughing: :rolling_on_the_floor_laughing: So when Magic Mirror itself is lunched and it is displaying other modules like Weather and Calendar and all that, it is not throwing an error for MMM-MirrorMirrorOnTheWall so i got the certs path figured out and you need to run “npm Install” on MMM-MirrorMirrorOnTheWall module before using it after you clone it on modules folder. I use Alexa Pi which has its own module on MM so when i call Alexa and i ask to “Start On the wall” the mirror replies as “Hello my queen what can i do for you” but when i ask to do something like hide a module or display anything it says an error has occurred with your skills response please try again later. I have no clue whats causing that so i guess some more research is needed.
Denis -
RE: MMM-MirrorMirrorOnTheWall installation issue
@OceanK Ok major major development on my end i got it to work …sort of LOL :) …meaning when i am on Magic Mirror and its doing its thing displaying the modules i can call Alexa ask her to start “on the wall” the mirror replies back with How can i Help you my Queen but when i ask to display a text or anything it says there was a problem with your skills response. Why is that???
D
-
RE: MMM-MirrorMirrorOnTheWall Clarification
@Skoo Hi there i have AlexaPi working perfectly and i have tried to follow the instructions for MirrorMirrorOnTheWall to the T however i get a Lamda error if i test there and when i test at the Alexa stage at the end i also there was a problem with your response and just Null on the right… no How can i help you my queen… i am baffled i am 100 % sure i am not making any mistakes from what is written in the instructions (obviously i am or it would work) and i have tried a clean install 3 times
What can i do
where do i start the troubleshooting??
The error on Lamda test always has to do with “aws-iot-device” on node-modules
check out my other link for more info here https://forum.magicmirror.builders/topic/8569/mmm-mirrormirroronthewall-installation-issue/9?page=1Any help will be greatly appreciated
Denis -
RE: MMM-MirrorMirrorOnTheWall installation issue
Ok so i was reading your steps and i basically did exactly the same thing and followed @joanaz instruction but with one exception!!! … are you absolutely sure that “node_modules” folder gets created by “npm install” inside the “src” folder on the “MirrorMirrorOnTheWallSkill” ??? …OR… did “node_modules” get created when you run “start.sh” on the IoT procedure and than copy that over to the “src” folder???
Do we only copy the 4 certificate files from the IoT part only or everything in that folder over to the “src” ???
Denis
-
RE: MMM-MirrorMirrorOnTheWall installation issue
I do’not think so …as long your exact copy of cert, private key and CA certificate files are with those exact names…meaning MagicMirror and you have them saved in that actual working directory where that file MagicMirror.js is than it ads those files automatically.
other than that the MagicMirror.js will through an error for the “___dirname+” part.I think…or wait on a second note… if you remove the anything after the keyPath: (and the other 2) and hard code the actual path to the files should work as well and will be a safer bet actually, so do that
Denis -
RE: MMM-MirrorMirrorOnTheWall installation issue
Well on my end i cant even get to the point you that your are at. Even if i try to test with “Alexa start Session” i get the same error as before so my problem is with aws-iot-device-sdk inside node_modules and for this i need your help how to get to the same spot where my test on Alexa side will turn on “Hello my queen…” and not null.
How can you send me the step by step on what you did and where did you differ from the instructions on @joanaz site or maybe a copy of the node_modules aws-iot-device-sdk i don’t know…and than we will try to get the rest figured out
Denis -
RE: MMM-MirrorMirrorOnTheWall installation issue
@oceank I may be doing something wrong but i just clicked on create test even and entered a name and clicked test and that’s what i got …maybe i had to select something different but i doubt it cause i am trying to redo it again with something common from the list like Hello World and it is still giving me the same results
Denis