MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. justonemore
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    J
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 3
    • Groups 0

    justonemore

    @justonemore

    0
    Reputation
    1
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    justonemore Unfollow Follow

    Latest posts made by justonemore

    • MM and Apache

      I have one Raspberry Pi running MagicMirror (for last 2 years) and another Pi running Apache from where I can access some of my own files for my own purpose from anywhere in the world…Is there a way to use Apache on the Pi with Magic Mirror ? Or does Magic Mirror allow me to do what Apache does somehow ? Where are the config files for the web server that runs Magic Mirror ?

      Thank you.

      posted in General Discussion
      J
      justonemore
    • RE: SleepWake twisted....need help

      @sdetweil Thank you…

      posted in Troubleshooting
      J
      justonemore
    • SleepWake twisted....need help

      I am trying to use MMM-SleepWake module from sdetweil (real good by the way) to communicate with my own module but can’t figure out what is wrong…everytime MMM-SleepWake wakes, it runs a python program through a function I created in the MMM-SleepWake node_helper file…It runs fine when I uncomment the console.log and comment the sendNotification lines so I know it is working. What I don’t get is how to send the data to my own module…I tried self.sendNotification, this.sendNotification and sendNotification but all of them return an error the function is not defined…how to I send “data” to my MMM-Facez module ?

      Python function included in node_helper from MMM-SleepWake.

      start_python: function() {
          let self = this;
          var py_recog = spawn('python3', ['-u', '/home/pi/MagicMirror/modules/MMM-Facez/recognize.py']);
      
          py_recog.stdout.on('data', function (data) {
      //      console.log(data.toString());
            sendNotification("ATUALIZA_FACEZ", data);
          });
      
          py_recog.stderr.on('data', function(data) {
            console.log('Python returned Error: ', data.toString()); });
      
          py_recog.on('exit', function (code, signal) {
            console.log('Python exited with ' +
                    `code ${code} and signal ${signal}`); });
      
          },		
      

      Error I get :

      [20.05.2021 18:33.47.306] [ERROR] ReferenceError: sendNotification is not defined
          at Socket.<anonymous> (/home/pi/MagicMirror/modules/MMM-SleepWake/node_helper.js:23:7)
          at Socket.emit (events.js:315:20)
          at addChunk (_stream_readable.js:295:12)
          at readableAddChunk (_stream_readable.js:271:9)
          at Socket.Readable.push (_stream_readable.js:212:10)
          at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)
      
      

      my MMM-Facez.js module

      notificationReceived: function(notification, payload, sender) {
        switch(notification) {
          case "ATUALIZA_FACEZ":
            var elem = document.getElementById("TITULO")
            this.nomepessoa = payload
            elem.innerHTML = this.nomepessoa
            break
        }
      },
      
      socketNotificationReceived: function(notification, payload) {
        switch(notification) {
          case "ATUALIZA_FACEZ":
            var elem = document.getElementById("TITULO")
            this.nomepessoa = payload
            elem.innerHTML = this.nomepessoa
            break
        }
      
      posted in Troubleshooting
      J
      justonemore