Read the statement by Michael Teeuw here.
Motion Detector
-
@reaper81 I had the following in my config.js:
{ module: 'motiondetector', config: { timeout: 5*60*1000 } },You will need to ensure that the 3 files are located in the modules/motiondetector folder.
I ended up using a different method for motion detection though, as tvservice kept stopping working.
-
So after far too many months, I’ve finally gotten my mirror put together. Everything is working great, except for this module (sometimes). After a reboot everything works at least once, meaning that the monitor will turn off when no motion is detected and turn on once motion is detected. Sometimes, it will work correctly for an entire day. Others, it will work once and then the monitor will not turn back on until I reboot the pi. After the monitor refuses to wake up, I receive the following in the pm2 logs when it does detect motion.
0|mm | monitor :state 0x7ee68dbc [HDMI unknown AR x38128 HDCP], 2129038664x4287062190 @ 45744.00Hz, interlaced 0|mm | monitor :state 0x7ee8bdbc [HDMI unknown AR x13552 HDCP], 2129182024x4287062190 @ 21168.00Hz, interlaced 0|mm | monitor has been deactivated 0|mm | monitor :state 0x7ebe5dbc [HDMI unknown AR x25840 HDCP], 2126404936x4287062190 @ 33456.00Hz, interlaced 0|mm | monitor :state 0x7e9afdbc [HDMI unknown AR x13552 HDCP], 2124086600x4287062190 @ 21168.00Hz, interlaced 0|mm | monitor has been deactivated 0|mm | monitor :state 0x7e8dadbc [HDMI unknown AR x21744 HDCP], 2123214152x4287062190 @ 29360.00Hz, interlaced 0|mm | monitor :state 0x7efdcdbc [HDMI unknown AR x54512 HDCP], 2130562376x4287062190 @ 62128.00Hz, interlaced```Does anyone have any thoughts on how to prevent this from happening? Is there a better place to look at logs other than pm2 to see exactly what is happening. It is very odd to me that it works for different amounts of time after each reboot.
For what it’s worth, when the screen stops waking up, I can navigate to rasperrybi.local:8080 in a browser and all of the modules are up and running.
Any thoughts or comments are appreciated.
-
@jdahli1
I don’t know this error, therefore the following two comments might be totally wrong:The motion detector uses
/opt/vc/bin/tvservice --preferred && sudo chvt 6 && sudo chvt 7to switch the monitor on. What happens if you execute this command manually while the observed problem occurs (I assume you can still login to the PI?). Then you might know weather it is a problem of the motion detection (and MMM) or if it is a more general problem. Maybe you even get additional error messages that help you to identify the problem
- Do you know the HDMI-settings in /boot/config.txt ?
Maybe it is worth to play around withhdmi_force_hotplug,hdmi_drive,hdmi_groupandhdmi_mode. See the file and here https://raspberrypi.stackexchange.com/tags/config.txt/info for more information. Maybe the “AR” in your error stands for “aspect ratio”, this could be set explicitly be these parameters.
If somebody got this module to work on a Raspberry Pi Zero (using the Midori browser) I would be highly interested in how it was done!
- Do you know the HDMI-settings in /boot/config.txt ?
-
@Hawking Thank you for the reply. Running that command does not appear to do anything. I let it sit for a minute and the command never completes, nor does the screen come on. It will sit until I ctrl + c. I will start to mess with the hdmi settings and see if that makes any difference.
-
@jdahli1
Can you just execute/opt/vc/bin/tvservice --preferredto see if it is tvservice or chvt that does not respond?Here https://news.screenly.io/how-to-automatically-turn-off-and-on-your-monitor-from-your-raspberry-pi-5f259f40cae5 also problems with turning the screen back on using tvservice are mentioned. Maybe the other methods mentioned in the article are worth a try. If they work you can simply change the commands used in
~/MagicMirror/modules/motiondetector/node_helper.js -
@Hawking So running that command has the same result - nothing happens until I ctrl + c. I have been messing with the hdmi_* commands, but no luck so far.
-
Can I use the Pi-Camera for Motion Detection and Face-Recognition at the same time or have I to use seperate cameras for each module?
-
@reaper81 said in Motion Detector:
Can I use the Pi-Camera for Motion Detection and Face-Recognition at the same time or have I to use seperate cameras for each module?
This uses a pir-sensor
-
@reaper81 You can use the same camera for both, but you’ll want to use a different module for motion detection. If you check out my posts, I put up a tutorial on using the PiCam for motion detection outside of the MirrorMirror framework. There’s no reason you can’t use my tutorial to get motion detection to turn your mirror display on and then the facial recognition module to switch the layout.
At least… no reason that I know of.
-
@jdahli1 Anyone have any thoughts as to what else to try? I have had no luck so far. Mirror continues to not turn back on randomly. Nothing I have changed so far seems to have worked. Any thoughts are appreciated.
-
Hello all,
I m totally new to Raspberry Pi and it’s an absolute miracle that I succeed to make it works and to add some modules .
So I feel sorry to ask and I beg your pardon if my request hurts some of you but can someone could explain me how to install this module ?
So far I’ve only installed the ones in the MichMich page (https://github.com/MichMich/MagicMirror/wiki/MagicMirror²-Modules)
Sorry again to ask but I’m so affraid to “break” my magic mirror which works fine now !
if I disturb let me know I will delete my post.Thanks for your help
Nat
-
cd ~/MagicMirror/modules git clone https://github.com/alexyak/motiondetectorIn your config.js
{ module: "motiondetector" },I think it would work, maybe…
-
Thank you so much Sean, I will try this at home tonight !
Thanks again for your patience and quick reply !
Nat -
@Natacha3 said in Motion Detector:
I’m so affraid to “break” my magic mirror which works fine now !
Suggestion:
Make a backup image of your mirror’s SD card.
You’ll sleep better. :^)
-
@Natacha3 I second @Mykle1 's suggestion to make a backup of your SD card, especially before you make any significant change. This way if you mess up the change, you can revert to your backup and try again. Furthermore, take another backup immediately after you are successful in implementing the new change. This way if you SD card becomes corrupt and unbootable (say due to a power outage, pulling the power cable without a proper shutdown, etc), you’ll have a fully up-to-date backup that you can restore in 30 minutes or so. This will save you many MANY tears.
-
So I’ve installed motion detector as Sean explained
I’ve modified the config.JS file, restarted the mirror but no change!Is there something more to do to activate this function ?
- @Mykle1 and @j-e-f-f => I’ve done as you said: back up done! Thank your for your kind advice and … yes! I sleep better and I expect no tears now ;-)
-
@Natacha3 I had issues with Motion Detector, so ended up installing motion alongside Magic Mirror and using that - https://github.com/Motion-Project/motion
-
@Natacha3 it took me a while to get my motion detector to work too. I suggest making a simple script independent of MagicMirror to test that your PIR sensor is working and tuned correctly. Mine has two adjustment screws on it that I needed to play with before it behaved properly.
More information here:
https://www.raspberrypi.org/learning/physical-computing-with-python/pir/ -
@j.e.f.f Thank you again Jeff but … I use a Pi camera, not a PIR sensor ! ;-)
I’ve checked that the camera was operating normally (sorry again, I’m not able to recover the link but … at least i’ve seen the picture !
-
@mongo116 Thank you for your advice but I’m a complete ignorant and I must admit that I’ve been affraid by reading https://github.com/Motion-Project/motion/blob/master/motion_guide.html
As a total noob, I guess it’s a bit out of reach for me. (maybe after 3 or 4 decades I will play the easy side with that ! ) ;-)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login