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.

    MMM-PIR-SENSOR not working

    Scheduled Pinned Locked Moved Troubleshooting
    17 Posts 9 Posters 12.9k 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.
    • Mykle1M Offline
      Mykle1 Project Sponsor Module Developer @cruunnerr
      last edited by

      @cruunnerr

      That happens when users don’t use a code block to paste their code. Quotes get screwed up.

      Create a working config
      How to add modules

      cowboysdudeC 1 Reply Last reply Reply Quote 1
      • cowboysdudeC Offline
        cowboysdude Module Developer @Mykle1
        last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 1
        • cowboysdudeC Offline
          cowboysdude Module Developer
          last edited by

          OH nice so now we’re deleting messages…Thanks appreciate that…

          yawnsY 1 Reply Last reply Reply Quote 0
          • M Offline
            mab6435
            last edited by

            Hi guys, thanks for the help. Unfortunately that did not fix the issue…
            I changed the code like you mentioned. Does anyone have any idea why the monitor never turns off. Googling the topic it seems other people have had a similar issue but no solutions ever been found.

            Its very strange to me because with a python script I have it printing out when it detects motion and when it detects none and it works flawlessly. I have a feeling that for some reason the MMM-PIR-SENSOR isn’t actually connecting with the rest of my magic mirror when I start things up. Below is my entire config.js file.

            modules: [

            	{
            		module: "clock",
            		position: "top_left"
            	},
            	{
            		module: "compliments",
            		position: "lower_center"
            	},
            	{
            		module: 'MMM-PIR-SENSOR',
            		config: {
            		sensorPIN: 22,
            		powerSavingDelay: 120 // in seconds 
            		}
            	},
            	{
            		module: "newsfeed",
            		position: "bottom_bar",
            		config: {
            			feeds: [
            				{
            					title: "New York Times",
            					url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"
            				}
            			],
            			showSourceTitle: true,
            			showPublishDate: true
            		}
            
            	},
                        {
                                module: "MMM-NFL",
                                position: "bottom_left",                              
                        },
            ]
            

            };

            1 Reply Last reply Reply Quote 0
            • cruunnerrC Offline
              cruunnerr
              last edited by

              are u sure, u are using the correct pin?
              The Module uses BCM numbering, so if u write in your config to use 22, it is physically 15, and this is GPIO 3!

              type in console, while u are running through the PIR:

              gpio read 3
              

              before detecting it must give out a “0”. WHILE moving through the PIR it must give out a “1”

              or simply type gpio readall before and while the PIR detects to compare results and see what Pin you are really using.

              and please check if pm2 gives errors with pm2 logs

              M 1 Reply Last reply Reply Quote 0
              • yawnsY Offline
                yawns Moderator @cowboysdude
                last edited by

                @cowboysdude said in MMM-PIR-SENSOR not working:

                OH nice so now we’re deleting messages…Thanks appreciate that…

                We all are here for some fun. But mentioning “dynamite” several times doesn’t help the user and it does not make your joke better.

                1 Reply Last reply Reply Quote 0
                • M Offline
                  mab6435 @cruunnerr
                  last edited by

                  @cruunnerr I’m using the correct pin. I made a python script shown below:

                  from gpiozero import MotionSensor
                  pir = MotionSensor(22)
                  while True:
                  if pir.motion_detected:
                  print(“motion detected”)
                  else:
                  print(“NOTHING”)

                  With this it will print nothing until i wave my hand in front of it then motion detected until i stop. So I know for a fact the PIR sensor is connected and working properly. Also there are no errors when I start magic mirror the only thing that is mentioned about MMM-PIR-Sensor is it says no helper found for module: MMM-PIR-SENSOR. Anyone have any idea

                  1 Reply Last reply Reply Quote 0
                  • cruunnerrC Offline
                    cruunnerr
                    last edited by

                    have u tried to delete the Pir Folder in your modules direction and start a simple new installation of the module?

                    or just go into the MMM-PIR-Sensor folder and type npm install again?

                    M 1 Reply Last reply Reply Quote 0
                    • M Offline
                      mab6435 @cruunnerr
                      last edited by

                      @cruunnerr I just deleted the entire module and downloaded it again, following the instructions directly from the page.

                      To summarize, I know the sensor is working properly and connected to the right pin listed in the config file. I know nothing is wrong with the module i just downloaded it from github. I’ve posted the exact copy of my config file, no one seems to have a problem with that. What else could it be? For some reason the monitor wont shut off.

                      Its a Benq monitor connected to the raspberry pi via an hdmi cord.
                      Im not sure if this helps but when i type /opt/vc/bin/tvservice -s:
                      state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive

                      1 Reply Last reply Reply Quote 0
                      • cruunnerrC Offline
                        cruunnerr
                        last edited by

                        i can switch off and on my display by simply typing sudo tvservice -o and sudo tvservice -p

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