• 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
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

PIR-Sensor - put your mirror to sleep if not used

Scheduled Pinned Locked Moved System
utilitygpiomotion-sensorpower-saving
56 Posts 32 Posters 97.9k Views 47 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.
  • I Offline
    IngmarSwart @DirkS
    last edited by IngmarSwart Aug 11, 2016, 1:45 PM Aug 11, 2016, 1:42 PM

    Hi @DirkS,

    I use a standard first generation RPi camera board. In other words, this solution works perfectly fine with IR filter on the camera.

    The reason I think there might be issues with the RPi2: you should realize that this solution requires the RPi to analyze 10 images per second (give or take a few, you can specify the frame rate) using OpenCV routines. This causes a significant bump in processor load (approximately 33% on the RPi3 on top of everything else, if I’m not mistaken). I simply don’t know if the processor of the RPi2 is fast enough to do the image analysis, run the MM and the operating system simultaneously. The only way to know for sure is to test. I can’t help you with that as I don’t own a RPi2. Should the RPi2 struggle, perhaps you can get away with analyzing fewer frames (5 or maybe even 2). I encourage you to try and report back!

    Best wishes,
    Ingmar

    1 Reply Last reply Reply Quote 0
    • S Offline
      samydp
      last edited by Sep 18, 2016, 7:30 PM

      Hello,
      my module is not working, I have the pir sensor connected to Pin 7 and when you start the screen stays white and nothing happens when I take the pir of the config it goes again.

      Z 1 Reply Last reply Sep 19, 2016, 1:37 PM Reply Quote 0
      • Z Offline
        zam @samydp
        last edited by Sep 19, 2016, 1:37 PM

        @samydp Maybe you can find the answer here :After rebooting, run MM with pm2 and shows “White Screen”, I checked the pm2 error log shows something like “Expected 49, got 48” as before,
        Run “npm rebuild --runtime=electron --target=1.3.4 --disturl=https://atom.io/download/atom-shell --abi=49” in the MMM-PIR-Sensor folder,
        Run “pm2 restart mm” and it works.”

        1 Reply Last reply Reply Quote 0
        • S Offline
          samydp
          last edited by Sep 19, 2016, 6:31 PM

          it is not’ve tried as it stands anyway thanks for your help

          1 Reply Last reply Reply Quote 0
          • D Offline
            Defibrillat0r @IngmarSwart
            last edited by Oct 20, 2016, 2:20 PM

            @IngmarSwart Thats a really nice solution. Did you use the virtual environment from the tutorials? If you did so, how did you wrap them together? Is it even possible? Thanks

            1 Reply Last reply Reply Quote 0
            • B Offline
              bibi
              last edited by Oct 27, 2016, 6:05 PM

              Since IngmarSwart didn’t connect since few months, maybe someone can just explain me the reason why a PIR sensor is still needed in his config? i don’t get the role of the PIR since there is already a cam to detect the move…? if anyone… thx guys!

              1 Reply Last reply Reply Quote 0
              • I Offline
                IngmarSwart
                last edited by Oct 27, 2016, 7:51 PM

                @Defibrillat0r: Thanks. Yes, I use the virtual environment. That being said, I don’t think it is stricktly necessary. In our configuration, the RPi is dedicated to running the MM, so the likelyhood that you need different versions of packages is very small. If you do use the virtual environment, you just have to make sure all the packages listed at the top of the python file are installed for the virtual environment you are working on. Other than that, no special tricks are needed.

                @bibi: In my solution a PIR sensor is not needed. You only use @paviro’s module to interface the python code with the MM.

                B 1 Reply Last reply Oct 27, 2016, 7:57 PM Reply Quote 0
                • B Offline
                  bibi @IngmarSwart
                  last edited by Oct 27, 2016, 7:57 PM

                  @IngmarSwart ohh ok now it’s clear! thx alot for your reply.
                  your hack is working perfectly so far?

                  1 Reply Last reply Reply Quote 0
                  • I Offline
                    IngmarSwart
                    last edited by Oct 27, 2016, 8:11 PM

                    @bibi: I’ve only tested my solution for a couple of days, so I can’t say much about the long term stability. The reason for this is simply that I was in the process of designing a (nearly) frameless mirror the last couple of months. The components have been ordered and I hope to assemble everything in the coming month. It might take a bit longer, as I have quite a few business trips lined up for November.

                    B 1 Reply Last reply Oct 27, 2016, 8:15 PM Reply Quote 0
                    • B Offline
                      bibi @IngmarSwart
                      last edited by Oct 27, 2016, 8:15 PM

                      @IngmarSwart I see i am still getting everything but in meantime i am working on the software side. You solution is nice and i will try to implement it i think… with my noob skills :)))

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 6
                      • 2 / 6
                      • 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