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.

    Help with MMM-SleepWake

    Scheduled Pinned Locked Moved Troubleshooting
    11 Posts 2 Posters 5.0k Views 3 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.
    • C Offline
      chanster
      last edited by chanster

      @sdetweil I’m hoping you can help me out with this. I have installed the Motion package and confirm that it works - I can view the livestream etc and it’s recording mkv files to the motion folder that I’ve defined when motion is detected.

      I see these entries in motion.log :

      [1:ml1] [NTC] [EVT] [Jan 09 01:19:36] event_newfile: File of type 8 saved to: /home/pi/Pictures/motion/01-20210109011936.mkv
      [1:ml1] [NTC] [ALL] [Jan 09 01:19:36] motion_detected: Motion detected - starting event 1
      [1:ml1] [NTC] [ALL] [Jan 09 01:21:26] mlp_actions: End of event 1
      [1:ml1] [NTC] [EVT] [Jan 09 01:21:28] event_newfile: File of type 8 saved to: /home/pi/Pictures/motion/02-20210109012128.mkv
      [1:ml1] [NTC] [ALL] [Jan 09 01:21:28] motion_detected: Motion detected - starting event 2
      [1:ml1] [NTC] [ALL] [Jan 09 01:24:01] mlp_actions: End of event 2
      [1:ml1] [NTC] [EVT] [Jan 09 01:24:18] event_newfile: File of type 8 saved to: /home/pi/Pictures/motion/03-20210109012418.mkv
      [1:ml1] [NTC] [ALL] [Jan 09 01:24:18] motion_detected: Motion detected - starting event 3
      [1:ml1] [NTC] [ALL] [Jan 09 01:33:05] mlp_actions: End of event 3
      

      Your module did put my display to sleep but it didn’t wake it up. I tested these commands manually and they work to turn the HDMI on and off :

      /opt/vc/bin/tvservice -p && sudo chvt 6 && sudo chvt 7
      /opt/vc/bin/tvservice -o
      

      I edited the motion.conf file to call your module when motion event starts / ends.

      I notice this however in the motion log after I added the event calls to your module :

      [30500488:motion] [NTC] [ALL] conf_load: Processing thread 0 - config file /home/pi/.motion/motion.conf
      [30500488:motion] [NTC] [ALL] motion_startup: Motion 4.1.1 Started
      [30500488:motion] [NTC] [ALL] motion_startup: Logging to file (/var/log/motion/motion.log)
       &: 1:  &: value: not found
       &: 1:  &: value: not found -> this keeps repeating until I stop motion
      

      I commented out the motion event calls and these messages stop. So they seem to be related to these two configuration entries :

      on_event_start /home/pi/MagicMirror/modules/MMM-SleepWake/external_motion started
      on_event_start /home/pi/MagicMirror/modules/MMM-SleepWake/external_motion ended
      

      I noticed you mention that there should be two files in the motion directory under MMM-SleepWake but in my case, I do not see any files in that directory.

      In my config.js, I just have this :

              {
                  module: 'MMM-SleepWake',
                  config:{
                      delay: 15,               
                      mode: 'PI'
                  }
              },
      

      Sorry for the long message, I hope you can suggest what I may have done incorrectly.

      Thanks!

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @chanster
        last edited by

        @chanster can u show me what u added to motion.conf?

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • C Offline
          chanster
          last edited by

          These are the two lines I updated in motion.conf

          # Command to be executed when an event starts. (default: none)
          # An event starts at first motion detected after a period of no motion defined by event_gap
          
          on_event_start value /home/pi/MagicMirror/modules/MMM-SleepWake/external_motion started
          
          # Command to be executed when an event ends after a period of no motion
          # (default: none). The period of no motion is defined by option event_gap.
          
          on_event_end value /home/pi/MagicMirror/modules/MMM-SleepWake/external_motion ended
          
          

          I noticed something else. Last night, before I went to bed, I turned motion off (I was just running it from the command line, not as a service). This morning my display was in power saving mode again (yellow light) and I couldn’t get it to wake up. I had to manually run this command from the command line to get the screen to turn on again :

          /opt/vc/bin/tvservice -p && sudo chvt 6 && sudo chvt 7
          

          It’s strange that your module had put my screen to sleep even though there was no motion even to trigger it.

          S 3 Replies Last reply Reply Quote 0
          • S Offline
            sdetweil @chanster
            last edited by

            @chanster remove the word value from both lines in motion.conf

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            C 1 Reply Last reply Reply Quote 0
            • S Offline
              sdetweil @chanster
              last edited by

              @chanster motion wakes up. timer puts to sleep

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • S Offline
                sdetweil @chanster
                last edited by sdetweil

                @chanster u can run the exteral_motion started command from the command line to test getting the commands working.

                over ssh too. it’s just a command to tell module there was ‘motion’

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • C Offline
                  chanster @sdetweil
                  last edited by

                  @sdetweil Thank you !! I’m so stupid. Removing “value” did the trick ! Thank you for this module. Works perfectly.

                  S 1 Reply Last reply Reply Quote 0
                  • S Offline
                    sdetweil @chanster
                    last edited by

                    @chanster glad u got it working.

                    help me fix the doc, what lead u to use value?

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    C 1 Reply Last reply Reply Quote 0
                    • C Offline
                      chanster @sdetweil
                      last edited by

                      @sdetweil It was in the sample config file for Motion. It’s a rookie mistake that I should have replaced “value” and not merely append to this line :

                      # Command to be executed when an event starts. (default: none)
                      # An event starts at first motion detected after a period of no motion defined by event_gap
                      ; on_event_start value
                      
                      # Command to be executed when an event ends after a period of no motion
                      # (default: none). The period of no motion is defined by option event_gap.
                      ; on_event_end value
                      
                      S 1 Reply Last reply Reply Quote 0
                      • S Offline
                        sdetweil @chanster
                        last edited by

                        @chanster ok, my module doc gives u the new lines for motion.conf

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        C 1 Reply Last reply Reply Quote 0
                        • C Offline
                          chanster @sdetweil
                          last edited by

                          @sdetweil said in Help with MMM-SleepWake:

                          @chanster ok, my module doc gives u the new lines for motion.conf

                          Yes, nothing wrong with your docs at all.

                          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 / 1
                          • 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