MagicMirror² v2.4.1 is available! For more information about this release, check out this topic.
Please read the release notes carefully since this update requires adjustments to your Raspberry Pi configuration!

PIR sensor not working after installation



  • Hi everyone !

    I followed the steps of the readme, but after rebooting the screen never turns off.
    I don’t know where I am wrong but it doesn’t work ^^

    Thank you.

    https://github.com/paviro/MMM-PIR-Sensor



  • 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?



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



  • UP ! 🙂
    I need help please ^^



  • 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



  • 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.