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.

    PIR gives black screen

    Scheduled Pinned Locked Moved Troubleshooting
    5 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.
    • R Offline
      Richard238
      last edited by

      I added a PIR to my MM, and I get a black screen, and no MM in browser on other LAN devices.
      Hitting the ‘Windows’ key brings up the Pi start menu, where I can lunch terminal and stop MM.
      A simple test script confirms the PIR device is working correctly without MM running.

      Any ideas on how to fix this, please?

      Here are the errors, and my config.

      { Error: Cannot find module 'onoff'
          at Module._resolveFilename (module.js:455: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:403:25)
          at Module.require (module.js:483:17)
          at require (internal/module.js:20:19)
          at Object. (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_helper.js:11:14)
          at Module._compile (module.js:556:32)
          at Object.Module._extensions..js (module.js:565:10)
          at Module.load (module.js:473:32)
          at tryModuleLoad (module.js:432:12) code: 'MODULE_NOT_FOUND' }
      

      Config:

      		{
      		module: 'MMM-PIR-Sensor',
      		config: {
      				sensorPIN:22,
                      powerSaving: true,
                      relayPIN: false,
      				powerSavingDelay: 0,
                      relayOnState: 1
      			// See 'Configuration options' for more information.
      		}
      	},
      
      1 Reply Last reply Reply Quote 0
      • yawnsY Offline
        yawns Moderator
        last edited by

        After running git clone https://github.com/paviro/MMM-PIR-Sensor.git in ~/MagicMirror/modules, did you run

        cd MMM-PIR-Sensor
        npm install
        

        ? The npm install in this directory should have installed onoff as a dependency.

        1 Reply Last reply Reply Quote 1
        • R Offline
          Richard238
          last edited by

          That seems to have fixed it, thank you.
          There’s now a prompt at the top of MM saying there’s an update available for the PIR module.
          How do I go about updating an individual module?

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

            In your example:

            cd ~/MagicMirror/modules/MMM-PIR-Sensor
            git pull
            npm install
            

            So you enter the modules directory, tell git to retrieve (= pull) the latest code from github and afterwards you install dependencies again, just in case

            1 Reply Last reply Reply Quote 0
            • R Offline
              Richard238
              last edited by

              Perfect, thank you! :)

              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