@bobbythemoh Can you please post your pm2 log. You can optain it by executing pm2 log MagicMirror if you are using pm2.
I just detected some unhandled rejections which may cause the black screen.
@bobbythemoh Can you please post your pm2 log. You can optain it by executing pm2 log MagicMirror if you are using pm2.
I just detected some unhandled rejections which may cause the black screen.
@sdetweil Actualy JSON requires quotation of the key and of the value (if the value is a string)
Example of a JSON file:
{
"string": "This is a string",
"bool": true,
"int", 1,
"float": 3.14,
"arrayOfStrings": [
"string1",
"string2"
],
"arrayOfInts": [
1,
2
]
}
The same can be used in a Javascript file, but as an object. You can also throw away the quotation of the keys.
@sdetweil I don’t think that. The helper is running on your Raspberry Pi, the module is running in every browser instance you open.
You need to coordinate your “show image event” from the helper and send out a notification to the module what image to show.
The ViewManagement must be in the module, the image downloading, handling must be in the helper.
Note: You only have one helper, but you can have multiple modules!
@sdetweil A MagicMirror Module has two parts, the node_helper.js and any other required node.js modulewhich runs on your Raspberry Pi, the other part is just plain Javascript like in any Website running on the Browser (Electron in the default case).
There are many node.js websocket server modules: https://www.npmjs.com/search?q=Websocket
Your node_helper.js is running the Websocket server and your other part is running a Websocket client. Follow this tutorial for the Websocket Client
The communication won’t be encrypted in any way, so don’t pass importand information over the Websocket!
@sdetweil I solved this problem by using this.sendSocketNotification This allows me to communicate with the modules interface.
@sdetweil Wait, I think I misunderstoodyour question.
Do you want to have a class variable just in your node_helper.js, or do you want to share a variable between node_helper.js and your MMM-ModuleName.js file?
@sdetweil Thats simply how to define a variable inside an object in node.js :grinning_face_with_smiling_eyes:
@brenj You definitely need some JSLint: https://www.jslint.com/
:winking_face:
@sdetweil If you want class variables you can do the following:
module.exports = NodeHelper.create({
variable1: true, // This is one way
start: function() {
this.variable2 = true // This is another way
// Both variables can be accessed via this.VARIABLE_NAME
}
});
@sdetweil You can establish a custom Websocket connection between your node_helper.js, which is node.js and your other JS code which runs in a browser.
@e3v3a I think xset just blanks the screen without powering off the HDMI signal?
I just implemented vcgencmd it looks like it is a bit quicker. I will check it out the next few days and will push it if everything works.
I just experienced a similar issue, but It appears not to be caused by MMM-Loxone. I am Invastigating it…
@michaels It looks like you don’t use pm2 to run MagicMirror.
How did you install MagicMirror, did you use the automatic installation?
@bobbythemoh I guess you have some sort of other “power saving” feature activated I am not familiar with. MMM-Loxone directly toggles the HDMI output on or off. It isn’t displaying a black view on top of the screen.
Please verify your /boot/config.txt!
In one ofyour posts you wrote hdmi_blanking_1 but it should be hdmi_blanking=1.
@kalleK This looks like you already have an instance of MagicMirror running. Do you use pm2 to run your MagicMirror on startup?
If you use pm2 you can run pm2 restart MagicMirror to restart the MagicMirror.
@bobbythemoh btw. Just blacking out the screen is not realy saving much power if the backlight is still on… You just have to install MMM-Loxone, it will switch off the HDMI signal everytime the lights go out, your monitor will handle the rest (you might check your monitors Power saving setting).
@bobbythemoh This sounds like you use some kind of other „screensaver“ which just displays a black screen instead of switching off the HDMI Port. I think you somehow enabled „screen blanking“.