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

Posts

Recent Best Controversial
  • RE: Motion Detector

    Yes, that was what I tried to say in my first post yesterday.
    I had the same problem.
    Old monitors do not turn off by themselve if there is no signal. Newer monitor do turn off, and all is fine.

    My solution was tu use a relais to turn on/off the current of the monitor. Therefore I used a pin of the GPIOs to control the relais.

    For controlling this GPIO pin I used the wiringpi library

    I had to add some lines in the node_helper.js - please look at the lines with: exec("gpio -g …

    pi@magicmirror:~/MagicMirror/modules/motiondetector $ more node_helper.js

    'use strict';
    
    /* Magic Mirror
     * Module: MMM-PIR-Sensor
     *
     * By Paul-Vincent Roll http://paulvincentroll.com
     * MIT Licensed.
     */
    
    const NodeHelper = require('node_helper');
    const exec = require('child_process').exec;
    var moment = require('moment');
    
    module.exports = NodeHelper.create(
    {
      start: function ()
      {
            //this.started = false;
            exec("gpio -g write 4 1", null);
            console.log('motiondetector started ...');
            console.log('monitor relais on');
      },
      activateMonitor: function ()
      {
            exec("gpio -g write 4 1", null);
            console.log(moment().format() + ' monitor relais on');
            //this.started = false;
      },
      deactivateMonitor: function ()
      {
            exec("gpio -g write 4 0", null);
            console.log(moment().format() + ' monitor relais off');
            //this.started = false;
      },
      socketNotificationReceived: function (notification)
      {
          //const self = this;
          if (notification === 'MOTION_DETECTED')
          {
              //const self = this;
              //this.started = true;
              this.activateMonitor();
          }
          if (notification === 'DEACTIVATE_MONITOR')
          {
              //const self = this;
              //this.started = true;
              this.deactivateMonitor();
          }
      }
    } );
    
    posted in Utilities
    D
    danielis
    May 24, 2017, 3:36 PM
  • RE: Motion Detector

    OK
    But if there is a movement detected - is then the mirror shown?

    Why do you expect to see the mirror after the timeout?

    The mirror must be on if there is a movement. And if there is no movement and the timeout is over, then is the mirror off.
    That is what you want and what this module is doing.

    I think your problem is that as soon as the mirror is off, your monitor should turn off - right?

    posted in Utilities
    D
    danielis
    May 23, 2017, 6:44 PM
  • RE: Motion Detector

    Never monitors turn off by themselve as soon as there is no signal or after a few minutes without signal. Mine was a old that did not turn on/off automatically.
    I used wiringpi to activate a relais that turns the current of the monitor on and off.

    posted in Utilities
    D
    danielis
    May 23, 2017, 6:33 PM
  • RE: Motion Detector

    @oscarkindberg it is the file config.txt in the folder /boot/
    type ‘sudo nano /boot/config.txt’ without ’
    add as last line:
    hdmi_blanking=1

    posted in Utilities
    D
    danielis
    Jan 9, 2017, 8:38 PM
  • RE: Motion Detector

    @phoenixrising look at the last reply of in_a_days.
    If that is not working post your config.js here.

    posted in Utilities
    D
    danielis
    Jan 9, 2017, 9:51 AM
  • RE: Motion Detector

    @oscarkindberg try hdmi_blanking=1in /boot/config.txt

    posted in Utilities
    D
    danielis
    Jan 9, 2017, 5:28 AM
  • RE: Motion Detector

    Not working here. Only either one or the other.
    But paviro said he will include a motion detection to the facial recognition module at some time.
    I will try to do it also. Will report if I have success

    posted in Utilities
    D
    danielis
    Jan 8, 2017, 6:02 PM
  • RE: Motion Detector

    I had the same issue.
    For me was the solution to increase the capture interval time from 100ms to 1000ms.
    With the default value of 100ms the overall systemload is to high and one of the two electron processes will use after some time around 85% of the memory. At that value the system slows down extremely and the memory swap process will take all cpu ressources while trying to free up physical memory.
    And then anything can happen … (white screen, unresponsive, ENOMEM exceptions, …)

    Go to motiondetector.js and search for this code part:

    DiffCamEngine.init(
    {
    video: video,
    motionCanvas: canvas,

    Add the following line to change the default capture interval time of 100ms to 1000ms:

    DiffCamEngine.init(
    {
    video: video,
    captureIntervalTime: 1000,
    motionCanvas: canvas,

    Observe the two electron processes and they will not reach memory values higher than 30%.

    posted in Utilities
    D
    danielis
    Jan 7, 2017, 8:52 PM
  • 1 / 1
Enjoying MagicMirror? Please consider a donation!
MagicMirror created by Michael Teeuw.
Forum managed by Sam, technical setup by Karsten.
This forum is using NodeBB as its core | Contributors
Contact | Privacy Policy