Node_helper.js runs a pythonshell when getting a notification from the module.
Ah! It’s not running in the same environment as it does from the command line.
Is that fixable? Would running it as a child process help?
Node_helper.js runs a pythonshell when getting a notification from the module.
Ah! It’s not running in the same environment as it does from the command line.
Is that fixable? Would running it as a child process help?
I’ve created a python script to interface with the mirror to do a follow a few simple instruction (play internet radio, adjust volume etc). This works well, but it is a bit irritating that every phone in the local area tries to respond as well as the mirror.
So I integrated snowboy as a front end to activate Google’s listener. This works perfectly when running from a terminal but doesn’t respond when the python is called from the node helper.
Can somebody explain why the same code doesn’t run when it’s initiated from the node helper?
Sorry if it’s a bit of a basic question. I’ve tried googling but I can’t find anything that appears relevent.
Not sure if I’m having the same issue, stupidly updated electron as npm was claiming 1.7.13 had a critical vulnerability (after installing MMM-voice) Then got the backscreen issue. rolled back electron to 1.7.13 & the issue persists.
Node v9.11.1
npm 6.1.0
Thought I’d uploaded the log file but not sure if others can see it. That snippet below is the first error after ALL_MODULES_STARTED
13:01:19.440 main.js:40 Uncaught TypeError: Cannot read property ‘appendChild’ of undefined
at main.js:40
at Array.forEach ()
at createDomObjects (main.js:24)
at Object.modulesStarted (main.js:471)
at startModules (loader.js:59)
at loader.js:40
at HTMLLinkElement.stylesheet.onload (loader.js:203)
(anonymous) @ main.js:40
createDomObjects @ main.js:24
modulesStarted @ main.js:471
startModules @ loader.js:59
(anonymous) @ loader.js:40
stylesheet.onload @ loader.js:203
13:01:20.056 TypeError: Cannot read property ‘getElementsByClassName’ of null
at moduleNeedsUpdate (main.js:176)
at main.js:144
at Promise ()
at updateDomWithContent (main.js:137)
at main.js:119
at
Promise rejected (async)
(anonymous) @ main.js:121
Promise resolved (async)
(anonymous) @ main.js:118
updateDom @ main.js:109
updateDom @ main.js:514
updateDom @ module.js:358
Any pointers as to how to get it working again? It was working perfectly before MMM-voice & buggering around with electron.
Tried a fresh install with the same result :(
I found it to slow running it through the mm, maybe cause I’m running it from a pi0.
So I run the PIR python script (it also does the led strips) as a background task outside of mm enabled at boot via crontab.
It’s more responsive and seems to use less resources.
Not sure if I understand the issue.
You want to inhibit the screensaver?
I have a script in the startup:
#!/bin/sh
xset -dpms # disable DPMS (Energy Star) features.
xset s off # disable screen saver
xset s noblank # don’t blank the video device
unclutter & # loose the cursor
This works for me on a Pi0 which doesn’t have a desktop, might be different if you have a console loaded at boot.
Others have mentioned installing the screensaver app and using that to inhibit the display blanking.
If you want to switch the display from a phone, try RasPiCheck (available from Google Play) & set up a couple of console commands:
vcgencmd display_power 1 # for on
vcgencmd display_power 0 # for off
you’ll need SSH switched on in the Pi config & know the Pi ip-address.
@rak Had the original working OK, tried to npm install chart.js in the MM root :(
the npm install in the MMM-foecast.io directory fixed it. :)
looks great, good work.
thanks
@rak There seems to be a small error in the script creating the graph:
// Init chart.js
this.chart = new Chart(ctx, {
type: 'line',
data: data,
options: options
});
Throws an uncaught reference error. Unfortunately I know absolutely nothing about js, can you let me know how to fix it.
Ta
I was thinking that MMM-Remote-Control was sending the notification, hence the confusion.
Cleaned the config up to look like this:
{module: 'MMM-Buttons',
config: {
buttons: [
{
pin: 32,
name: "monitor_control",
longPress: {
notification: "REMOTE_ACTION",
payload: {"action": "HIDE", "module": "module_1_clock"}
},
shortPress: {
notification: "REMOTE_ACTION",
payload: {"action": "SHOW", "module": "module_1_clock"}
}
}
]
}},``
Can I add another payload from the same action i.e. hide clock & calendar?
Not had any success with that so far, can somebody give me a pointer to the syntax.
Ta.
Hi, bit new to linux only got a pi 3 months ago and its been a bit of a steep learning curve.
I’m having a bit of trouble understanding how to configure config.js What I’m trying to do is get MMM-Buttons to send a message to MMM-Remote to hide a module.
Everything runs ok (remote hides modules when access from my phone), but pressing the button does nothing. I’m guessing I’ve misunderstood how to configure the payload.
Config for Buttons looks like this:
{module: 'MMM-Buttons',
config: {
buttons: [
{
pin: 32,
name: "monitor_control",
longPress: {
notification: "REMOTE_ACTION",
payload: {action: "HIDE", "moduleData":[
{"hidden":true,"name":"clock","identifier":"module_1_clock","position":"top_left"},],},},
shortPress: {
notification: "REMOTE_ACTION",
payload: {action: "SHOW","moduleData":[
{"hidden":false,"name":"clock","identifier":"module_1_clock","position":"top_left"},],},}
}]
},
config for remote section (same file config.js)
{
module: 'MMM-Remote-Control',
position: "bottom_bar"
// uncomment the following line to show the URL of the remote control on the mirror
// , position: 'bottom_left'
// you can hide this module afterwards from the remote control itself
},
Any advice would be appreciated.
Thanks.
Grant
:::
Spoiler Text
:::