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

MMM-PIR-SENSOR not working

Scheduled Pinned Locked Moved Troubleshooting
17 Posts 9 Posters 11.8k 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.
  • M Offline
    mab6435
    last edited by Jan 6, 2018, 9:50 PM

    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.

    My modification to the modules config file looks like this.
    {
    module: “MMM-PIR-Sensor”,
    }
    I also ran the command /opt/vc/bin/tvservice -s and receive the output state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive

    I created a short python script to test if the sensor works and it does. But for some reason when I start up MagicMirror (using npm start) my webpage display shows up but the screen or display never turns off.

    Anyone able to help?

    C 1 Reply Last reply Jan 6, 2018, 10:05 PM Reply Quote 0
    • C Offline
      cowboysdude Module Developer
      last edited by Jan 6, 2018, 9:59 PM

      This post is deleted!
      1 Reply Last reply Reply Quote 1
      • C Offline
        cruunnerr @mab6435
        last edited by cruunnerr Jan 6, 2018, 10:05 PM Jan 6, 2018, 10:05 PM

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

        My modification to the modules config file looks like this.
        {
        module: “MMM-PIR-Sensor”,
        }

        Bur that is not like it is described in the readme of the module.

        try:

        {
        			module: 'MMM-PIR-Sensor',
        			config: {
        			sensorPIN: 22,
        			powerSavingDelay: 120 // in seconds
        			}
        		},
        

        Also u need to use a powersaving delay. Cause the default is 0 !

        And i am not sure, but i think u used “ instead of "

        M 1 Reply Last reply Jan 6, 2018, 11:05 PM Reply Quote 2
        • M Offline
          Mykle1 Project Sponsor Module Developer @cruunnerr
          last edited by Jan 6, 2018, 11:05 PM

          @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

          C 1 Reply Last reply Jan 6, 2018, 11:31 PM Reply Quote 1
          • C Offline
            cowboysdude Module Developer @Mykle1
            last edited by Jan 6, 2018, 11:31 PM

            This post is deleted!
            1 Reply Last reply Reply Quote 1
            • C Offline
              cowboysdude Module Developer
              last edited by Jan 7, 2018, 2:33 PM

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

              Y 1 Reply Last reply Jan 7, 2018, 8:32 PM Reply Quote 0
              • M Offline
                mab6435
                last edited by Jan 7, 2018, 5:53 PM

                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
                • C Offline
                  cruunnerr
                  last edited by Jan 7, 2018, 7:45 PM

                  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 Jan 7, 2018, 9:42 PM Reply Quote 0
                  • Y Offline
                    yawns Moderator @cowboysdude
                    last edited by Jan 7, 2018, 8:32 PM

                    @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 Jan 7, 2018, 9:42 PM

                      @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
                      • 1
                      • 2
                      • 1 / 2
                      1 / 2
                      • First post
                        6/17
                        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