Giter Club home page Giter Club logo

mmm-motiondetector's Introduction

mmm-motiondetector's People

Contributors

bavario avatar dependabot[bot] avatar rejas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mmm-motiondetector's Issues

Problem

IMG_20230630_161611
IMG_20230630_161602
Hello
Je n'arrive pas à le faire fonctionner alors que j'ai bien ma caméra pi qui fonctionne

accessing other computers cameras

Hi rejas,
I almost got it working with MMM-Remote-Control.
As I swtiched to HTTPS, the module is now working with the IP 0.0.0.0. ("listen on any Interface")
BUT. When starting the MM my Chrome Browser asked if the MMM-Remote Website can access my camera.
Now the Monitor turns on/off based on my computers Webcam.. the RPI-CAM is ignored.

any idea how to use the right cam / video-stream?

thanks
Misch

Old node_helper.js

Hi rejas, after doing some google and trying countless of methods, there was one guy mentioning using the default driver. So would you mind sharing me the old node_helper.js? I think the default driver lasts longer than a bit. Sorry for bothering you too much btw i love this module but can't seem to work pretty well for me

I got errors when i try to make a pull

I got some errors i cant get rid of while im trying to update the module.
error: Pulling is not possible because you have unmerged files. hint: Fix them up in the work tree, and then use 'git add/rm <file>' hint: as appropriate to mark resolution and make a commit. fatal: Exiting because of an unresolved conflict.
And when i try to stash with the command git stash i got this error
package-lock.json: needs merge package.json: needs merge package-lock.json: needs merge package.json: needs merge package-lock.json: unmerged (138c0d54d2895c9efc141d82345a2bd6fd0220d9) package-lock.json: unmerged (afe6a50cfcefb524404b9841c04008f34fe240f6) package.json: unmerged (d0322f03a60de3da38074e6e065bd72d6bcf24bf) package.json: unmerged (0a749534eefef45cdce68020289d1979c982654c) fatal: git-write-tree: error building trees Cannot save the current index state
I would like some help with this.

Another module that requires MagicMirror address to be 0.0.0.0

I know that is a segment that indicates how to set up a reverse proxy for the other module, but i have two questions.

  1. How to install http-proxy-middleware
  2. The routes.json and proxyserver.js files, where they should be added?

Im trying to make it work with the MMM-Remote-Control. I dont know if someone made it.

Issue with Mac Mini

The old version worked perfectly on my Mac mini with Catalina. After the update the monitor is not turned off anymore. I see the motion in the Display debug information UI and don't get any error messages, but the monitor stays on. The funny thing is that it shows the off time correctly in the UI even though the monitor is always on. Any idea what could be wrong?
If I try "pmset displaysleepnow" direct in terminal, my screen goes to sleep successfully.

My changes as it used to work on the Mac with the Old version:

``
const NodeHelper = require("node_helper");
const exec = require("child_process").exec;

module.exports = NodeHelper.create({
start: function () {
this.started = false;
this.isMonitorOn(function(result) {
console.log("MMM-MotionDetector: monitor on " + result);
});
},

activateMonitor: function () {
	this.isMonitorOn(function(result) {
		if (!result) {
			exec('caffeinate -u -t 1', function(err, out, code) {
				if (err) {
					console.error("MMM-MotionDetector: error activating monitor: " + code);
				} else {
					console.log("MMM-MotionDetector: monitor has been activated");
				}
			});
		}
	});
	this.started = false;
},

deactivateMonitor: function () {
	this.isMonitorOn(function(result) {
		if (result) {
			exec('pmset displaysleepnow', function(err, out, code) {
				if (err) {
					console.error("MMM-MotionDetector: error deactivating monitor: " + code);
				} else {
					console.log("MMM-MotionDetector: monitor has been deactivated");
				}
			});
		}
	});
	this.started = false;
},

isMonitorOn: function(resultCallback) {
	exec('pmset -g powerstate IODisplayWrangler | tail -1 | cut -c29', function(err, out, code) {
		if (err) {
			console.error("MMM-MotionDetector: error calling monitor status: " + code);
			return;
		}

		console.log("MMM-MotionDetector: monitor " + out);
		resultCallback(out.includes("=1"));
	});
},

// Subclass socketNotificationReceived received.
socketNotificationReceived: function (notification, payload) {
	if (notification === "MOTION_DETECTED" && this.started === false) {
		console.log("MMM-MotionDetector: MOTION_DETECTED, score " + payload.score);
		this.started = true;
		this.activateMonitor();
	}
	if (notification === "DEACTIVATE_MONITOR" && this.started === false) {
		console.log("MMM-MotionDetector: DEACTIVATE_MONITOR, percentage off: " + payload.percentageOff);
		this.started = true;
		this.deactivateMonitor();
	}
}

});
`

Deactivates monitor but will not wake up

I have a Logitech camera installed via USB that the PI recognizes. This is a fresh install with the newest build. The module blanks the screen but never wakes up. I have been looking at the logs below but do not see what is the issue. (Also using the legacy video driver not OpenGL)

Starting MagicMirror: v2.5.0
Loading config ...
Loading module helpers ...
No helper found for module: alert.
Initializing new module helper ...
Module helper loaded: updatenotification
No helper found for module: clock.
Initializing new module helper ...
Module helper loaded: MMM-MotionDetector
Initializing new module helper ...
Module helper loaded: calendar
No helper found for module: compliments.
No helper found for module: currentweather.
No helper found for module: weatherforecast.
Initializing new module helper ...
Module helper loaded: newsfeed
All module helpers loaded.
Starting server on port 8080 ...
Server started ...
Connecting socket for: updatenotification
Connecting socket for: MMM-MotionDetector
Connecting socket for: calendar
Starting node helper for: calendar
Connecting socket for: newsfeed
Starting module: newsfeed
Sockets connected & modules started ...
MMM-MotionDetector: monitor on true
MMM-MotionDetector: monitor state 0x120009 [HDMI DMT (4) RGB full 4:3], 640x480 @ 60.00Hz, progressive

Launching application.
MMM-MotionDetector: MOTION_DETECTED
MMM-MotionDetector: monitor state 0x120009 [HDMI DMT (4) RGB full 4:3], 640x480 @ 60.00Hz, progressive

Create new calendar fetcher for url: http://www.calendarlabs.com/templates/ical/US-Holidays.ics - Interval: 300000
Create new news fetcher for url: http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml - Interval: 300000
MMM-MotionDetector: DEACTIVATE_MONITOR
MMM-MotionDetector: monitor has been deactivated
MMM-MotionDetector: monitor state 0x120009 [HDMI DMT (4) RGB full 4:3], 640x480 @ 60.00Hz, progressive

Thanks for any help!

Only secure origins are allowed

When I run the module I get the following errors in the console log:

diff-cam-engine.js:106 [Deprecation] getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.

MMM-MotionDetector.js:77 MMM-MotionDetector: DiffCamEngine init failed. NotSupportedError: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).

MMM-Screencast and MMM-MotionDetector are incompatible

I have the MMM-MotionDetector which works just fine until i play a video with the MMM-Screencast module, when the screen turns off again after i play a video on youtube, it doesnt turn on again.
Someone had the same problem?
Sorry for my english.

Multi-Camera issue

I have 2 camera's connected to my Pi, another app is using one of the cams, which MotionDetector keeps trying to use and fails with error...
NotReadableError: could not start video source

Monitor stays on

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?

Not working and console errors

It doesn't seem to work (Raspbian Stretch).

Once MagicMirror starts, I have this output:

MMM-MotionDetector: MOTION_DETECTED
MMM-MotionDetector: monitor display_power=1

and no further output from the module appears regardless of any motion.

This is my configuration:

		{
		        module: 'MMM-MotionDetector',
		        config: {
		                captureIntervalTime: 1000,
		                scoreThreshold: 200,
		                timeout: 3000
		        }
		}

What I get in the browser console is this error:
image

error calling monitor status: /bin/sh: 1: vcgencmd: not found

Hello firstly congrats for this module, I'm currently trying to use an iMac 27" running on linux distro (Pop_OS which is Ubuntu basically) and I got this error causing my monitor is never going black :

[12.11.2021 15:38.04.598] [ERROR] MMM-MotionDetector: error calling monitor status: /bin/sh: 1: vcgencmd: not found

Those error happens every time the module try to activate or deactivate the monitor.
I've read online that vcgencmd is a package only available on Raspberry PI.
Hove you in mind a solution or an alternative package that would work on other distro that raspPI ?

Thank you

Use in conjunction with mmm-remote-control

Hi rejas!
Thank you for your awesome work as this module works perfectly for me. However, i sometimes need to update my MagicMirror through mobile and since this module doesn't work with fake kms + localhost, this conflicts with MMM-Remote-Control module as it requires the MagicMirror's address to be 0.0.0.0 and uses fake kms driver!
Have you found any solution for this yet?

iMac monitor not shutting off

Hello there, we've installed Magic Mirror on an old iMac 2007 with Ubuntu in our design studio, as a smart screen companion for colleagues. Your module is working perfectly with the cam, detecting motion. Although the screen never turns off.
According to what I red on screen, I presume it thinks to have shut it of .. but it remains awake.
Am I missing something? Can I help troubleshooting the issue?

Stay safe!
Luca C.

Camera not turning screen off

Using latest version of MM
raspbian strech
logtiech c110 webcam
installed the module, and it is registering motion perfectly
small motion gives small values, walking by give big values.
no issues installing , and no issue with compatibility.
but screen is not turning off.

any ideas?

Gets deactivated somehow

Hi again, sorry to be such a bother. So I came home again tonight and MMM-Motion-Detector was not active ( no red light on the PSeye camera). After manually sending the screen on command I was looking at my MagicMirror screen.

Is there anyway to check a log or something to see how/when/why mmm-motiondetector stopped responding? I tired looking at pm2 logs but wasn't really sure about it.

I did notice one thing, every time mmm-notification sends a notification to mmm-googleroute to refresh.....the camera " detected motion"

MotionDetector + Facial recognition

Hello Rejas!
I'm using your module and it is fabulous!

Now, I want to add a facial recognition.
I have a python script, witch verify what person are in front of my mirror.
The script works fine, and I want add it to the MotionDetector module.

My idea is:
Detection motion
turn on the screen and run the script
if script return >75 (% of recognition)
exec notification to show more modules
else break, continue or nothing

Can you help me with this feature? Thanks!

Deactivates monitor but will not wake up

Hello,

I want to use this module but I have a problem. Indeed, the module deactivates the screen but it does not reactivate it.
My screen is a television connected to the PI by an HDMI cable. I am using CEC Utils to be able to manage the screen with crontab. The commands that are working to turn on and off the screen are:

echo on 0 | cec-client -s -d 1 == Turn on the screen
echo standby 0 | cec-client -s -d 1 == Turn off the screen

How could I integrate these commands in your module?

Thanking you in advance,

Regards,

Cant wake up from sleepmode , Ctrl+Q solves it , how to script that.

So I have my Pi4 running alexapi trough rc.local on startup.
I have a nice multi module Magic mirror with the mmm-motion detect. The MM is autobooted trough pm2 (standard installer mm.sh in installers folders).

When everthing boots up and the mirror goes to sleep mode it wont rewake... when pressing ControlQ after a while the mirror is online and then everything works fine... It then can go idle for ages and comes right back on .. How do I solve this to work on autoboot in stead of manually pressing crtl+q in sleepmode ...? :(

Screen does not power off

Hello,

I started to reuse my magic mirror after like 2 years or so. Back then when I used the MM this module worked perfectly fine (using the PS camera).
I recently had to rebuild my MM because my SD card died and I try to set this module up again and it seems to detect properly. The issue is that the screen does not turn off although it is shown that the screen was shut off. Is it somehow related to power settings of the pi?

Thank you in advance for any tip.

Testing results

First, thank you for the module!
Second, I just tested this on a RPi4 4GB and the RpiCam. Worked great. I had to fiddle around with the address & IP whitelist, but I got it working without having to do the proxy thing.

I second the request to customize the notification send on motion detection.

Cannot use/load this module

Hi,

Just wanted to experiment with this module, using a Trust gxt 1160 vero USB webcam.

Upon adding this module into the config, MM just stays black.
Error log content:

WARNING! Could not load config file. Starting with default configuration. Error found: TypeError: Bind must be called on a function
App threw an error during load
TypeError: Bind must be called on a function
at bind ()
at /home/pi/MagicMirror/js/logger.js:25:38
at Object. (/home/pi/MagicMirror/js/logger.js:27:3)
at Object. (/home/pi/MagicMirror/js/logger.js:29:3)
at Module._compile (internal/modules/cjs/loader.js:711:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
at Function.Module._load (internal/modules/cjs/loader.js:551:3)
at Module.require (internal/modules/cjs/loader.js:658:17)
TypeError: Bind must be called on a function
at bind ()
at /home/pi/MagicMirror/js/logger.js:25:38
at Object. (/home/pi/MagicMirror/js/logger.js:27:3)
at Object. (/home/pi/MagicMirror/js/logger.js:29:3)
at Module._compile (internal/modules/cjs/loader.js:711:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
at Function.Module._load (internal/modules/cjs/loader.js:551:3)
at Module.require (internal/modules/cjs/loader.js:658:17)
/proc/self/exe: /lib/arm-linux-gnueabihf/libdbus-1.so.3: no version information available (required by /proc/self/exe)

The config.js section:

            {
                    module: "MMM-MotionDetector",
                    position: "top_left", // Optional. This can be any of the regions. Displays debug informations.
                    config: {
                            captureIntervalTime: 1000,
                            scoreThreshold: 20,
                            timeout: 120000,
                    }
            },

My MM is listening on localhost:8080 (not on 0.0.0.0).
http, not https (I don't know how to make it listen on https)

Any tips?

Not working with Acer Aspire One D260 camera

Hi rejas!, Cool idea. Which cameras will work? I'm just playing around with an old Acer Aspire One D260. Atom CPU, 2 GiB RAM and 160 GiB HDD and Xubuntu 16.4.3 LTS. It has a buid-in webcam, which I would like to use for motion detection. I installed the module, set the timeout to 6000 for testing, covered the cam, but nothing happens. The module doesn't turn off the screen. To doublecheck, if the camera works, I installed "Cheese" (a webcam utility) and I can take fotos and videos with the cam. Any idea? Or will it work only with the RPi-Cam? Thanks in advance and regards from Berlin @Wominator

What I found in the mm-out-0.log:

[email protected] start /home/wominator/MagicMirror
sh run-start.sh

Starting MagicMirror: v2.1.3
Loading config ...
Loading module helpers ...
No helper found for module: alert.
Initializing new module helper ...
Module helper loaded: updatenotification
No helper found for module: MMM-TextClock.
No helper found for module: currentweather.
No helper found for module: weatherforecast.
Initializing new module helper ...
Module helper loaded: calendar
Initializing new module helper ...
......
Module helper loaded: MMM-MotionDetector
All module helpers loaded.
Starting server on port 8080 ...
Server started ...
Connecting socket for: updatenotification
Connecting socket for: calendar
Starting node helper for: calendar
Connecting socket for: MMM-PublicTransportBerlin
Connecting socket for: MMM-DWD-WarnWeather
MMM-DWD-WarnWeather helper started...
Connecting socket for: newsfeed
Starting module: newsfeed
Connecting socket for: MMM-Remote-Control
Starting node helper for: MMM-Remote-Control
Connecting socket for: MMM-MotionDetector
Sockets connected & modules started ...
monitor on: true
monitor :
Launching application.
Create new calendar fetcher for url: https://calendar.google.com/calendar/....
Create new news fetcher for url: http://www......
monitor :
Transportation fetcher for station Berlin, XYZ-Str. created. (Station ID: 90XYZ)
monitor has been deactivated
monitor :
monitor :
monitor has been deactivated
monitor :
monitor :
monitor has been deactivated
monitor :
monitor :
monitor has been deactivated
monitor :
monitor :
monitor has been deactivated
monitor :
monitor :
monitor has been deactivated
monitor :
monitor :
monitor has been deactivated
monitor :
monitor :
monitor has been deactivated
monitor :
monitor :
monitor has been deactivated
monitor :
monitor :
monitor has been deactivated
monitor :
monitor :
monitor has been deactivated
monitor :
monitor :

It looks like, the module wants to turn of the screen, but it is switched on directly again.

Which other logs would you need?

Works for a while, then not waking up again

Cheers,
just set up a fresh MagicMirror on a Raspberry 4. As cam i‘m using an USB camera module with an OV3360 chip. If needed, i will post a link to the cam.

The problem I have is, that it works just fine for a while (~1 hour). When no motion detected, display goes off and back on again when motion is detected. But after a while it doesnt switch the display back on.

When connected via VNC to the mirror the mirror runs normal (using MMM-scenes, it keeps switching pages).

I also can turn the display back on with vcgencmd display_power 1 via ssh. Plus, after ctrl+R to reload the mirror, it still doesnt detect motion, as if only the USB port/cam is frozen.

Any help would be appreciated. Thanks

Edit:

  • the camera is then still listed under lsusb
  • tested all USB slots, same issue
  • it seems like the raspberry saves the display_power state: it shuts down automatically on a specific time. When starting up again at the next day, display_power is still off. Only after a few reboots it goes back on. Any solution for this? I thought about setting display_power to 1 before shutdown.

Change motion detector action

Sorry for my bad english
Hello , is it possible to modify the module and make it display only a specified module when the cam detect a motion ?
It’s useful now but it turn off the TV and I’m forced to turn on manually After 5 minutes of inactivity
Ma goal is use your module to switch to a full screen clock to a normal MM
Tanks u so much

It works.....but after a while entire pi goes to some kind of sleep?

I have the module up and running properly ( I think) I am using the PSEEYE camera as indicated in your readme.md. everything works pretty ok for the most part....screen turns off, motion, screen turns on.

I tried it for an extended period of time though and when I woke up this morning I couldn't get the screen to come on, the red light on the camera ( indicating watching) is also off. Even manually turning the screen on I have no signal....and trying to use the keyboard and mouse doesn't wake it up.

The pi is powered on still...and when I ping it it is accessible and I can SSH into it properly.

Do you haver any ideas?

Reverse Proxy

Would you be able to show how to config the proxy server? I would like to have parallel access to both MotionDetector & Remote Control but I'm confused on how to set it up

Possible to use ip/port feed from MotionEye on host pi?

I'm using a pi cam. I've configured as the readme specifies. I've added the bcm2835-v4l2 to the modules.conf. I've tried commenting out address in MM config.js (btw I'm using a static local IP for my pi, not sure if that's related). The UI shows "NotReadableError: Could Not Start Video Source".

I should also mention that the pi cam is also being used by MotionEye. In MotionEye, the camera is setup as MMAL camera type and vc.ril.camera as camera device. Not sure if any of that is pertinent.

I'm super green with programming/linux/python, mostly following step by step tutorials.

motion not detected after last MM update

hi,
i have updated MM to version 2.15.0 and motionDetector stop working. The module starts but motion is no longer detected, so the monitor turns off and never turns on again.
I've the last MMM-MotionDetector version and a pi camera.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.