• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

Problem with PIR Sensor not working

Scheduled Pinned Locked Moved Troubleshooting
2 Posts 2 Posters 2.4k Views 2 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
    Iron_Reptar
    last edited by yawns Jun 20, 2017, 7:14 AM Jun 20, 2017, 5:11 AM

    I just got my mirror up and running and was trying to install the PIR sensor module provided by @paviro (https://github.com/paviro/MMM-PIR-Sensor) but it doesn’t seem to be working. I followed the step by step instructions as written and still the screen does not turn off. I even stuck the sensor (still wired up) under a box and no luck.
    I bought these PIR sensors (http://a.co/aYDzwAS) and am using these to plug in the sensor http://imgur.com/a/VEu0F . They are connected directly to the sensor with jumper wires.
    My modification to the modules config file looks like this.

    {
    module: 'MMM-PIR-Sensor',
    config: {
        sensorPIN: 22,
        powerSaving: true,
        powerSavingDelay: 0,
        relayOnState: 1
        }
    }
    

    I also ran the command /opt/vc/bin/tvservice -s and receive the output state 0x120006 [DVI DMT (68) RGB full 16:10], 1920x1200 @ 60.00Hz, progressive

    One thing I did notice is that while running through the install process, I ran sudo chmod u+s /opt/vc/bin/tvservice && sudo chmod u+s /bin/chvt but it said chmod: cannot access 'bin/chvt': No such file or directory

    Anyone able to help?

    1 Reply Last reply Reply Quote 0
    • M Offline
      malicious_banjo
      last edited by Jun 21, 2017, 2:07 AM

      Have you confirmed the sensor itself is actually working?

      Write out the following python script and run it:

      import gpizero import MotionSensor
      
      pir = MotionSensor(x) //x = the out pin on your Pi.
      
      while True:
           if pir.motion_detected:
                print("Motion detected!")
           else:
                print("Nothing")
      

      And make sure you’re using the BCM pin numbering.

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      1 / 1
      • First post
        1/2
        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