@sispheor well, as a new MM user, obvious is not so…
Read the statement by Michael Teeuw here.
Posts
-
RE: Kalliope assistant + MM
-
RE: Kalliope assistant + MM
i have 5 lines of console.log on my MMM-kalliope.js
-
RE: Kalliope assistant + MM
@dmwilsonkc edit the MM/modules/MMM-kalliope/MMM-kalliope.js and change all console. to Log.
console.log is ONLY allowed in the node_helper.js and Log.log is ONLY allowed in the module.js
-
RE: Kalliope assistant + MM
@sispheor trying to help, I installed the module on my mirror… but… curl notifications don’t work…
is there an install step missing? or a package.json that defines the install process for the dependencies?
cut paste from the module readme…
~/MagicMirror/modules$ curl -H "Content-Type: application/json" -X POST -d '{"notification":"KALLIOPE", "payload": "my message"}' http://localhost:8080/kalliope curl: (7) Failed to connect to localhost port 8080: Connection refused
netstat shows nothing listening on 8080
so, my mirror is NOT on 8080, but 8086, due to other components on the normal MM ports…
you should update the instructions to say use the MM port on the curl…
now… I got the notification, and see the debug log (ctrl-shft-i) say
MMM-kalliope received a socket notification: KALLIOPE Payload: my message
and the content shows for the configured amount of time (8 seconds per the above config settings)
-
RE: When to turn mirror on and off?
fun challenge… sorta need two sensors… one outside to detect coming in, and one inside to detect going out… that one inside needs a fast response time, as u need the info up long enough to be useful…
I have my mirror using motion and wake up all the time on any motion… but have it on short sleep time (2 mins), so it goes to sleep fast… pi/sbc is still running, so at most you are saving a small amount of power for the monitor.
-
RE: [NEWBIE] Change In Clock Module Is giving error in config file
@postremalone ok, so you got rid of the config.js error, and the mirror is working, except for weather?
looking at the config.js screen shot there is no locationID value (last line) … got to have one
-
RE: blank screen?
@zdenek sounds like something else (some other application or process) is listening on port 8080
-
RE: run Linux command from a mm2 module
the two parts of a module talk to each other thru socket notification events…
the node_helper can interact with the system ,but not the dom, and the module (js) interacts with the dom and not the system…
the two sides would use the sendSocketNotification(event_id, buffer) method…
each would have a method called socketNotificationReceived(event_id, buffer) that will be called when the event arrives…
the buffer can be any kind of data. formatted or not.
to open the socket the first time, the module.js MUST be the first side to sendSocketNotification().
typically the module sends the config info to the node_helper when its starts up.
this is another event notification, which is called notificationReceived(event, buffer, sender)
there are a a few builtin events, I use the ‘ALL_MODULES_STARTED’ event to send my module config to my helper and open the socket.
see the doc here for the additional specifics
https://github.com/MichMich/MagicMirror/tree/master/modulesthe event id strings for socketnotification are completely up to you… the MM system does not send socket notifications. it DOES send notifications (notice no ‘socket’) to the notificationReceived() method
but summary
-
create both files (per the doc)
-
when module receives the ‘ALL_MODULES_STARTED’ event, send a socket notification from the module to the helper to open the communications channel
-
when the node_helper gets new data, it sends a socket notification (will ONLY be to the module(js)) with the data
-
the module(js) uses the data to update the dom
-
if the module(js) decides when there should be new data, then the module sends a socket notification to the helper, and the helper responds with a socket notification with the new data (if any).
-
-
RE: [NEWBIE] Change In Clock Module Is giving error in config file
you can also use https://www.jslint.com/
to check the syntax of the config file…copy/paste it in and at the bottom check boxes for
long lines
single quotes
whitepsace messthe press jslint
u may have to remove the last ‘,’ (comma), before
]
-
RE: [NEWBIE] Change In Clock Module Is giving error in config file
@postremalone said in [NEWBIE] Change In Clock Module Is giving error in config file:
{
module: “clock”,
position: “top_left”,
config: {
timezone: ‘Etc/GMT+5.30’
}
}is that the LAST module in the list, or ???
maybe u need a comma after the last
}
also, watch out on single quotes… sometimes you get the MS WORD format of the quote, which is NOT the right one…
change those to double quotes