MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. Jay
    3. Best
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 16
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: PIR Sensor turning display on/off over and over

      Basically I had the same error with the display turning on and off over time. All in anger, I deinstalled the MagicMirror from the Pi and began at zero again.
      After updating and upgrading the Pi and installing the MagicMirror, a new try with the PIR-Module was iniciated. So I installed the PIR-Module and somehow noticed that my GPIO cables were wrong connected (ground connected to GPIO21 and vice-versa).
      So after this embarassing moment of disbelieve I changed the connections and checked if the sensor is working with a simple python script:

      from gpiozero import MotionSensor
      import time
      
      pir = MotionSensor(21)
      
      while True: #repeat this forever
          if pir.motion_detected: # if motion is detected print the message
              print("Motion detected!")
          if not pir.motion_detected: # if no motion is detected print the message
              print("No motion detected!")
          time.sleep(1)
      

      Note that my pir is using GPIO21.
      With this script I tested the sensor and it worked like a charm, even though the sensor is placed 5 centimeters away from the raspberry pi 3 (with no case or even a bead installed).
      In the end, I only had to do a cd MagicMirror again, and install the MagicMirror:
      npm install. With this setup the MMM-PIR-module works magnificient.

      posted in Troubleshooting
      JayJ
      Jay
    • RE: PIR Sensor turning display on/off over and over

      @deepshades
      Well ok…
      step 1: get nodejs and npm --> sudo apt-get install nodejs then sudo apt-get install npm
      step 2: update + upgrade the pi --> sudo apt-get update then sudo apt-get dist-upgrade
      step 3: install MagicMirror --> as seen here MagicMirror Github Page
      step 4: connect the PIR-Sensor to your Pi --> ground to ground (e.g. Pin 6), VCC to 5V (e.g. Pin 2), Out to GPIO XX (e.g. Pin 16)
      step 5: check if PIR-Sensor works --> as seen at my script above (watch your connected GPIO pin, maybe change in script is required) --> some fiddling with sensitivity knobs here is needed
      step 6: install MMM-PIR --> MMM-PIR Github Page
      step 7: reboot and reinstall MagicMirror in MagicMirror directory --> cd MagicMirror and npm install

      this has worked for me…

      posted in Troubleshooting
      JayJ
      Jay
    • RE: PIR Sensor turning display on/off over and over

      @johnnyboy

      The steps I described started after a succesfully installation of the operating system on the pi, so with no MagicMirror installed --> step 3 is the first time MM is installed.
      These are the steps which worked for me, somehow after the second install of the MagicMirror (step 7) the PIR worked --> this step could be obsolete for others, thats just what i did experience.

      posted in Troubleshooting
      JayJ
      Jay
    • 1 / 1