@nhpunch sorry, i don’t understand
Read the statement by Michael Teeuw here.
Posts
-
RE: How to use the 'node_helper', 'serialport'
-
RE: Total Beginner - MM2 with MacMini
@trividar there is a module that uses camera,
https://github.com/dmcinnes/MMM-Motion-DetectionI also have one, that allows configurable ways to sleep… pi, hdmi off, or blanking screen
https://github.com/sdetweil/MMM-SleepWakemine depends on the github motion project for camera interface
https://motion-project.github.io/I have not tried mine on mac. but motion project is supported on mac.
-
RE: How to use the 'node_helper', 'serialport'
@nhpunch there are two parts of a MagicMirror module
- node_helper, runs on server, can use require(…some other library…)
- module_name.js, runs in browser, manages data presented on screen, cannot use require(…)
so, the two parts can talk to each other by sending socket messages, using the supplied function
sendSocketNotification(some_id_string, some_data_packet)the receiver of the message gets called at the function socketNotificationReceived(some_id_string, some_data_packet)
get my sample module that has both parts, and uses timer,
https://github.com/sdetweil/SampleModulealso see the developers doc here
https://github.com/MichMich/MagicMirror/tree/master/modulesmy sample implements all the functions so you can see them…
not all are needed… so u can comment out the ones u don’t need to useconfig for my sample, to add to config.js is
{ module: "SampleModule", position: "center", config: { message: "this is a test from config entry" } }, -
RE: How to use the 'node_helper', 'serialport'
@nhpunch u cannot talk to hardware in module, you do that in node_helper.
if you split the mirror into two parts server and client… node_helper runs on the server,
module runs in the client browser…(even in the same machine)here is a package u can install to enable code to talk to serial port in node helper
https://www.npmjs.com/package/serialportbutton would be in the module. you can use an html button, or more advanced div and span
then when u get the button action in the module, you sendSocketNotification() a message to the node_helper… then node_helper then talks serial port to your arduino. -
RE: MMM-Calendar not showing calendar
@castletonroad I’m not sure this will help, but the local mirror web server is not on port 80, but typically on 8080 (port setting in config.js)
so, your url should be
url: "http://127.0.0.1:8080/modules/calendars/basic.ics"and the mirror web server base directory is the modules folder… so your file would need to be located in that directory tree somewhere
I downloaded my calendar, and it works fine locally
url: "http://localhost:8086/modules/cals/basic.ics"my mirror is running on port 8086.
-
RE: Profile Switcher - RC522 RFID
@richland007 I think the node helper strips the trailing spaces. I don’t know if the tag needs all 16 digits
If there ARE trailing spaces, then it won’t match the config entries
-
RE: Profile Switcher - RC522 RFID
@richland007 said in Profile Switcher - RC522 RFID:
no ideas really… the node_helper code sends two different notices up to the module,
which forwards them on…I don’t see any debug info in the module, so edit the MMM-RFID.js file
and change it like this
if (notification === "RFID_UID") { Log.log(" UID received="+payload); this.sendNotification("RFID_UID", payload); }and
if (notification === "RFID_DATA") { Log.log(" DATA received="+payload); this.sendNotification("RFID_DATA", payload); this.dispatchEvents(payload.data) }it looks like the converter should work… u did WRITE those decimal values to the tags, right?
I see he has a test reader tool
sudo python modules/MMM-RFID/MFRC522-python/Read.py -
RE: Profile Switcher - RC522 RFID
@richland007 open the developers console, either by
npm start dev
when you start the mirror
or ctrl-shift-i
when then mirror is running
then select the console tab
these tools send notifications from one module to another…
so you should see those messages in the consoleyou can also filter the messages by the name of the file so
put rfid in the filter field to see only messages sent from the rfid module -
RE: MM ClientOnly + Docker as a server on the same machine
@Serge npm start, starts the full system, and node clientonly starts the client
But u have a server already using docker so, only do node clientonly