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 Troubleshooting
    126 Posts 37 Posters 235.5k Views 20 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
      incubik
      last edited by

      I’ve tried to check the web inspector but when the screen is white… problems ahead —> The web inspector doesn’t pop up.

      I’ve tried this without installing the PIR Sensor module and the web inspector works but again when the screen is in “white mode” doesn’t.

      Any thoughts?

      paviroP 1 Reply Last reply Reply Quote 0
      • paviroP Offline
        paviro @incubik
        last edited by

        @incubik try the serveronly mode (see the wiki) :)

        We're all stories in the end. Just make it a good one, eh?

        – The Doctor

        1 Reply Last reply Reply Quote 0
        • IngmarSwartI Offline
          IngmarSwart
          last edited by paviro

          First of all: @paviro, many thanks for this module.

          I ran into some troubles with the module and thought I should share this (and my solution) here.
          Problem:
          Without the PIR module, everything worked as it should. After installing the PIR module, everything appeared fine and the (HDMI) monitor switched off after a given amount of time (set via a variable resistance on the sensor itself). Upon motion detection by the PIR, the monitor switched back on but didn’t display anything (I could tell the monitor was on from the backlight). Remote access via ssh was not affected.
          In the end, I figured out that this was due to an incorrect setting of the virtual terminal. Typing ‘sudo chvt 9 && sudo chvt 7’ on the remote terminal brought the image back to the monitor connected to the RasPi. After stopping the mirror, modifying the ‘activateMonitor’ function in ‘node_helper.js’ as below, and restarting the mirror, the problem was solved. I hpe this is helpful to others.

          Modified section of ‘node_helper.js’:

          activateMonitor: function () {
              if (this.config.relayPIN != false) {
                gpio.digitalWrite(this.config.relayPIN, this.config.relayOnState)
              }
              else if (this.config.relayPIN == false){
                exec("/opt/vc/bin/tvservice -p", null);
                exec("/usr/bin/sudo /bin/chvt 9 && /usr/bin/sudo /bin/chvt 7 ", null);
              }
          

          PS: There may be more elegant solutions to this, but I my node.js skills are, shall we say, limited?

          paviroP 1 Reply Last reply Reply Quote 0
          • paviroP Offline
            paviro @IngmarSwart
            last edited by paviro

            @IngmarSwart could you explain what setting this changes? And may open a pull request? Is this only possible with sudo?

            Please also note: Use Markdown on code snippets so it is easier to read!

            We're all stories in the end. Just make it a good one, eh?

            – The Doctor

            1 Reply Last reply Reply Quote 0
            • IngmarSwartI Offline
              IngmarSwart
              last edited by

              @paviro, if I understoof the documentation correctly, the command chvt simply changes the foreground terminal. It appears that in my case the the output of the RasPi is send to another terminal than that is displayed on the monitor.

              My apologies for not using the markdown code. I only recently started using GitHub etc, so I have some learning to do when it comes to opening pull requests.

              I just tested to confirm if the use of sudo is required. Unfortunately, it is.

              paviroP 1 Reply Last reply Reply Quote 0
              • paviroP Offline
                paviro @IngmarSwart
                last edited by

                @IngmarSwart Strange that you have this issue, since I do not. I only have the problem when the monitor is disabled via a relay while the Pi boots.
                Could you do some more research on why this is happening and maybe find a way to fix it without root rights?

                We're all stories in the end. Just make it a good one, eh?

                – The Doctor

                IngmarSwartI 1 Reply Last reply Reply Quote 0
                • IngmarSwartI Offline
                  IngmarSwart
                  last edited by

                  @paviro, I also don’t understand where it comes from, especially since the MagicMirror appears as it should immediately after boot. At first glance, the monitor (Philips 273V5L) and Pi seem to play nice: EDID information is correct, tvservice -s gives the native resolution and refresh rate of the monitor. If I can find some time, I will look into it. However, I am also quite earger to start playing with your Facial-Recognition module… :relaxed:

                  1 Reply Last reply Reply Quote 0
                  • KirAsh4K Offline
                    KirAsh4 Moderator
                    last edited by

                    This is more of a PSA than anything else, but particularly since the tvservice is part of the rPi’s firmware. While running 'sudo apt-get update && sudo apt-get upgrade' will upgrade your rPi’s packages and firmware, it may not be the latest version. For most, this is okay. But if you’re like me, who likes to live on the bleeding edge of things, particularly when something isn’t working right, running 'sudo rpi-update' separately will update the firmware only, including binaries such as 'tvservice' since they’re part of the firmware, not just a standard package (in fact, you can’t find it as a stand alone package through 'apt-cache'.)

                    Use at your own risk. :)

                    A Life? Cool! Where can I download one of those from?

                    1 Reply Last reply Reply Quote 0
                    • W Offline
                      witschi87
                      last edited by

                      I’m getting the following error:

                      start-magic-0 (err): WARNING! Could not find config. Please create one.
                      start-magic-0 (err): App threw an error when running [Error: Module version mismatch. Expected 47, got 48.]
                      start-magic-0 (err): [Error: Module version mismatch. Expected 47, got 48.]
                      

                      I’ve just cloned the git repository and installed the dependencies.
                      And that is my config:

                      {
                      	module: 'MMM-PIR-Sensor',
                      	config: {
                      		sensorPIN: 22,
                      		powerSaving: true
                      	}
                      },
                      
                      1 Reply Last reply Reply Quote 0
                      • paviroP Offline
                        paviro
                        last edited by

                        Please use Node v5 not v6 one of the dependencies is not yet ready for v6.

                        We're all stories in the end. Just make it a good one, eh?

                        – The Doctor

                        KirAsh4K 1 Reply Last reply Reply Quote 0
                        • W Offline
                          witschi87
                          last edited by

                          Can you tell me how to do that, please?!

                          1 Reply Last reply Reply Quote 0
                          • paviroP Offline
                            paviro
                            last edited by paviro

                            First Google result when searching for downgrade node to v5 :)
                            Also do not forget to execute npm installand if that does not work reinstall the module from GitHub after you downgraded.

                            We're all stories in the end. Just make it a good one, eh?

                            – The Doctor

                            J D 2 Replies Last reply Reply Quote 0
                            • KirAsh4K Offline
                              KirAsh4 Moderator @paviro
                              last edited by

                              @paviro, but but but … @MichMich said … he said … he said node 6.1.0 is now supported. Dependencies be damned, they need to catch up.

                              A Life? Cool! Where can I download one of those from?

                              MichMichM 1 Reply Last reply Reply Quote 0
                              • MichMichM Offline
                                MichMich @KirAsh4
                                last edited by

                                @KirAsh4 Yeah, MM supports Node 6.1.0 @paviro apparently still live in the stone age with his modules … 😈

                                KirAsh4K 1 Reply Last reply Reply Quote 0
                                • KirAsh4K Offline
                                  KirAsh4 Moderator @MichMich
                                  last edited by

                                  @MichMich, I have a laser … let’s tie him up and put his hand under the beam. That’ll teach him!

                                  A Life? Cool! Where can I download one of those from?

                                  1 Reply Last reply Reply Quote 0
                                  • MichMichM Offline
                                    MichMich
                                    last edited by

                                    He is from the stone age. He doesn’t know what a laser is. 😱

                                    1 Reply Last reply Reply Quote 0
                                    • KirAsh4K Offline
                                      KirAsh4 Moderator
                                      last edited by

                                      0_1463677954464_paviro.jpg

                                      A Life? Cool! Where can I download one of those from?

                                      1 Reply Last reply Reply Quote 0
                                      • paviroP Offline
                                        paviro
                                        last edited by

                                        Ha, ha :laughing:
                                        Will change my dependencies when I have some spare time.

                                        We're all stories in the end. Just make it a good one, eh?

                                        – The Doctor

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

                                          At first: Thank you very much.
                                          This module is great and works fine for me.
                                          When it’s allowed to make some suggestion…
                                          you maybe could add a possibility to switch wireless sockets.
                                          The effort for this shouldn’t be much, when you can use xkonni’s remote control.
                                          https://github.com/xkonni/raspberry-remote
                                          This would be a great possibity for those, who don’t feel comfortable to use a 230V relais… (I studied Mechatronics, so i don’t care :P)

                                          1 Reply Last reply Reply Quote 0
                                          • paviroP Offline
                                            paviro
                                            last edited by

                                            Feel free to send a pull request! :)

                                            We're all stories in the end. Just make it a good one, eh?

                                            – The Doctor

                                            M 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
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 7
                                            • 3 / 7
                                            • 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