PIR gives black screen



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

  • Moderator

    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.



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


  • Moderator

    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



  • Perfect, thank you! :)


Log in to reply
 

Looks like your connection to MagicMirror Forum was lost, please wait while we try to reconnect.