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 not working after installation

    Scheduled Pinned Locked Moved Troubleshooting
    6 Posts 3 Posters 3.0k Views 4 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.
    • hartattackH Offline
      hartattack
      last edited by

      Is the sensor pin configured properly? Meaning in the config file for the module, the sensor pin defaults to 22. Is that the same one your sensor is connected to?

      V 2 Replies Last reply Reply Quote 0
      • V Offline
        vicdilou @hartattack
        last edited by

        @hartattack I connected the sensor to the pin 22. I didn’t change anything else.

        1 Reply Last reply Reply Quote 0
        • V Offline
          vicdilou
          last edited by

          UP ! :)
          I need help please ^^

          1 Reply Last reply Reply Quote 0
          • V Offline
            vicdilou @hartattack
            last edited by vicdilou

            I test the sensor with this, but it marks indefinitely “motion detected”.

            from gpiozero import MotionSensor
            
            pir = MotionSensor(4)
            while True:
                if pir.motion_detected:
                    print("Motion detected!")
            

            Edit : I connected it to the GPIO 4

            1 Reply Last reply Reply Quote 0
            • S Offline
              spacejam
              last edited by

              I’m having the same issue. Should the screensaver be off? I did the original config;

              sudo nano /etc/xdg/lxsession/LXDE/autostart
              
              add the following lines:
              
              @xset s noblank
              @xset s off
              @xset -dpms
              
              sudo nano /etc/lightdm/lightdm.conf
              
              add the following lines:
              
              xserver-command=X -s 0 -dpms
              

              but the screen was still blanking after 10-15 minutes so I installed xscreensaver to get around this. I’ve now taken xscreensaver off, so the screen is blanking after inactivity again, but MM doesn’t seem to recognize the PIR. I get the same results of ‘Motion Detected’ when running a .py test from the OS.

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