@lilpkstud said in Creating Module with API Key/Secret:
JSON.stringify()
correct… u converted the object to a string… don’t need to do that
just pass the object from helper up to module …
then it will use the this.data.name
@lilpkstud said in Creating Module with API Key/Secret:
JSON.stringify()
correct… u converted the object to a string… don’t need to do that
just pass the object from helper up to module …
then it will use the this.data.name
@JohnBachini what a pain
try this
cd ~/MagicMirror/modules/MMM-synology-ds/node_modules/mmmagic
# force rebuild to the version of node electron is running
~/MagicMirror/node_modules/.bin/electron-rebuild
try again
@nrayever see my sample module,
https://github.com/sdetweil/SampleModule
and follow the module developers doc
@mrlowndes when the sd card starts to fail, it is toast
@Schmaniel welcome to the fun. 900,000 details to consider. size color, font … css
@VesaLa59 the newer versions of chrome have added support for some protected environment (sandbox), but its very restrictive
run the fixsandbox script from here
https://github.com/sdetweil/MagicMirror_scripts
bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/fixsandbox)"
@bravooscar
in node_helper.js
var NodeHelper = require("node_helper");
const fs = require('fs')
const path = require('path')
// add require of other javascripot components here
// var xxx = require('yyy') here
module.exports = NodeHelper.create({
// handle messages from our module// each notification indicates a different messages
// payload is a data structure that is different per message.. up to you to design this
socketNotificationReceived(notification, payload) {
console.log(this.name + " received a socket notification: " + notification + " - Payload: " + payload);
// if config message from module
if (notification === "CONFIG") {
// save payload config info
this.config=payload
let p = path.resolve('.','modules',this.name,this.config.filename)
console.log("file="+p)
fs.readFile(p, (error,filedata)=> {
console.log("filedata="+filedata)
let data =JSON.parse(filedata)
this.sendSocketNotification('filedata', data)
})
}
},
});
@blake_northrup because u installed on windows, there are a couple extra steps
cd MagicMirror
cd vendor
npm install
cd …\fonts. 2dots
npm install
cd … 2dot
the npm start
this phone editor will not let me enter 2 dots, displays as 3
@Schmaniel ctrl-r to reload the screen