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.

    [MMM-Motion-Detection] Motion Detection through PiCam or USB Webcam

    Scheduled Pinned Locked Moved Utilities
    12 Posts 9 Posters 14.6k Views 10 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.
    • J Offline
      jasonarends
      last edited by

      Yes, this works:

      raspistill -o cam.jpg
      
      

      I see the preview on the monitor and the file gets saved.

      I added some additional debugging to the python code in this module and it is giving me a Null back when it does the .read() instead of an array. I’m not sure what’s different unless it has to do with the python-shell not working right or something in the picam.py code with the buffers.

      If I manually call the function in Python in the same way this code does, and it gives me back an array and works fine:

      pi@pi-3-mm:~/MagicMirror/modules/MMM-Motion-Detection/motiondetection $ python
      Python 2.7.13 (default, Jan 19 2017, 14:48:08)
      [GCC 6.3.0 20170124] on linux2
      Type "help", "copyright", "credits" or "license" for more information.
      >>> import picam
      >>> cam = picam.OpenCVCapture()
      >>> cam.start()
      >>> cam.read()
      array([[[ 24,  31,  58],
              [ 22,  29,  56],
              [ 21,  28,  55],
              ...,
              [ 12,  15,  23],
              [ 12,  15,  23],
              [ 12,  15,  23]],
      
             [[ 22,  29,  56],
              [ 23,  30,  57],
              [ 21,  28,  55],
              ...,
              [ 13,  16,  24],
              [ 12,  15,  23],
              [ 12,  15,  23]],
      
             [[ 23,  30,  57],
              [ 24,  31,  58],
              [ 21,  28,  55],
              ...,
              [ 14,  16,  24],
              [ 13,  16,  24],
              [ 12,  15,  23]],
      
             ...,
             [[131, 145, 173],
              [129, 143, 171],
              [128, 142, 170],
              ...,
              [ 25,  31,  72],
              [ 21,  27,  68],
              [ 27,  33,  74]],
      
             [[129, 143, 171],
              [129, 143, 171],
              [129, 143, 171],
              ...,
              [ 28,  34,  75],
              [ 23,  31,  71],
              [ 24,  32,  72]],
      
             [[129, 143, 171],
              [130, 144, 172],
              [130, 144, 172],
              ...,
              [ 31,  37,  78],
              [ 25,  33,  73],
              [ 21,  29,  69]]], dtype=uint8)
      
      
      D 1 Reply Last reply Reply Quote 0
      • D Offline
        dmcinnes Module Developer @jasonarends
        last edited by

        @jasonarends try to use the default interval of 1, there may be some initialization issues with larger intervals.

        1 Reply Last reply Reply Quote 0
        • G Offline
          gismo2006
          last edited by gismo2006

          Hi,

          I use your module. Thank you for building this.
          But I have some tipps, that i will write down. Maybe the will help others.

          At first after install your module, it power off my monitor, but didn´t power on after that. I see only a black page. So after i changed the order to activate and deactivete from “tvservice” to “vcgencmd display power 1” my monitor power of but didn´t power on again, but now it was really off. After that I delete at the node-helper.js some lines, that will test if the monitor was active.

          Thats it, now everythings works fine.

          BUt is it possible that your module don´t work together with Paviro’s MMM-Facial-Recognition module?? I use it and have several users. But now the detection of faces didn´t work.

          Maybe you can help me.

          Greets gismo

          D 1 Reply Last reply Reply Quote 0
          • D Offline
            dmcinnes Module Developer @gismo2006
            last edited by

            @gismo2006 unfortunately since the module was forked from the facial recognition one and uses the same underlying library for camera control, you will not be able to use both at the same time.

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

              Hi,

              im trying to get it running, but for any reason it does not work for me.
              I checked the functionallity of the Picam with a test shot and it works fine.
              The command vcgencmd display_power 0/1 works here pretty smoth so i changed it also in node_helper.js , but it still does not turn off/on.

              any ideas?
              thanks in advance.

              1 Reply Last reply Reply Quote 0
              • RandyBonnetteR Offline
                RandyBonnette
                last edited by RandyBonnette

                Hello,

                I’m trying to complete the setup, but I’m facing this error: ValueError: need more than 3 values to unpack. I have a Logitech 1080 HD USB Webcam and Raspberry Pi 3. How can I fix this? I checked the topics here on forum, but there’s no solution so far.

                Raspberry Pi face recognition project steps by Jasper Zuyderwijk guide to write my paper for me

                1 Reply Last reply Reply Quote 0
                • M Offline
                  mlangenberg
                  last edited by

                  I have had Genius WebCam 480p, old one, but i really loved it. For streams it wasn’t good, that’s why I changed it and now i can stream my playing online slots.io

                  1 Reply Last reply Reply Quote 0
                  • B Offline
                    BigBadJohnnyB
                    last edited by

                    @RandyBonnette I’m getting that same error on quite a few addon modules. It’s driving me crazy - lots of people reporting the issue, but can’t seem to find a fix.

                    S 1 Reply Last reply Reply Quote 0
                    • S Offline
                      sdetweil @BigBadJohnnyB
                      last edited by sdetweil

                      @BigBadJohnnyB i posted the fix here

                      https://forum.magicmirror.builders/topic/11842/valueerror-needs-more-than-3-values-to-unpack-anyone-ever-address-this

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 1
                      • 1
                      • 2
                      • 1 / 2
                      • 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