Skip to content
This repository has been archived by the owner on Mar 6, 2022. It is now read-only.

PIR not working on Magic Mirror #112

Open
hec59 opened this issue Sep 21, 2020 · 5 comments
Open

PIR not working on Magic Mirror #112

hec59 opened this issue Sep 21, 2020 · 5 comments

Comments

@hec59
Copy link

hec59 commented Sep 21, 2020

I followed the instructions to the best of my ability and this does not work. I have a Pi4 4gb. If any one can write the instructions down step by step as if I was a 2 year old, this would be much appreciated. I have no experience in coding or linux. Thanks in advance

@ginfts
Copy link

ginfts commented Sep 23, 2020

Same for me; I included the following within the config file, but the screen goes blank immediately and it seems impossible to re-awake it. I have had to go back to a backup .dmg

config: {
sensorPin: 22,
powerSaving: true,
powerSavingDelay: 30,

I'm using a fairly new Benq LCD screen, and the centre wire is connected to BCM 22.

TIA

@brooklynrab
Copy link

Same for me. The screen goes black and blank as soon as I start up magic mirror, have to quit to get back to seeing anything on my screen. I remove the module from configure file and everything works again. Any ideas?

@jptech484
Copy link

i have the same problem. i would love to know the solution.

@mihed001
Copy link

I think it's a problem with rebuild of node-abi which makes MMM-PIR module crashing Magic Mirror.
Please try this command: npm upgrade node-abi --depth=100
This worked for me :-)

@omrid594
Copy link

omrid594 commented Mar 1, 2021

same issue here ->

	modules: [
		{
		module: "MMM-PIR-Sensor",
			config: {
				// default pin is 22 - view here https://pinout.xyz/
				powerSavingDelay: 60,
				preventHDMITimeout: 7,
				presenceIndicator: "fa-eye", // Customizing the indicator
				presenceOffIndicator: "fa-eye", // Customizing the indicator
				presenceIndicatorColor: "#f51d16", // Customizing the indicator
				presenceOffIndicatorColor: "#2b271c" // Customizing the indicator
			}
		},

and the output is

pi@raspberrypi:~/MagicMirror $ npm start

> [email protected] start /home/pi/MagicMirror
> DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js

[01.03.2021 15:17.19.020] [LOG]   Starting MagicMirror: v2.14.0
[01.03.2021 15:17.19.027] [LOG]   Loading config ...
[01.03.2021 15:17.19.032] [LOG]   Loading module helpers ...
[01.03.2021 15:17.19.040] [ERROR] WARNING! Could not load config file. Starting with default configuration. Error found: Error: Cannot find module 'onoff'
Require stack:
- /home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_helper.js
- /home/pi/MagicMirror/js/app.js
- /home/pi/MagicMirror/js/electron.js
- /home/pi/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js
- 
[01.03.2021 15:17.19.041] [LOG]   Loading module helpers ...
[01.03.2021 15:17.19.044] [ERROR] App threw an error during load
[01.03.2021 15:17.19.051] [ERROR] Error: Cannot find module 'onoff'
Require stack:
- /home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_helper.js
- /home/pi/MagicMirror/js/app.js
- /home/pi/MagicMirror/js/electron.js
- /home/pi/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js
- 
    at Module._resolveFilename (internal/modules/cjs/loader.js:798:15)
    at Function../lib/common/reset-search-paths.ts.Module._resolveFilename (electron/js2c/browser_init.js:7718:16)
    at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/module-alias/index.js:49:29)
    at Module._load (internal/modules/cjs/loader.js:691:27)
    at Function.Module._load (electron/js2c/asar.js:748:26)
    at Module.require (internal/modules/cjs/loader.js:853:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_helper.js:11:14)
    at Module._compile (internal/modules/cjs/loader.js:968:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:986:10)
[01.03.2021 15:17.19.053] [ERROR] Whoops! There was an uncaught exception...
[01.03.2021 15:17.19.058] [ERROR] Error: Cannot find module 'onoff'
Require stack:
- /home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_helper.js
- /home/pi/MagicMirror/js/app.js
- /home/pi/MagicMirror/js/electron.js
- /home/pi/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js
- 
    at Module._resolveFilename (internal/modules/cjs/loader.js:798:15)
    at Function../lib/common/reset-search-paths.ts.Module._resolveFilename (electron/js2c/browser_init.js:7718:16)
    at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/module-alias/index.js:49:29)
    at Module._load (internal/modules/cjs/loader.js:691:27)
    at Function.Module._load (electron/js2c/asar.js:748:26)
    at Module.require (internal/modules/cjs/loader.js:853:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_helper.js:11:14)
    at Module._compile (internal/modules/cjs/loader.js:968:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:986:10) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_helper.js',
    '/home/pi/MagicMirror/js/app.js',
    '/home/pi/MagicMirror/js/electron.js',
    '/home/pi/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js',
    undefined
  ]
}
[01.03.2021 15:17.19.061] [ERROR] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
[01.03.2021 15:17.19.061] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
[01.03.2021 15:17.19.319] [LOG]   Launching application.
[01.03.2021 15:17.19.348] [WARN]  (electron) The default value of app.allowRendererProcessReuse is deprecated, it is currently "false".  It will change to be "true" in Electron 9.  For more information please check https://github.com/electron/electron/issues/18397
[01.03.2021 15:17.20.655] [LOG]   Shutting down server...

Anyone?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants