Closed haithem-bhk closed 4 years ago
Hmm. Curious. Could you please send me the portion of your config.js
for MMM-Selfieshot? I want to try and duplicate your issue.
Yeah I found something. I'm on it.
It's entirely possible that you're attempting to trigger the selfie before the MagicMirror has finished laying out all of the modules. Looking at the code, that line is trying to find the DIV object with the SELFIE id value and it's coming up zilch.
The solution here is to delay your notification until after your module receives the DOM_OBJECTS_CREATED notification. Additionally, I'll put in some checks to make sure that it errors gracefully if it receives a notification too early.
Also, I found an error where if you include a location for the module but don't tell it to put the touch button in place, it crashes. Thanks for pointing me at that general area. Now I have to go fix that.
Example code:
notificationReceived: function(noti, payload, sender) {
if (noti == "DOM_OBJECTS_CREATED") {
this.sendNotification("SELFIE_SHOOT",
{
option: {
shootCountdown: 1,
displayResult: false,
playShutter: false,
displayCountdown: false,
}
}
);
}
}
If you're still having problems, feel free to reopen the issue.
Hello, i've only been messing around with Magic Mirror for about a week so i'm pretty new, i made a module to send a notification ("SELFIE_SHOOT") at the start, but there's no feed.
checking the console i found the following error :
Uncaught (in promise) TypeError: Cannot read property 'classList' of null
(i have tested the USB camera on the raspberry and it works fine outside magic mirror) EDIT : I have tested the CURL method, and was able to take a selfie that's stored in the photos folder and the timer appears on screen, but i still want to use the notification method to make the display appear