rejas / MMM-MotionDetector

This is a motion detector module for MagicMirror
MIT License
53 stars 11 forks source link

Monitor stays on #22

Closed SdeGeata closed 4 years ago

SdeGeata commented 5 years ago

I just installed your module, used the config as is from the read me. Modified for PiCam and rebooted, but nothing happens - the monitor just stays on. Any suggestions?

rejas commented 5 years ago

did you turn on the UI of the module? If yes, did it measure any score? can you see if there are any errors on the console?

SdeGeata commented 5 years ago

When you say "turn on" do you mean drop the module in the config.js? If so, yes. I see the debug output on the screen - nothing important it would seem though. It looks like the screen-shot attached, and output never changes.

Screen Shot 2019-06-24 at 1 55 26 PM

rejas commented 5 years ago

okay, so the module is loaded :-) have you followed the steps in the README on how to enable the pi cam ?

SdeGeata commented 5 years ago

Yup, did that too. image

rejas commented 5 years ago

Can you enable the developer tools on your electron instance and look for errors ?

SdeGeata commented 5 years ago

Electron?

rejas commented 5 years ago

Thats the UI Window MagicMirror runs in :-)

SdeGeata commented 5 years ago

The error found in Developer tools:

`MMM-MotionDetector.js:76 MMM-MotionDetector: DiffCamEngine init failed. NotReadableError: Could not start video source initErrorCallback @ MMM-MotionDetector.js:76

`

rejas commented 5 years ago

Last question :-) What adress is your MM running on?

SdeGeata commented 5 years ago

192.168.1.108

rejas commented 5 years ago

Thats the one in your config.JS? Because my module only runs in localhost or https URLs since Elektron demands that for camera access

SdeGeata commented 5 years ago

Ah, gimme a sec...

yup, set to localhost.

rejas commented 5 years ago

Grmpf.. Now I am stuck, since I dont habe a pi cam to actually test my module against. Could only add more debugging to it. Could you post your whole console output to this ticket? Will take a look at it later...

SdeGeata commented 5 years ago

This is all of it from "errors & warnings";

`/home/pi/MagicMirror/node_modules/electron/dist/resources/electron.asar/renderer/security-warnings.js:127 Electron Security Warning (Insecure Resources) This renderer process loads resources using insecure protocols.This exposes users of this app to unnecessary security risks. Consider loading the following resources over HTTPS or FTPS.

For more information and help, consult https://electronjs.org/docs/tutorial/security. This warning will not show up once the app is packaged. warnAboutInsecureResources @ /home/pi/MagicMirror/node_modules/electron/dist/resources/electron.asar/renderer/security-warnings.js:127 /home/pi/MagicMirror/node_modules/electron/dist/resources/electron.asar/renderer/security-warnings.js:184 Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security Policy set or a policy with "unsafe-eval" enabled. This exposes users of this app to unnecessary security risks.

For more information and help, consult https://electronjs.org/docs/tutorial/security. This warning will not show up once the app is packaged. warnAboutInsecureCSP @ /home/pi/MagicMirror/node_modules/electron/dist/resources/electron.asar/renderer/security-warnings.js:184 undefined:1 Failed to load resource: the server responded with a status of 404 (Not Found) MMM-MotionDetector.js:76 MMM-MotionDetector: DiffCamEngine init failed. NotReadableError: Could not start video source initErrorCallback @ MMM-MotionDetector.js:76`

rejas commented 5 years ago

Got to admit that I cant help you from here, that pi cam doesnt seem to work. Maybe @rev138 who provided the original fix for the pi cam can help here?

rev138 commented 5 years ago

@SdeGeata : Can you run this is and post the output?

sudo lsmod | grep bcm2835-v4l2

rev138 commented 5 years ago

Another thought -- make sure the camera is connected to the right port. There are two identical looking connectors on the board. One's for the camera, the other isn't. I've made that mistake :)

SdeGeata commented 5 years ago

Hello rev138;

I ran your command line, no output in terminal and nothing changed in MM. Same output from the developer tools:

Failed to load resource: the server responded with a status of 404 (Not Found) MMM-MotionDetector.js:76 MMM-MotionDetector: DiffCamEngine init failed. NotReadableError: Could not start video source initErrorCallback @ MMM-MotionDetector.js:76

As far as the camera port; I am indeed connected to the correct one. It is already bing used effectively for MotionEye.

SdeGeata commented 5 years ago

I appear to have gotten it to work! I am troubleshooting some issues with MMM-Facial-Recognition-OCV3 and I turned off the Motion-Detection module as well as MotionEye to see what would happen. No change in the one I was troubleshooting for, but i turned back of MMM-MotionDetector and suddenly got output on the debug. I waited 2 minutes and the monitor shut off!

So it would seem I can't use the same camera for MMM-MotionDetector and MotionEye? Do you think there's a work-around for this conflict, or should I just get a second camera module?

SdeGeata commented 5 years ago

I would like to know however, how do I hide the debug info now while the module is running?

rejas commented 5 years ago

Sorry for being not responsive @SdeGeata your issue got buried :-( As for the conflict between this module and motioneye I cant help you with any new ideas To hide the debug info, you just have to remove the line "position: ...." you have in your config under the MMM-MotionDetector settings.

airart commented 4 years ago

great job, I wanted to know if it's possible to go to sleep with a clock module and not turn off the monitor. the final goal is to put a clock module as a screensaver and wake up the MM with the ps3cam that works well

rejas commented 4 years ago

Thx for the praise @airart BUt I dont understand your question or what you want to do. Could you open new issue for that and rephrase it please?