MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Motion Detector

    Scheduled Pinned Locked Moved Utilities
    213 Posts 38 Posters 525.5k Views 39 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • bheplerB Offline
      bhepler Module Developer @DirkS
      last edited by

      @DirkS Interesting. Following the instructions I found via the GitHub MagicMirror repository, the pm2 should be using /home/pi/mm.sh to start the magic mirror process. Editing this file and appending DEV should give you the web browser console with log.

      1 Reply Last reply Reply Quote 0
      • D Offline
        done @cpramhofer
        last edited by

        Hi and thanks to everybody making this module work!

        @cpramhofer Did your solution solve the issue that the monitor did not switch on again after a longer period of time?

        bheplerB 1 Reply Last reply Reply Quote 0
        • bheplerB Offline
          bhepler Module Developer @done
          last edited by

          @done Wait, does it work for you? Because it’s not working for me and this is the last thing I need before my mirror is done.

          D 1 Reply Last reply Reply Quote 0
          • D Offline
            done @bhepler
            last edited by

            @bhepler Sorry, I haven’t tried yet. :)
            I installed the cam and the module yesterday and motion detection worked.
            But I experienced the same issue this morning. Wake up problem is not solved.

            strawberry 3.141S 1 Reply Last reply Reply Quote 0
            • strawberry 3.141S Offline
              strawberry 3.141 Project Sponsor Module Developer @done
              last edited by

              @done propably everything is working for you guys and you can just see the screensaver, be sure to disable the screensaver

              Please create a github issue if you need help, so I can keep track

              D bheplerB 2 Replies Last reply Reply Quote 1
              • D Offline
                done @strawberry 3.141
                last edited by

                Hi @strawberry-3.141
                Thanks for your answer
                I disabled the screensaver by editing (found here
                Is that what you had in mind?

                sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart

                @lxpanel --profile LXDE-pi
                @pcmanfm --desktop --profile LXDE-pi
                #@xscreensaver -no-splash

                @xset s off
                @xset -dpms
                @xset s noblank
                @unclutter

                Strange that my camera driver was not working today.
                I had to activate the cam in the pi config again.

                In the morning the cam led was on but when I tried to wake up the monitor the led just turned off.

                I use a v1.3 cam on a rpi3.

                strawberry 3.141S 1 Reply Last reply Reply Quote 0
                • strawberry 3.141S Offline
                  strawberry 3.141 Project Sponsor Module Developer @done
                  last edited by

                  @done Personally I don’t have a mirror myself, but I heard from other users in this forum they had problems with the screensaver when they tried to wake up the mirror using my voice module. They could see the mirror got brighter, but the screen was still black because of the screensaver. I would connect a mouse or keyboard and do some action to see if there is a screensaver active.

                  Please create a github issue if you need help, so I can keep track

                  D 1 Reply Last reply Reply Quote 0
                  • D Offline
                    done @strawberry 3.141
                    last edited by

                    @strawberry-3.141 Ok, I’ll give it a try. Tomorrow morning, I will test again. Thx!

                    cowboysdudeC 1 Reply Last reply Reply Quote 0
                    • B Offline
                      bibi
                      last edited by

                      hello! as understood there are 2 topics ongoing here "PIR module of @cowboysdude " and "motiondetector of @alexyak ". I will not ask which is the best module, you both did a great job, thx!
                      don’t take it bad but i just wanted to have opinions and feedback on which one is running currently without any, less issues please? (i am starting my mirror and don’t want to be too much demanding on the forum if not working - wise ;-))

                      @cowboysdude : i have already implemented Paviro’s module to test and i wanted to know if i should remove it before installing your one?

                      Thx in advance for your relpies and have a good day/eve :)

                      cowboysdudeC 1 Reply Last reply Reply Quote 0
                      • cowboysdudeC Offline
                        cowboysdude Module Developer @bibi
                        last edited by

                        @bibi said in Motion Detector:

                        hello! as understood there are 2 topics ongoing here "PIR module of @cowboysdude " and "motiondetector of @alexyak ". I will not ask which is the best module, you both did a great job, thx!
                        don’t take it bad but i just wanted to have opinions and feedback on which one is running currently without any, less issues please? (i am starting my mirror and don’t want to be too much demanding on the forum if not working - wise ;-))

                        @cowboysdude : i have already implemented Paviro’s module to test and i wanted to know if i should remove it before installing your one?

                        Thx in advance for your relpies and have a good day/eve :)

                        Honestly I will you this… I liked the motion sensor BUT @ianperrin worked out a module scheduler that I liked much better! I can turn modules off and on at specific times and turn it all off when I"m not home only to have it back on again when I arrive home.

                        All-in-all it really depends on your needs. NOTHING is without issues of some kind. I just really disliked the PIR sensor sticking out …

                        I hoped this help you in some way.

                        OH but of course @strawberry-3-141 also made a voice module that you can just tell the mirror to turn off too :) The usb mike is about the same price as a pir sensor!!! It’s REALLY awesome!!!

                        B 1 Reply Last reply Reply Quote 0
                        • cowboysdudeC Offline
                          cowboysdude Module Developer @done
                          last edited by

                          @done said in Motion Detector:

                          @strawberry-3.141 Ok, I’ll give it a try. Tomorrow morning, I will test again. Thx!

                          WORST case senario is you install a screen saver program and disable it… period. :)

                          1 Reply Last reply Reply Quote 0
                          • B Offline
                            bibi @cowboysdude
                            last edited by bibi

                            @cowboysdude 1st thx for taking time to reply. much appriciated! the PIR is ok but as it needs to get hidden somewhere, etc it’s less convinent. Yes you are right, the solution depends on my personnal need… i just need a way to switch on MM when i am in front of it BUT also completly switch off the monitor when nothing detected and not only the MM.
                            oh great, i will check @strawberry-3-141 module for sure!
                            @IngmarSwart also designed a solution with motion detection with a Picam behind the glass which seems to be nice to. i let you check it if interest…

                            by the way, do i have to remove Paviro module to install your one?
                            i couldn’t find @strawberry-3-141 module… can you pls forward me the link?

                            1 Reply Last reply Reply Quote 0
                            • bheplerB Offline
                              bhepler Module Developer @strawberry 3.141
                              last edited by

                              @strawberry-3.141 said in Motion Detector:

                              @done propably everything is working for you guys and you can just see the screensaver, be sure to disable the screensaver

                              Negative. The screensaver has been disabled but the motiondetection module isn’t working. I gave the Facial Recognition module a try, but with the camera behind the glass, there isn’t enough light to train the system to recognize anyone.

                              At this point, I’m considering downgrading my chromium to something without the new security “features”.

                              1 Reply Last reply Reply Quote 0
                              • bheplerB Offline
                                bhepler Module Developer
                                last edited by

                                I’m still working this problem. To help with @paphko 's concern about processor utilization, I finally figured out how and where to put a delay in the main image comparison loop. @alexyak is using the RequestAnimationFrame feature to run the comparison as fast as the browser can render the UI.

                                If you wish to include a delay, modify your motion.js file’s main function to read as such:

                                function main(frequency) {
                                	render();
                                
                                	if(rendering == true) {
                                		setTimeout(function() {
                                			raf(main.bind(this));
                                		}, 500);
                                	}
                                }
                                

                                That last number (the 500) is the milliseconds between each image comparison. I think half a second between comparisons is enough to keep the CPU usage down and the effectiveness up.

                                D 1 Reply Last reply Reply Quote 1
                                • D Offline
                                  done @bhepler
                                  last edited by

                                  Thx @bhepler
                                  this helped to reduce my temperature from 80 °C to 50-60 °C.
                                  Maybe the 80 °C even caused the wake up problem? :)

                                  Anyway, I think I’ll try the voice activation module tomorrow.
                                  Somehow it’s even very sweet to say “Mirror, Mirror on the wall. Wake up!”.

                                  1 Reply Last reply Reply Quote 1
                                  • D Offline
                                    DirkS
                                    last edited by

                                    That is the reason why my screen doesn’t switch on after a couple of hrs switched off.
                                    Any idea what the cause of unavailable tvservice is?

                                    Testwise i used the scripts reported here before. They where called if a PIR detects motion or no motion.

                                    Nov  1 08:22:00 MagicMirror kernel: [86411.138649] raspberrypi-firmware soc:firmware: Request 0x00048003 returned status 0x80000001
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.138665] bcm2708_fb soc:fb: Failed to allocate GPU framebuffer (-22)
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.138670] detected fb_set_par error, error code: -22
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.139138] raspberrypi-firmware soc:firmware: Request 0x00048003 returned status 0x80000001
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.139148] bcm2708_fb soc:fb: Failed to allocate GPU framebuffer (-22)
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.139152] detected fb_set_par error, error code: -22
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.140642] raspberrypi-firmware soc:firmware: Request 0x00048003 returned status 0x80000001
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.140654] bcm2708_fb soc:fb: Failed to allocate GPU framebuffer (-22)
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.140659] detected fb_set_par error, error code: -22
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.140777] raspberrypi-firmware soc:firmware: Request 0x00048003 returned status 0x80000001
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.140785] bcm2708_fb soc:fb: Failed to allocate GPU framebuffer (-22)
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.140789] detected fb_set_par error, error code: -22
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.140856] raspberrypi-firmware soc:firmware: Request 0x00048003 returned status 0x80000001
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.140863] bcm2708_fb soc:fb: Failed to allocate GPU framebuffer (-22)
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.140868] bcm2708_fb_pan_display(0,0) returns=-22
                                    Nov  1 08:22:00 MagicMirror systemd[1]: Started Getty on tty6.
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.256398] raspberrypi-firmware soc:firmware: Request 0x00048003 returned status 0x80000001
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.256413] bcm2708_fb soc:fb: Failed to allocate GPU framebuffer (-22)
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.256418] detected fb_set_par error, error code: -22
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.256758] raspberrypi-firmware soc:firmware: Request 0x00048003 returned status 0x80000001
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.256770] bcm2708_fb soc:fb: Failed to allocate GPU framebuffer (-22)
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.256775] bcm2708_fb_pan_display(0,0) returns=-22
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.296428] raspberrypi-firmware soc:firmware: Request 0x00040002 returned status 0x80000001
                                    Nov  1 08:22:00 MagicMirror kernel: [86411.296455] bcm2708_fb soc:fb: bcm2708_fb_blank(0) failed: -22
                                    
                                    2016.11.01 08:05:04 2: KuMagicScreen: {system("sudo /opt/fhem/monitor_off.sh &")}: -1
                                    tvservice-client: Failed to connect to TV service: -1
                                    [E] Failed to power off HDMI
                                    Powering off HDMI
                                    2016.11.01 08:05:57 2: KuMagicScreen: {system("sudo /opt/fhem/monitor_on.sh &")}: -1
                                    tvservice-client: Failed to connect to TV service: -1
                                    [E] Failed to set property 4
                                    2016.11.01 08:07:37 2: KuMagicScreen: {system("sudo /opt/fhem/monitor_off.sh &")}: -1
                                    tvservice-client: Failed to connect to TV service: -1
                                    [E] Failed to power off HDMI
                                    Powering off HDMI
                                    2016.11.01 08:09:00 2: KuMagicScreen: {system("sudo /opt/fhem/monitor_on.sh &")}: -1
                                    tvservice-client: Failed to connect to TV service: -1
                                    [E] Failed to set property 4
                                    2016.11.01 08:09:42 2: KuMagicScreen: {system("sudo /opt/fhem/monitor_off.sh &")}: -1
                                    tvservice-client: Failed to connect to TV service: -1
                                    [E] Failed to power off HDMI
                                    Powering off HDMI
                                    2016.11.01 08:09:59 2: KuMagicScreen: {system("sudo /opt/fhem/monitor_on.sh &")}: -1
                                    tvservice-client: Failed to connect to TV service: -1
                                    [E] Failed to set property 4
                                    ping: icmp open socket: Operation not permitted
                                    2016.11.01 08:10:41 2: KuMagicScreen: {system("sudo /opt/fhem/monitor_off.sh &")}: -1
                                    tvservice-client: Failed to connect to TV service: -1
                                    [E] Failed to power off HDMI
                                    Powering off HDMI
                                    ping: icmp open socket: Operation not permitted
                                    2016.11.01 08:21:59 2: KuMagicScreen: {system("sudo /opt/fhem/monitor_on.sh &")}: -1
                                    tvservice-client: Failed to connect to TV service: -1
                                    [E] Failed to set property 4
                                    2016.11.01 08:22:50 2: KuMagicScreen: {system("sudo /opt/fhem/monitor_off.sh &")}: -1
                                    tvservice-client: Failed to connect to TV service: -1
                                    [E] Failed to power off HDMI
                                    Powering off HDMI
                                    
                                    1 Reply Last reply Reply Quote 1
                                    • D Offline
                                      DirkS
                                      last edited by

                                      So here i found a workaround. Maybe it fixes the issue but let’s see. I just modified my test script and need to see it the next hrs/days

                                      https://github.com/raspberrypi/documentation/pull/245/files

                                      https://github.com/raspberrypi/linux/issues/487

                                      1 Reply Last reply Reply Quote 1
                                      • D Offline
                                        DirkS
                                        last edited by

                                        Hi,

                                        for all the people here I wrote it more cleary :D

                                        i had big problems by switching off my screen with the PIR or another module with camera. The problem was not the module itself it is a firmware problem of the PI. I could see the same problem outside of MagicMirror as well by trying different things.

                                        Reported also here:
                                        https://github.com/raspberrypi/linux/issues/487

                                        The symptom is that after a while of switching on and off the screen it remains off.

                                        Dmesg reports the problem:

                                        Nov  1 08:22:00 MagicMirror kernel: [86411.138649] raspberrypi-firmware soc:firmware: Request 0x00048003 returned status 0x80000001
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.138665] bcm2708_fb soc:fb: Failed to allocate GPU framebuffer (-22)
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.138670] detected fb_set_par error, error code: -22
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.139138] raspberrypi-firmware soc:firmware: Request 0x00048003 returned status 0x80000001
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.139148] bcm2708_fb soc:fb: Failed to allocate GPU framebuffer (-22)
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.139152] detected fb_set_par error, error code: -22
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.140642] raspberrypi-firmware soc:firmware: Request 0x00048003 returned status 0x80000001
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.140654] bcm2708_fb soc:fb: Failed to allocate GPU framebuffer (-22)
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.140659] detected fb_set_par error, error code: -22
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.140777] raspberrypi-firmware soc:firmware: Request 0x00048003 returned status 0x80000001
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.140785] bcm2708_fb soc:fb: Failed to allocate GPU framebuffer (-22)
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.140789] detected fb_set_par error, error code: -22
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.140856] raspberrypi-firmware soc:firmware: Request 0x00048003 returned status 0x80000001
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.140863] bcm2708_fb soc:fb: Failed to allocate GPU framebuffer (-22)
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.140868] bcm2708_fb_pan_display(0,0) returns=-22
                                        Nov  1 08:22:00 MagicMirror systemd[1]: Started Getty on tty6.
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.256398] raspberrypi-firmware soc:firmware: Request 0x00048003 returned status 0x80000001
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.256413] bcm2708_fb soc:fb: Failed to allocate GPU framebuffer (-22)
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.256418] detected fb_set_par error, error code: -22
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.256758] raspberrypi-firmware soc:firmware: Request 0x00048003 returned status 0x80000001
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.256770] bcm2708_fb soc:fb: Failed to allocate GPU framebuffer (-22)
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.256775] bcm2708_fb_pan_display(0,0) returns=-22
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.296428] raspberrypi-firmware soc:firmware: Request 0x00040002 returned status 0x80000001
                                        Nov  1 08:22:00 MagicMirror kernel: [86411.296455] bcm2708_fb soc:fb: bcm2708_fb_blank(0) failed: -22
                                        

                                        Switching off the screen with

                                        /opt/vc/bin/tvservice -o

                                        and on with

                                        /opt/vc/bin/tvservice --preferred && sudo chvt 6 && sudo chat 7

                                        does not work reliable! The git issue tells you more about.

                                        The workaround is a not yet described solution inside the config.txt

                                        https://github.com/raspberrypi/documentation/pull/245/files

                                        the option “hdmi_blanking=1” is your friend in this case! :D

                                        Now i’m switching off the screen with

                                        vcgencmd display_power 0

                                        and on with

                                        vcgencmd display_power 1

                                        And it is working now like a charm! Did started to use it one day before this report and it is still working without any issue :)

                                        Honestly speaking i don’t use any MM module for switching off anymore. But maybe my discovered solution will help any other and might be a way to change the module as well.

                                        If you have trouble with on/off as well please check the output of dmesg. If you have the frambuffer problem you can fix it.

                                        My personal solution is to have the PIR state at FHEM and from FHEM i’m using a script to switch the screen. But that’s a special case and for the most people here the usage of a MM Module will be the better way.

                                        regards
                                        Dirk

                                        B D 2 Replies Last reply Reply Quote 2
                                        • B Offline
                                          bibi @DirkS
                                          last edited by

                                          @DirkS thx for sharing! one question please : where is located the option : “hdmi_blanking=1” ???

                                          bheplerB 1 Reply Last reply Reply Quote 0
                                          • bheplerB Offline
                                            bhepler Module Developer @bibi
                                            last edited by

                                            @bibi Based on that pull request, it looks like it’s in the config.txt of your Pi. So /boot/config.txt

                                            B 1 Reply Last reply Reply Quote 0

                                            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
                                            • 1
                                            • 2
                                            • 7
                                            • 8
                                            • 9
                                            • 10
                                            • 11
                                            • 10 / 11
                                            • First post
                                              Last post
                                            Enjoying MagicMirror? Please consider a donation!
                                            MagicMirror created by Michael Teeuw.
                                            Forum managed by Sam, technical setup by Karsten.
                                            This forum is using NodeBB as its core | Contributors
                                            Contact | Privacy Policy