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 problem

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    19 Posts 6 Posters 7.0k Views 7 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.
    • P Offline
      Peter
      last edited by

      Hi smart people,
      My MM has been running without major problems for 5 years.
      Lately I experienced some problems, so decided to make a fresh install: Bullseye, MM 2.22 on a Pi 3.
      After a lot of work (I am not really good at this, mostly copy-paste) the MM is running.

      Just 2 problems: major problem: I cannot get de PIR sensor to work anymore (worked perfectly for 5 year).
      I tried MMM-Pir (nothing), and MMM-Pir-Sensor-Light (I can see it countdown from 15 minutes, but after 15 minutes the counter starts allover), so it does not turn off the screen.

      Smaller problem: the default Calendar module disappears after some time and gets back after some more time, strange behaviour.

      Can somebody give me an answer (maybe two …)?
      Thanks in advance!

      Peter

      wishmaster270W 1 Reply Last reply Reply Quote 0
      • wishmaster270W Offline
        wishmaster270 Module Developer @Peter
        last edited by

        @Peter
        There can be a lot of reasons why the PIR modules are not working anymore.
        What module did you use in the previous setup?
        Did you run “npm install” in the module again? Or did you only copy the directory to the new setup?
        Are there any errors during the installation of the module?

        You can use my test script to check if the sensor it self triggers an event.

        Next step would be to test if the command which controls the screen. Most modules use vcgencmd

        If you run the following command to display should be shut off and 20 seconds later it should be shut on again.
        Best way is to run the command via ssh shell.

        /usr/bin/vcgencmd display_power 0; echo "Display should now be off"; sleep 20; /usr/bin/vcgencmd display_power 1; echo "And now it should be on again"
        
        S P 3 Replies Last reply Reply Quote 0
        • S Do not disturb
          sdetweil @wishmaster270
          last edited by

          @wishmaster270 note vcgencmd is sensitive to the pi firmware level

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          wishmaster270W 1 Reply Last reply Reply Quote 0
          • wishmaster270W Offline
            wishmaster270 Module Developer @sdetweil
            last edited by

            @sdetweil I saw your post about firmware level in one of the other posts. Additionally i think it is depending of the graphical driver used (vc4-kms-v3d vs vc4-fkms-v3d).
            But if it works with the posted command most of the modules should be fine.

            S 1 Reply Last reply Reply Quote 0
            • S Do not disturb
              sdetweil @wishmaster270
              last edited by

              @wishmaster270 https://forum.magicmirror.builders/topic/17185/pir-sensor-problem-after-restart-raspi/19?_=1663206370580

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              wishmaster270W 1 Reply Last reply Reply Quote 0
              • P Offline
                Peter @wishmaster270
                last edited by

                @wishmaster270 said in PIR problem:

                @Peter
                There can be a lot of reasons why the PIR modules are not working anymore.
                What module did you use in the previous setup?
                Did you run “npm install” in the module again? Or did you only copy the directory to the new setup?
                Are there any errors during the installation of the module?

                You can use my test script to check if the sensor it self triggers an event.

                Next step would be to test if the command which controls the screen. Most modules use vcgencmd

                If you run the following command to display should be shut off and 20 seconds later it should be shut on again.
                Best way is to run the command via ssh shell.

                /usr/bin/vcgencmd display_power 0; echo "Display should now be off"; sleep 20; /usr/bin/vcgencmd display_power 1; echo "And now it should be on again"
                

                Thanks for your answer.
                I used MMM-Pir_Sensor in my previous setup.
                I made a complete new install, so I did not copy the directory to the new setup.
                I will try your commands in the next days, will keep you informed.
                Peter

                1 Reply Last reply Reply Quote 0
                • wishmaster270W Offline
                  wishmaster270 Module Developer @sdetweil
                  last edited by

                  @sdetweil
                  I think it is more a problem of the graphical stack. Just checked my new installation of today.
                  With “vc4-kms-v3d” my test commands from above result in the screen being unchanged after i changed back to the “vc4-fkms-v3d” driver in the “/boot/config.txt” and a reboot everything is working as before.
                  I run the kernel 5.15.84-v7l+ at the moment.

                  1 Reply Last reply Reply Quote 0
                  • P Offline
                    Peter @wishmaster270
                    last edited by

                    @wishmaster270 sorry for my stupid question, I use Gpio pin 17, do I have to use that number in line 6 of your test script?
                    Peter

                    wishmaster270W 1 Reply Last reply Reply Quote 0
                    • wishmaster270W Offline
                      wishmaster270 Module Developer @Peter
                      last edited by

                      @Peter
                      No stupid question more a lack of information/documentation of me ;-)

                      You can call the script with the GPIO number as first argument. In your case it should be:

                      ./testGPIO.py 17
                      

                      After some research i am pretty sure the problem is the graphics stack in your case. I am working on a solution for the problem

                      P 1 Reply Last reply Reply Quote 0
                      • P Offline
                        Peter @wishmaster270
                        last edited by

                        @wishmaster270 great!
                        I will try it as soon as I find time …
                        Have a nice evening!
                        Peter

                        karsten13K 1 Reply Last reply Reply Quote 0
                        • karsten13K Online
                          karsten13 @Peter
                          last edited by

                          I was not able to use vcgencmd under bullseye and AFAIK they are using xrandr under the hood for rotating the screen over the web ui menu.

                          So beside testing if the sensor works you could test if you can deactivate the sceen with xrandr --output HDMI-1 --off and activate it again with xrandr --output HDMI-1 --rotate normal --auto.

                          xrandr is also the default of commandType option of MMM-PIR-Sensor-Lite (see documentation).

                          P 1 Reply Last reply Reply Quote 0
                          • P Offline
                            Peter @karsten13
                            last edited by

                            @karsten13 I tried MMM-Pir-Sensor-Lite: counting down works and is re-activated whenever I move my hand in front of the sensor.
                            But the screen does not turn off.
                            Peter

                            wishmaster270W S 2 Replies Last reply Reply Quote 0
                            • wishmaster270W Offline
                              wishmaster270 Module Developer @Peter
                              last edited by

                              @Peter
                              @karsten13

                              Just released version 0.0.7 of my MMM-Screen-Powersave-Notification module which supports either vcgencmd, tvservice and now also xrandr.

                              1 Reply Last reply Reply Quote 0
                              • S Do not disturb
                                sdetweil @Peter
                                last edited by

                                @Peter what mode are u trying? xrandr vcgencmd?

                                only xrandr works on bullseye

                                Sam

                                How to add modules

                                learning how to use browser developers window for css changes

                                P 1 Reply Last reply Reply Quote 0
                                • P Offline
                                  Peter @sdetweil
                                  last edited by

                                  @sdetweil I used xrandr.
                                  Peter

                                  S 1 Reply Last reply Reply Quote 0
                                  • S Do not disturb
                                    sdetweil @Peter
                                    last edited by

                                    @Peter and if you issue the commands yourself(via ssh)

                                    do they work?

                                    Sam

                                    How to add modules

                                    learning how to use browser developers window for css changes

                                    P 1 Reply Last reply Reply Quote 0
                                    • P Offline
                                      Peter @sdetweil
                                      last edited by

                                      @sdetweil did not try that.
                                      Peter

                                      N6NGN 1 Reply Last reply Reply Quote 0
                                      • N6NGN Offline
                                        N6NG @Peter
                                        last edited by

                                        @Peter Hello Peter… I’m not sure I understand… I ran the following test on my mirror and it worked as it should.

                                        /usr/bin/vcgencmd display_power 0; echo “Display should now be off”; sleep 20; /usr/bin/vcgencmd display_power 1; echo “And now it should be on again”

                                        But now I need to incorporate it into my config.js for my MMM-PIR-Sensor-Lite. I see the command type and ‘vcgencmd’ but once I get that in the config how do I do the turn on and turn off?

                                        Thanks for all the help and you also Sam.

                                        Dennis

                                        T 1 Reply Last reply Reply Quote 0
                                        • T Offline
                                          TangoE30 @N6NG
                                          last edited by

                                          @N6NG and @sdetweil
                                          Hi All,
                                          Passing along some info as I was also having problems with my ASUS VZ27EHE monitor staying off / my monitor coming back on with MMM-PIR-Sensor-Lite. The display would turn off, then a blue screen come on saying “HDMI No Signal” but then automatically turned back on. I used both xrandr and xset commands but nothing worked on my pi 4 running Bullseye.

                                          After some digging and looking at this site “https://github.com/raspberrypi/linux/issues/2517”, I replaced the code in the node_helper.js (I know you’re not supposed to touch but this is what worked for me) and it works now. The only issue is on reboot, I have to run a command once to avoid the screen going to a gray state xsetroot -display :0 -solid Black.

                                          case 'xset':
                                          	exec("xset -display :0 s noblank", null);//default: xset dpms force off
                                          	//Have to run 'xsetroot -display :0 -solid Black' on reboot to avoid gray screen
                                          	exec("sleep 1", null);
                                          	exec("xset -display :0 s off", null);
                                          	exec("sleep 1", null);
                                          	exec("xset -display :0 -dpms", null);
                                          	exec("sleep 1", null);
                                          	exec("xset -display :0 s 0 0", null);
                                          	exec("sleep 1", null);
                                          	exec("xset -display :0 dpms 0 0 0", null);
                                          	exec("sleep 1", null);
                                          	exec("xset dpms force off", null);
                                          

                                          Don’t ask me how it works and I’ll give credit to E3V3A for posting that code. Hopefully this will help for those with a non-CEC compliant monitor and can fully turn off the monitor when not in use.

                                          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 / 1
                                          • 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