open the developers window, with ctrl-shift-i keystrokes,
then using mouse select the console tab, and then scroll up to find any errors (red text)
please advise
open the developers window, with ctrl-shift-i keystrokes,
then using mouse select the console tab, and then scroll up to find any errors (red text)
please advise
@Jackkt you need to use the node_helper module to launch your python script, and capture the output of the python script… then send that up to the module.js via sendSocketNotification…
then the module needs to signal updateDom() to tell MM there is new content, and it will call back at getDom() to get the new content, where u format your html to be shown.
node_helper
const { exec } = require('child_process');
exec('python your_script', (error, stdout, stderr) => {
if (error) {
console.error(`exec error: ${error}`);
return;
}
console.log(`stdout: ${stdout}`);
this.sendSocketNotification('some id string', stdout);
console.log(`stderr: ${stderr}`);
});
module.js
socketNotificationReceived: function(notification, payload) {
if( notification ==='some id string') {
var save_payload=payload)
this.updateDom(1000)
}
}
getDom: function (){
create the html here using save_payload)
return created_html
MM will inject the html in the div for your module
}
you can use my sample module for starters…
https://github.com/sdetweil/SampleModule
check out the difference between exec (one time) and spawn (send multiple responses over time)
@jcleary05 sure… I use mongodb, and connect to it via the node helper
here is a web page that describes all the operations (connect, search/get/select,
update,
@sgarg15 man that is an open topic…
like asking for recommendations for restaurant in New York City without so much as a type of food.
so, tell us what your idea for the mirror was about. what did u want to accomplish
where do you intend to put it, who will look at it? etc
@emrhssla said in Camera capture cannot be performed on the Magic Mirror.:
cv2.imwrite(‘chan.jpg’,frame)
i agree with sean… u need to be specific in your python script WHERE u write the file… here it defaults to the current directory at the time (which is NOT where the script is located)
maybe like this
cv2.imwrite('/home/pi/Desktop/chan.jpg',frame)
@Jackkt if the python script can be changed to just write to the screen, you can use spawn instead. And it can send u info every time it writes
@jcleary05 sorry, forgot to paste in the url
@Mykle1 we have posted this to the issue on GitHub, and in a closed topic here.
It also fails on my mobile device
@qistoph try disabling the GPU.
Stop pm2 instance, try this from terminal window
npm --disable-gpu start
@Jackkt that leading quote shouldn’t be there