Solved PIR stopped working
-
Hi
I have a PIR motion sensor (HC-SR501) on my mirror and I have been using the PIR config in MMM-GoogleAssistant to turn on the screen without a problem. However, after the recent updates, my sensor seems to have stopped working.
I have tested it with a simple python script and the motion test result is expected, so I don’t think it’s a hardware issue.
I have done a npm rebuild for MMM-GoogleAssistant and MMM-Detector just to double check but that doesn’t seem to solve the problem either.
Any idea how to troubleshoot the problem?
-
The GABackground is installed according to the wiki and I’ve run a git pull and update and it’s all up to date. So not sure what’s causing the error. Is GABackground used for PIR?
I have run npm run rebuild in MMM-GoogleAssistant but the PIR problem persists.
-
Are you using http://wiki.bugsounet.fr/en/MMM-NewPIR it needs to be updated also or the inbuild module of GA?
cd ~/MagicMirror/modules/MMM-NewPIR git pull npm run update
-
No I’m not using the MMM-NewPIR module and I don’t have it installed
-
@DJB1966: no, no NewPir module is Independent and not need for GA (only if you are not using GA)
Best way is check node/npm version -
Npm 6.14.15
Node v14.17.5 -
Can try npm run rebuild inside GA directory?
-
I’ve just tried that but it’s still not working.
-
weird, can you enable debug mode in config of GA, Restart MagicMirror
and past me log console log since MM start ?
Of course, if you can move between for see react in log, it will be welcomeNotes:
- don’t forget to stop
pm2
process if you use it - start manually with:
cd ~/MagicMirror npm start
- copy and past all content
- don’t forget to stop
-
pi@raspberrypi:~/MagicMirror $ npm start > magicmirror@2.17.1 start /home/pi/MagicMirror > DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js [15.10.2021 10:51.26.171] [LOG] Starting MagicMirror: v2.17.1 [15.10.2021 10:51.26.183] [LOG] Loading config ... [15.10.2021 10:51.26.190] [LOG] Loading module helpers ... [15.10.2021 10:51.26.192] [LOG] No helper found for module: alert. [15.10.2021 10:51.26.210] [LOG] Initializing new module helper ... [15.10.2021 10:51.26.211] [LOG] Module helper loaded: updatenotification [15.10.2021 10:51.26.213] [LOG] No helper found for module: clock. [15.10.2021 10:51.26.218] [LOG] Initializing new module helper ... [15.10.2021 10:51.26.219] [LOG] Module helper loaded: MMM-Detector [15.10.2021 10:51.26.384] [LOG] Initializing new module helper ... [15.10.2021 10:51.26.385] [LOG] Module helper loaded: calendar [15.10.2021 10:51.26.623] [LOG] Initializing new module helper ... [15.10.2021 10:51.26.624] [LOG] Module helper loaded: MMM-Remote-Control [15.10.2021 10:51.26.644] [LOG] Initializing new module helper ... [15.10.2021 10:51.26.645] [LOG] Module helper loaded: MMM-MP3Player [15.10.2021 10:51.26.654] [LOG] Initializing new module helper ... [15.10.2021 10:51.26.655] [LOG] Module helper loaded: MMM-Mopidy-MPD [15.10.2021 10:51.26.905] [LOG] Initializing new module helper ... [15.10.2021 10:51.26.906] [LOG] Module helper loaded: MMM-AnyList2 [15.10.2021 10:51.28.959] [LOG] Initializing new module helper ... [15.10.2021 10:51.28.960] [LOG] Module helper loaded: MMM-GoogleAssistant [15.10.2021 10:51.28.961] [LOG] No helper found for module: MMM-Globe. [15.10.2021 10:51.28.961] [LOG] No helper found for module: compliments. [15.10.2021 10:51.28.962] [LOG] No helper found for module: weather. [15.10.2021 10:51.28.963] [LOG] No helper found for module: MMM-Traffic. [15.10.2021 10:51.28.965] [LOG] Initializing new module helper ... [15.10.2021 10:51.28.965] [LOG] Module helper loaded: MMM-MoonPhase [15.10.2021 10:51.29.543] [LOG] Initializing new module helper ... [15.10.2021 10:51.29.544] [LOG] Module helper loaded: MMM-Jast [15.10.2021 10:51.29.567] [LOG] Initializing new module helper ... [15.10.2021 10:51.29.568] [LOG] Module helper loaded: newsfeed [15.10.2021 10:51.29.569] [LOG] No helper found for module: MMM-pages. [15.10.2021 10:51.29.848] [LOG] Initializing new module helper ... [15.10.2021 10:51.29.848] [LOG] Module helper loaded: MMM-Rijks [15.10.2021 10:51.30.069] [LOG] Initializing new module helper ... [15.10.2021 10:51.30.070] [LOG] Module helper loaded: MMM-AnyList [15.10.2021 10:51.30.071] [LOG] No helper found for module: MMM-StopwatchTimer. [15.10.2021 10:51.30.071] [LOG] No helper found for module: MMM-page-indicator. [15.10.2021 10:51.30.072] [LOG] All module helpers loaded. [15.10.2021 10:51.30.188] [LOG] Starting server on port 8080 ... [15.10.2021 10:51.30.191] [WARN] You're using a full whitelist configuration to allow for all IPs [15.10.2021 10:51.30.199] [LOG] Server started ... [15.10.2021 10:51.30.200] [LOG] Connecting socket for: updatenotification [15.10.2021 10:51.30.202] [LOG] Connecting socket for: MMM-Detector [15.10.2021 10:51.30.204] [LOG] [DETECTOR] MMM-Detector Version: 1.1.2 rev: 211004-1 [15.10.2021 10:51.30.205] [LOG] Connecting socket for: calendar [15.10.2021 10:51.30.206] [LOG] Starting node helper for: calendar [15.10.2021 10:51.30.207] [LOG] Connecting socket for: MMM-Remote-Control [15.10.2021 10:51.30.208] [LOG] Starting node helper for: MMM-Remote-Control [15.10.2021 10:51.30.216] [LOG] Connecting socket for: MMM-MP3Player [15.10.2021 10:51.30.217] [LOG] Starting module helper: MMM-MP3Player [15.10.2021 10:51.30.218] [LOG] Connecting socket for: MMM-Mopidy-MPD [15.10.2021 10:51.30.219] [LOG] Starting module helper: MMM-Mopidy-MPD [15.10.2021 10:51.30.220] [LOG] Connecting socket for: MMM-AnyList2 [15.10.2021 10:51.30.220] [LOG] Starting node helper: MMM-AnyList2 [15.10.2021 10:51.30.222] [LOG] Connecting socket for: MMM-GoogleAssistant [15.10.2021 10:51.30.223] [LOG] [GA] Read config.js and check ConfigDeepMerge... [15.10.2021 10:51.30.224] [LOG] [GA] Perfect ConfigDeepMerge activated! [15.10.2021 10:51.30.225] [LOG] Connecting socket for: MMM-MoonPhase [15.10.2021 10:51.30.226] [LOG] Starting module helper: MMM-MoonPhase [15.10.2021 10:51.30.226] [LOG] Connecting socket for: MMM-Jast [15.10.2021 10:51.30.227] [LOG] MMM-Jast helper method started... [15.10.2021 10:51.30.227] [LOG] Connecting socket for: newsfeed [15.10.2021 10:51.30.228] [LOG] Starting node helper for: newsfeed [15.10.2021 10:51.30.229] [LOG] Connecting socket for: MMM-Rijks [15.10.2021 10:51.30.230] [LOG] Connecting socket for: MMM-AnyList [15.10.2021 10:51.30.230] [LOG] Starting node helper: MMM-AnyList [15.10.2021 10:51.30.232] [LOG] Sockets connected & modules started ... [15.10.2021 10:51.30.572] [LOG] Launching application. [15.10.2021 10:51.30.638] [WARN] (electron) Security Warning: A WebContents was just created with both webviewTag and contextIsolation enabled. This combination is fundamentally less secure and effectively bypasses the protections of contextIsolation. We strongly recommend you move away from webviews to OOPIF or BrowserView in order for your app to be more secure [15.10.2021 10:51.31.374] [ERROR] ERROR! Could not find main module js file for MMM-GABackground [15.10.2021 10:51.31.613] [ERROR] ERROR! Could not validate main module js file. [15.10.2021 10:51.31.616] [ERROR] ReferenceError: Log is not defined at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-Jast/MMM-Jast.js:14:4347) at Module._compile (internal/modules/cjs/loader.js:1078:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10) at Module.load (internal/modules/cjs/loader.js:935:32) at Module._load (internal/modules/cjs/loader.js:776:14) at Function.f._load (electron/js2c/asar_bundle.js:5:12913) at Module.require (internal/modules/cjs/loader.js:959:19) at require (internal/modules/cjs/helpers.js:88:18) at Class.loadModuleDefaultConfig (/home/pi/MagicMirror/modules/MMM-Remote-Control/node_helper.js:313:30) at /home/pi/MagicMirror/modules/MMM-Remote-Control/node_helper.js:267:26 [15.10.2021 10:51.37.218] [LOG] [DETECTOR] All needed @bugsounet library loaded ! [15.10.2021 10:51.37.220] [LOG] [NPM] Initialized v0.9.96 [15.10.2021 10:51.37.347] [LOG] [DETECTOR] Platform: 'raspberry-pi'; attempting to use 'arecord' to access microphone ... [15.10.2021 10:51.37.350] [LOG] [DETECTOR] Snowboy is initialized with 1 Models: jarvis [15.10.2021 10:51.37.423] [LOG] [DETECTOR] Starts listening. 1 Models [15.10.2021 10:51.37.604] [LOG] Create new calendarfetcher for url: https://calendar.google.com/calendar/ical/.ics - Interval: 300000 [15.10.2021 10:51.37.627] [LOG] Create new calendarfetcher for url: https://www.calendarlabs.com/ical-calendar/ics/61/New_Zealand_Holidays.ics - Interval: 300000 [15.10.2021 10:51.37.691] [LOG] Create new newsfetcher for url: https://www.stuff.co.nz/rss - Interval: 300000 [15.10.2021 10:51.37.696] [LOG] Create new newsfetcher for url: https://www.interest.co.nz/rss.xml - Interval: 300000 [15.10.2021 10:51.37.700] [LOG] Create new newsfetcher for url: http://www.thestandnews.com/rss - Interval: 300000 [15.10.2021 10:51.38.595] [INFO] Newsfeed-Fetcher: Broadcasting 20 items. [15.10.2021 10:51.39.971] [ERROR] Newsfeed Error. Could not fetch newsfeed: https://www.interest.co.nz/rss.xml Error: Not Found at NodeHelper.checkFetchStatus (/home/pi/MagicMirror/js/node_helper.js:121:9) at processTicksAndRejections (internal/process/task_queues.js:93:5) [15.10.2021 10:51.40.139] [INFO] Calendar-Fetcher: Broadcasting 5 events. [15.10.2021 10:51.40.237] [LOG] [MMM-MP3Player] Found 280 track(s) [15.10.2021 10:51.40.390] [INFO] Checking git for module: default [15.10.2021 10:51.40.444] [INFO] Checking git for module: MMM-Detector [15.10.2021 10:51.40.500] [INFO] Checking git for module: MMM-Remote-Control [15.10.2021 10:51.40.555] [INFO] Checking git for module: MMM-MP3Player [15.10.2021 10:51.40.611] [INFO] Checking git for module: MMM-Mopidy-MPD [15.10.2021 10:51.40.724] [INFO] Checking git for module: MMM-AnyList2 [15.10.2021 10:51.40.769] [INFO] Checking git for module: MMM-GoogleAssistant [15.10.2021 10:51.40.832] [INFO] Checking git for module: MMM-Globe [15.10.2021 10:51.40.905] [INFO] Checking git for module: MMM-Traffic [15.10.2021 10:51.40.951] [INFO] Checking git for module: MMM-MoonPhase [15.10.2021 10:51.41.008] [INFO] Checking git for module: MMM-Jast [15.10.2021 10:51.41.050] [INFO] Checking git for module: MMM-pages [15.10.2021 10:51.41.095] [INFO] Checking git for module: MMM-Rijks [15.10.2021 10:51.41.143] [INFO] Checking git for module: MMM-AnyList [15.10.2021 10:51.41.189] [INFO] Checking git for module: MMM-StopwatchTimer [15.10.2021 10:51.41.232] [INFO] Checking git for module: MMM-page-indicator [15.10.2021 10:51.41.281] [LOG] [GA] MMM-GoogleAssistant Version: 3.1.0 rev: 211008-1 [15.10.2021 10:51.41.284] [LOG] [GA] YouTube Search Function initilized. [15.10.2021 10:51.41.287] [LOG] [GA] Platform: 'raspberry-pi'; attempting to use 'arecord' to access microphone ... [15.10.2021 10:51.41.287] [LOG] [GA] Activate delay is set to 250 ms [15.10.2021 10:51.41.385] [LOG] [GA] Loaded @bugsounet/npmcheck [15.10.2021 10:51.41.408] [LOG] [GA] Loaded @bugsounet/screen [15.10.2021 10:51.41.423] [LOG] [GA] Loaded @bugsounet/pir [15.10.2021 10:51.41.426] [LOG] [GA] Loaded @bugsounet/governor [15.10.2021 10:51.41.704] [LOG] [GA] Loaded @bugsounet/cast [15.10.2021 10:51.41.992] [LOG] [GA] Loaded @bugsounet/cvlc [15.10.2021 10:51.42.040] [LOG] [GA] Loaded @bugsounet/google-photos [15.10.2021 10:51.42.104] [LOG] [GA] All needed @bugsounet library loaded ! [15.10.2021 10:51.42.480] [LOG] [GA] Detected: Raspberry Pi 4 [15.10.2021 10:51.42.481] [LOG] [GA:EXT] Extented Display Server Started [15.10.2021 10:51.42.483] [LOG] [GA:EXT] Starting Screen module... [15.10.2021 10:51.42.486] [LOG] [SCREEN] Mode 4: HDMI CEC [15.10.2021 10:51.42.487] [LOG] [SCREEN] Screen v1.1.8 Initialized... [15.10.2021 10:51.42.488] [LOG] [SCREEN] Start. [15.10.2021 10:51.42.541] [LOG] [GA:EXT] Starting Pir module... [15.10.2021 10:51.42.544] [LOG] [PIR] PIR v1.0.6 Initialized... [15.10.2021 10:51.42.545] [LOG] [PIR] Start [15.10.2021 10:51.42.551] [LOG] [GA:EXT] Starting Governor module... [15.10.2021 10:51.42.553] [LOG] [GOVERNOR] Governor v1.0.3 Initialized... [15.10.2021 10:51.42.605] [LOG] [GOVERNOR] Start [15.10.2021 10:51.42.606] [LOG] [GA:EXT] Starting Cast module... [15.10.2021 10:51.42.610] [LOG] [CAST] Cast v1.1.3 Initialized... [15.10.2021 10:51.42.635] [LOG] [GA:EXT] Starting GooglePhotosAPI module... [15.10.2021 10:51.42.642] [LOG] [GPHOTOS] config: { usePhotos: true, useGooglePhotosAPI: true, displayType: 'Recipe', displayDelay: 10000, albums: [ 'To print' ], sort: 'new', hiResolution: true, timeFormat: 'DD/MM/YYYY HH:mm', moduleHeight: 300, moduleWidth: 300, LoadingText: 'Loading …', GPAlbumName: 'Album:', CREDENTIALS: '/home/pi/MagicMirror/modules/MMM-GoogleAssistant/credentials.json', TOKEN: '/home/pi/MagicMirror/modules/MMM-GoogleAssistant/tokens/tokenGP.json', CACHE: '/home/pi/MagicMirror/modules/MMM-GoogleAssistant/tmp' } [15.10.2021 10:51.42.646] [LOG] [GPHOTOS] Starting Initialization [15.10.2021 10:51.42.648] [LOG] [GPHOTOS] Getting album list [15.10.2021 10:51.42.654] [LOG] [GA:EXT] Extented Display is initialized. [15.10.2021 10:51.42.659] [LOG] [GA] RECIPE_LOADED: with-BackgroundStatus.js [15.10.2021 10:51.42.662] [LOG] [GA] RECIPE_LOADED: ExtRadio.js [15.10.2021 10:51.42.665] [LOG] [GA] RECIPE_LOADED: ExtGPhotos.js [15.10.2021 10:51.42.669] [LOG] [GA] RECIPE_LOADED: Reboot-Restart-Shutdown.js [15.10.2021 10:51.42.673] [LOG] [GA] RECIPE_LOADED: with-MMM-pages-RL.js [15.10.2021 10:51.42.676] [LOG] [GA] RECIPE_LOADED: with-MMM-StopwatchTimer.js [15.10.2021 10:51.42.679] [LOG] [GA] RECIPE_LOADED: with-MMM-MP3Player-RL.js [15.10.2021 10:51.42.681] [LOG] [NPM] Initialized v0.9.96 [15.10.2021 10:51.42.692] [LOG] [NPM] Found: 14/22 @bugsounet library [MMM-GoogleAssistant] [15.10.2021 10:51.43.124] [LOG] [GA] Google Assistant is initialized. [15.10.2021 10:51.43.136] [LOG] [CAST] MagicMirror is listening on port 8569 [15.10.2021 10:51.43.143] [LOG] [GPHOTOS:AUTH] Token is alive. [15.10.2021 10:51.43.146] [LOG] [GPHOTOS] Getting Album info chunks. [15.10.2021 10:51.43.865] [INFO] Newsfeed-Fetcher: Broadcasting 24 items. [15.10.2021 10:51.43.950] [LOG] [GOVERNOR] Actual: ondemand [15.10.2021 10:51.43.951] [LOG] [GOVERNOR] Already set [15.10.2021 10:51.45.292] [LOG] [SCREEN] HDMI CEC unknow state [15.10.2021 10:51.45.293] [LOG] [SCREEN] Display -- Actual: false - Wanted: true [15.10.2021 10:51.45.298] [LOG] [SCREEN] Display ON. [15.10.2021 10:51.45.998] [LOG] [GPHOTOS] Getting Album info chunks. [15.10.2021 10:51.46.907] [LOG] [NPM] Details for MMM-GoogleAssistant [ { name: '@bugsounet/npmcheck', installed: '0.9.96', latest: '0.9.96' }, { name: '@bugsounet/cast', installed: '1.1.3', latest: '1.1.3' }, { name: '@bugsounet/governor', installed: '1.0.3', latest: '1.0.3' }, { name: '@bugsounet/internet', installed: '1.1.1', latest: '1.1.1' }, { name: '@bugsounet/pir', installed: '1.0.6', latest: '1.0.6' }, { name: '@bugsounet/screen', installed: '1.1.8', latest: '1.1.8' }, { name: '@bugsounet/spotify', installed: '1.0.5', latest: '1.0.5' }, { name: '@bugsounet/google-assistant', installed: '1.2.7', latest: '1.2.7' }, { name: '@bugsounet/node-buffertomp3', installed: '1.0.5', latest: '1.0.5' }, { name: '@bugsounet/node-lpcm16', installed: '2.0.1', latest: '2.0.1' }, { name: '@bugsounet/cvlc', installed: '1.0.5', latest: '1.0.5' }, { name: '@bugsounet/google-photos', installed: '1.0.0', latest: '1.0.0' }, { name: '@bugsounet/systemd', installed: '1.0.0', latest: '1.0.0' }, { name: '@bugsounet/cvlcmusicplayer', installed: '1.0.8', latest: '1.0.8' } ] [15.10.2021 10:51.46.915] [LOG] [NPM] Check... MMM-GoogleAssistant [15.10.2021 10:51.46.917] [LOG] [NPM] No update needed for MMM-GoogleAssistant [15.10.2021 10:51.49.652] [INFO] Calendar-Fetcher: Broadcasting 6 events. [15.10.2021 10:51.50.635] [LOG] [GPHOTOS] Getting Album info chunks. [15.10.2021 10:51.51.962] [LOG] [GPHOTOS] Getting Album info chunks. [15.10.2021 10:51.53.884] [LOG] [GPHOTOS:AUTH] Token is alive. [15.10.2021 10:51.53.885] [LOG] [GPHOTOS] Getting Album info chunks. [15.10.2021 10:51.55.843] [LOG] [GPHOTOS] Finish Album scanning. Properly scanned : 1 [15.10.2021 10:51.55.848] [LOG] [GPHOTOS] Initialized [15.10.2021 10:51.55.851] [LOG] [GPHOTOS] Initialization complete! [15.10.2021 10:51.55.852] [LOG] [GPHOTOS] Start first scanning. [15.10.2021 10:51.55.853] [LOG] [GPHOTOS] Start Album scanning [15.10.2021 10:51.55.855] [LOG] [GPHOTOS] Prepping to get photo list from 'To print' [15.10.2021 10:51.55.858] [LOG] [GPHOTOS:AUTH] Token is alive. [15.10.2021 10:51.55.860] [LOG] [GPHOTOS] Indexing photos now. total: 0 [15.10.2021 10:51.55.872] [LOG] [GPHOTOS] successfully loaded cache of 25 photos [15.10.2021 10:51.55.874] [LOG] [GPHOTOS] num to ref: 5 , DesChunk: 5 , totalLength: 25 , Pntr: 0 [15.10.2021 10:51.55.876] [LOG] [GPHOTOS:AUTH] Token is alive. [15.10.2021 10:51.55.877] [LOG] [GPHOTOS] received: 5 to refresh [15.10.2021 10:51.56.884] [LOG] [GPHOTOS] refreshed: 5 , totalLength: 25 , Pntr: 5 [15.10.2021 10:51.56.888] [LOG] [GPHOTOS] just sent 5 more picts [15.10.2021 10:51.57.006] [LOG] [GPHOTOS] Got 25 photo(s) from 'To print' [15.10.2021 10:51.57.110] [LOG] [GPHOTOS] Total indexed photos: 25 [15.10.2021 10:51.57.179] [LOG] [GPHOTOS] Photo list cache saved
-
“Of course, if you can move between for see react in log, it will be welcome”
–> I am more than happy to do that if you can provide me with some instructions. -
Hello if i can help, i think u have one error of MMM-GABackground if u correct this just go to the wiki and install it : http://wiki.bugsounet.fr/en/MMM-GABackground
and for error of PIR i have just run : “npm run rebuild” inside GA directory -
The GABackground is installed according to the wiki and I’ve run a git pull and update and it’s all up to date. So not sure what’s causing the error. Is GABackground used for PIR?
I have run npm run rebuild in MMM-GoogleAssistant but the PIR problem persists.
-
[15.10.2021 10:51.31.616] [ERROR] ReferenceError: Log is not defined
at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-Jast/MMM-Jast.js:14:4347)if a module crash on loading GA will not load and execte any rules
can you correct `MMM-Jast’ module and retry
Note: if not works again
disable all modules and keep only detector and GA, naturaly, retstart MM for retry
-