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

Cant seem to get MMM-PIR-Sensor working

Scheduled Pinned Locked Moved Unsolved Troubleshooting
5 Posts 4 Posters 1.0k Views 4 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
    mkono87
    last edited by Oct 22, 2019, 8:39 PM

    Using a rp3 and have a Dell monitor plugged in with a HDMI to DVI connector as this monitor doesnt have hdmi. I have tested that my pir sensor is pulling high on the gpio pin but MagicMirror will not start and throws an error. Even the MMM-PIR module I cant get to work. This is the error im seeing.

    /home/pi/MagicMirror/node_modules/electron/dist/electron js/electron.js: symbol lookup error: /home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/epoll/build/Release/epoll.node: undefined symbol: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeE
    npm ERR! code ELIFECYCLE
    npm ERR! syscall spawn
    npm ERR! file sh
    npm ERR! errno ENOENT
    npm ERR! magicmirror@2.9.0 start: `sh run-start.sh`
    npm ERR! spawn ENOENT
    npm ERR!
    npm ERR! Failed at the magicmirror@2.9.0 start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/pi/.npm/_logs/2019-10-22T20_34_24_379Z-debug.log
    

    Also my module config is super basic as I dont need extra options right now.

    		{
    			module: 'MMM-PIR-Sensor',
    			config: {
    				// See 'Configuration options' for more information.
    			}
    		}
    

    Could anyone think of anything I could check with whats going on?

    S 1 Reply Last reply Oct 22, 2019, 10:55 PM Reply Quote 0
    • S Online
      sdetweil @mkono87
      last edited by Oct 22, 2019, 10:55 PM

      @mkono87 did u do

      npm install
      

      in the MMM-PIR_Sensor folder?

      it is required

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      M 1 Reply Last reply Oct 23, 2019, 3:57 PM Reply Quote 0
      • M Offline
        mkono87 @sdetweil
        last edited by mkono87 Oct 23, 2019, 3:59 PM Oct 23, 2019, 3:57 PM

        @sdetweil said in Cant seem to get MMM-PIR-Sensor working:

        @mkono87 did u do

        npm install
        

        in the MMM-PIR_Sensor folder?

        it is required

        Of course just like the instructions said. I do get one warning though.

        npm WARN lifecycle Magic-Mirror-Module-PIR-Sensor@1.1.0~postinstall: cannot run in wd Magic-Mirror-Module-PIR-Sensor@1.1.0 electron-rebuild -e ../../node_modules/electron (wd=/home/pi/MagicMirror/modules/MMM-PIR-Sensor)
        
        1 Reply Last reply Reply Quote 0
        • ? Offline
          A Former User
          last edited by Dec 7, 2019, 3:56 PM

          I never got that module working reliably. Here’s what I wrote instead:

          #!/usr/bin/python3
          
          # Imported Modules
          from time import sleep
          import subprocess
          import RPi.GPIO as GPIO
          
          
          # initialize GPIO
          GPIO.setwarnings(False)
          GPIO.setmode(GPIO.BCM)
          GPIO.cleanup()
          GPIO.setup(22, GPIO.IN)
          
          PIR = 22
          display_on = True
          
          while True:
          
              if display_on and not GPIO.input(PIR):
                  subprocess.run("vcgencmd display_power 0 > /dev/null 2>&1", shell=True)
                  display_on = False
          
              if not display_on and GPIO.input(PIR):
                  subprocess.run("vcgencmd display_power 1 > /dev/null 2>&1", shell=True)
                  display_on = True
                  sleep(30)
          
              sleep(0.5)
          

          Save this in your home directory as pir.py . Note that you will need to change PIR=22 to whichever pin your sensor is on.

          Run: python3 pir.py and you should be up and running

          To have it run at every boot, type crontab -e and add

          @reboot python3 /home/pi/pir.py
          

          Hope this helps!

          1 Reply Last reply Reply Quote 0
          • C Offline
            cowboysdude Module Developer
            last edited by Dec 8, 2019, 5:46 PM

            Been using this for over 3 years… I made it, it’s simple and directions are clear…
            https://github.com/cowboysdude/Pir-Sensor

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