MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Motion Detector

    Scheduled Pinned Locked Moved Utilities
    213 Posts 38 Posters 526.0k Views 39 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • in_a_daysI Offline
      in_a_days
      last edited by

      Well… so much for that theory lol. I just got the ENOMEM error from Motion Detector.

      0_1483816079700_error.jpg

      What ship would bear me ever back across so wide a Sea?

      1 Reply Last reply Reply Quote 0
      • D Offline
        danielis
        last edited by

        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%.

        J T in_a_daysI 3 Replies Last reply Reply Quote 2
        • J Offline
          jdahli1 @danielis
          last edited by

          @danielis Fingers crossed, this appears to be working! The mirror has turned on and off a dozen times now with no processor or RAM issues.

          1 Reply Last reply Reply Quote 0
          • T Offline
            trividar @danielis
            last edited by

            @danielis woooow its working now since one hour!! thank you!!!

            1 Reply Last reply Reply Quote 1
            • in_a_daysI Offline
              in_a_days @danielis
              last edited by

              Same here. Great work and many thanks @danielis!

              What ship would bear me ever back across so wide a Sea?

              1 Reply Last reply Reply Quote 0
              • slametpsS Offline
                slametps
                last edited by

                Is this module work along with MMM-Facial-Recognition using the same camera?

                regards,

                Slamet PS

                1 Reply Last reply Reply Quote 0
                • D Offline
                  danielis
                  last edited by

                  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

                  1 Reply Last reply Reply Quote 0
                  • O Offline
                    oscarkindberg
                    last edited by

                    Hi!

                    I’m trying to get this to work, have a USB cam attached to the RPI3 and installed the .js.
                    But when I add the code:

                    {
                    module: ’motiondetector’,
                    config:
                    }
                    }

                    Am I missing something? Because it only give me errors… :(

                    (new to this)

                    in_a_daysI 1 Reply Last reply Reply Quote 0
                    • in_a_daysI Offline
                      in_a_days @oscarkindberg
                      last edited by

                      @oscarkindberg Try this instead:

                                  {
                                          module: 'motiondetector',
                                          config: {
                                                  timeout: 300000 // time in milliseconds for to switch off the display after last movement is detected.
                                          }
                                  },
                      

                      This is set for a 5 minute delay. Modify the timeout value if you want a longer or shorter delay before your screen turns off.

                      What ship would bear me ever back across so wide a Sea?

                      O 1 Reply Last reply Reply Quote 0
                      • O Offline
                        oscarkindberg @in_a_days
                        last edited by

                        @in_a_days Hit! Works now, BUT next issue.
                        After 5-6 min the screens goes white, can’t find anything in the code that would cause that.

                        D 1 Reply Last reply Reply Quote 0
                        • P Offline
                          phoenixrising
                          last edited by

                          I apologize if this a very noob question but I am having trouble getting the motion detector module running. I have clone the files to the module folder. I have modified the config file but maybe I dont have it correct. Could some one show me how the config file be modified to get the module running. Any other pointers? Thank you,

                          D 1 Reply Last reply Reply Quote 0
                          • D Offline
                            danielis @oscarkindberg
                            last edited by

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

                            O 1 Reply Last reply Reply Quote 0
                            • D Offline
                              danielis @phoenixrising
                              last edited by

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

                              1 Reply Last reply Reply Quote 0
                              • O Offline
                                oscarkindberg @danielis
                                last edited by

                                @danielis Where do I fint that? I’ve searched all the .js files in the module and config.

                                D 1 Reply Last reply Reply Quote 0
                                • D Offline
                                  danielis @oscarkindberg
                                  last edited by

                                  @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

                                  O 1 Reply Last reply Reply Quote 0
                                  • O Offline
                                    oscarkindberg @danielis
                                    last edited by

                                    @danielis Actually got it to work now, changed to “updateInterval: 10000” from “updateInterval: 1000” and in diff-cam-engine.js I changed captureIntervalTime to 1000 instead of 100.

                                    Made it easier on the RBP3 i think.
                                    Downloaded MMM-SystemStats to keep check on sysload during config and it’s lookin’ good now.
                                    Thanks for the help! I’ll comeback with a picture of the mirror as soon as my mirrorglas arrives.

                                    P 1 Reply Last reply Reply Quote 0
                                    • P Offline
                                      phoenixrising @oscarkindberg
                                      last edited by

                                      @oscarkindberg where is the updateinterval located?

                                      O 1 Reply Last reply Reply Quote 0
                                      • O Offline
                                        oscarkindberg @phoenixrising
                                        last edited by

                                        @phoenixrising Sorry! I meant timeout: 10000 in config.js file. Copy pasted wrong part

                                        1 Reply Last reply Reply Quote 0
                                        • J Offline
                                          Jhonte
                                          last edited by Jhonte

                                          @alexyak I’m using raspberry pi 3 with the camera module. And the motiondetection module.

                                          Could not initiate the module before I ran sudo modprobe bcm2835-v4l2 but even after I never get any motion “score”.

                                          I inspected the diffImageData it all contained 0,0,0,255 in series…

                                          The camera works when using raspistill. Any hints of what I can test to debug the camera output within electro?

                                          P 1 Reply Last reply Reply Quote 0
                                          • P Offline
                                            phoenixrising @Jhonte
                                            last edited by

                                            @Jhonte , post your config file.

                                            J 1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 6
                                            • 7
                                            • 8
                                            • 9
                                            • 10
                                            • 11
                                            • 8 / 11
                                            • First post
                                              Last post
                                            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