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

Scheduled Pinned Locked Moved Troubleshooting
9 Posts 5 Posters 5.2k 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.
  • D Offline
    Desertswing
    last edited by May 22, 2017, 6:25 PM

    Hey guys could someone help me what am i doing wrong…?
    i keep getting this error:

    Error: Cannot find module 'onoff'
        at Module._resolveFilename (module.js:470:15)
        at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12)
        at Function.Module._load (module.js:418:25)
        at Module.require (module.js:498:17)
        at require (internal/module.js:20:19)
        at Object. (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_helper.js:11:14)
        at Object. (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_helper.js:88:3)
        at Module._compile (module.js:571:32)
        at Object.Module._extensions..js (module.js:580:10)
        at Module.load (module.js:488:32)
    Whoops! There was an uncaught exception...
    { Error: Cannot find module 'onoff'
        at Module._resolveFilename (module.js:470:15)
        at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12)
        at Function.Module._load (module.js:418:25)
        at Module.require (module.js:498:17)
        at require (internal/module.js:20:19)
        at Object. (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_helper.js:11:14)
        at Object. (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_helper.js:88:3)
        at Module._compile (module.js:571:32)
        at Object.Module._extensions..js (module.js:580:10)
        at Module.load (module.js:488:32) code: 'MODULE_NOT_FOUND' }
    MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
    If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
    Launching application.
    

    This is my config.js file:

        {
                              module: 'MMM-PIR-Sensor',
                              config: {
                                sensorPIN: 22,
                                powerSaving: true,
                            relayOnState: 1
                      }
                    },
    
    1 Reply Last reply Reply Quote 0
    • B Offline
      beck0r
      last edited by beck0r May 28, 2017, 7:14 AM May 28, 2017, 7:13 AM

      Facing the same issue… The sensor itself works. Tested with a python script…
      As soon as I implement the config for the sensor the screen stays black (via VNC) and the MM is not reachable via browser.

      By the way, I have connected my GPIO-data-cable to PIN wiringPi 7. The description says that BCM numbering should be used, so I used 4 instead of 7 in the config. Is that correct?

      0_1495955558091_upload-4326d89c-c750-454d-baea-0405235938ca

      (Sorry for german screenshot)

      1 Reply Last reply Reply Quote 0
      • E Offline
        envedede
        last edited by May 28, 2017, 3:39 PM

        You are correct about the BCM pin numbering beck0r, it is not the same as the actual pin number (the BCM pin numbering origins from the processor pins if I am correct).

        What I advise is to forget about this module and use https://github.com/cowboysdude/Pir-Sensor instead.
        I made some slight changes to this myself, because it was still not turning on the monitor correctly.

        RUN apt-get update && apt-get install -y libraspberrypi-bin and replace the scripts from the above link as follows: monitor_on.sh contains only vcgencmd display_power 1 and monitor_off.sh only the line vcgencmd display_power 0. This solved my problem for every display I used so far, being HDMI, VGA and DVI displays.

        D 1 Reply Last reply May 30, 2017, 2:21 PM Reply Quote 0
        • B Offline
          beck0r
          last edited by May 28, 2017, 8:45 PM

          Thank’s for your answer. As you have already seen I was able to solve it nealry like cowboysdude did

          1 Reply Last reply Reply Quote 0
          • D Offline
            Desertswing @envedede
            last edited by May 30, 2017, 2:21 PM

            @envedede

            How do i need to:

            chmod all files: From a terminal window in your root directory:

            sudo chmod +x pir.py

            sudo chmod +x monitor_off.sh

            sudo chmod +x monitor_on.sh

            Editing pir.py

            could u explain, i`m master noob with raspberry :P

            D 1 Reply Last reply May 30, 2017, 7:42 PM Reply Quote 0
            • D Offline
              Desertswing @Desertswing
              last edited by May 30, 2017, 7:42 PM

              @Desertswing
              I found out how to, i forgot to place the files in root :)
              But my screen isen`t going off yet but the light bulb i attached goed on and off when motion detected??

              1 Reply Last reply Reply Quote 0
              • D Offline
                Desertswing
                last edited by Jun 1, 2017, 7:25 PM

                fixed this one !

                1 Reply Last reply Reply Quote 0
                • D Offline
                  Duske
                  last edited by Aug 26, 2017, 11:06 AM

                  I solved the Error: Cannot find module 'onoff'- Error by removing the node_modules from the MMM-PIR-Sensor directory and reinstall them by using npm i. This time, some dependencies seem to be built in with electron, and the error disappeared.

                  1 Reply Last reply Reply Quote 0
                  • R Offline
                    Richard238
                    last edited by Feb 14, 2018, 3:14 PM

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • 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