I’m sure I’m missing something really obvious here… but I can’t see what it is. The contents of MMM-HiWorld
print out just fine but the console logging in node_helper.js
never happens. As I understand it (from reading some other forum posts) I need to initialize node_helper.js
via a call in start: function()
?
MMM-HiWorld.js:
$ cat MMM-HiWorld.js
Module.register("MMM-HiWorld",{
// Default module config.
// Default module config.
defaults: {
text: "Hi World!",
animationSpeed: 1000,
},
start: function() {
this.sendSocketNotification('Starting');
var self = this;
setInterval(function() {
self.updateDom(); // no speed defined, so it updates instantly.
}, 1000); //perform every 1000 milliseconds.
},
// Override dom generator.
getDom: function() {
var wrapper = document.createElement("div");
wrapper.innerHTML = this.config.text;
return wrapper;
},
});
node_helper.js:
$ cat node_helper.js
var NodeHelper = require('node_helper');
module.exports = NodeHelper.create({
start: function() {
console.log('Starting node_helper');
},
socketNotificationReceived: function(notification, payload) {
console.log('Okay, I got a notification.');
},
});
This is Raspbian Jessie (Raspberry Pi 2) and node v6.9.2.
Thanks!