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.

    Cron Job Question

    Scheduled Pinned Locked Moved Solved Troubleshooting
    22 Posts 4 Posters 7.4k Views 4 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.
    • N Offline
      Nneuland
      last edited by

      Within terminal these work flawlessly.

      vcgencmd display_power 0 to turn off

      vcgencmd display_power 1 to turn on

      However my cron job isn’t turning my monitor back on. Any suggestions? This is my cron job

      0 14 * * * root /usr/bin/vcgencmd display_power 1 >/del/null 2>&1

      0 23 * * * root /usr/bin/vcgencmd display_power 0 >/dev/null 2>&1

      Am I missing something?

      S plainbrokeP evroomE 3 Replies Last reply Reply Quote 0
      • evroomE Online
        evroom @Nneuland
        last edited by

        @Nneuland

        Just a small remark: /del/null is a typo.
        When off works, then on will work when you change to /dev/null.
        Unless it is right on your system and the typo is in your thread.

        MagicMirror version: 2.33.0
        Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
        Raspbian GNU/Linux 12 (bookworm)

        Test environment:
        MagicMirror version: v2.33.0
        Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
        Raspbian GNU/Linux 12 (bookworm)

        S N 2 Replies Last reply Reply Quote 0
        • S Do not disturb
          sdetweil @Nneuland
          last edited by

          @Nneuland probably they don’t know what DISPLAY is set to

          take of the redirects >
          so u can see the errors in the cron log

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • plainbrokeP Offline
            plainbroke @Nneuland
            last edited by

            @Nneuland
            My Old Cronjob was like this.
            00 07 * * 1-5 /home/pi/hdmi-on.sh
            45 21 * * 1-5 /home/pi/hdmi-off.sh
            00 07 * * 6,0 /home/pi/hdmi-on.sh
            00 22 * * 6,0 /home/pi/hdmi-off.sh

            hdmi-off.sh file contains :
            vcgencmd display_power 0

            hdmi-on.sh file contains:
            vcgencmd display_power 1

            Don’t forget to
            sudo chmod +x hdmi-off.sh
            sudo chmod +x hdmi-on.sh
            If you go this route.

            Now I use MMM-AutoDimmer
            my setup in config.js it works great

            {
                    disabled: false,
                    module: "MMM-AutoDimmer",
                    position: "fullscreen_above",
                    header: "",
                    // Don't change anything above this line
                    config: {
                    maxDim: 1,
                    brightTime: 700,
                    dimTime: 2130
                          }
            },
            
            
            S 1 Reply Last reply Reply Quote 0
            • S Do not disturb
              sdetweil @plainbroke
              last edited by

              @plainbroke I use a webcam for motion and also hide modules instead of turn off the display

              using my Sleep wake module
              https://github.com/sdetweil/MMM-SleepWake

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              plainbrokeP 2 Replies Last reply Reply Quote 0
              • plainbrokeP Offline
                plainbroke @sdetweil
                last edited by

                @sdetweil
                I will give that a try next rainy day we have.
                I like to try things like that module on my raining can’t do anything outside days…

                1 Reply Last reply Reply Quote 0
                • evroomE Online
                  evroom @Nneuland
                  last edited by

                  @Nneuland

                  Just a small remark: /del/null is a typo.
                  When off works, then on will work when you change to /dev/null.
                  Unless it is right on your system and the typo is in your thread.

                  MagicMirror version: 2.33.0
                  Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
                  Raspbian GNU/Linux 12 (bookworm)

                  Test environment:
                  MagicMirror version: v2.33.0
                  Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
                  Raspbian GNU/Linux 12 (bookworm)

                  S N 2 Replies Last reply Reply Quote 0
                  • S Do not disturb
                    sdetweil @evroom
                    last edited by

                    @evroom good catch!

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    1 Reply Last reply Reply Quote 0
                    • N Offline
                      Nneuland @evroom
                      last edited by

                      @evroom

                      Good eye. And yes! This was the issue. Thank you

                      1 Reply Last reply Reply Quote 0
                      • plainbrokeP Offline
                        plainbroke @sdetweil
                        last edited by

                        @sdetweil
                        Is there a way to run this as a cron job to black out the screen then in the morning un black the screen?
                        I don’t understand the camera angle, I have Motion Eye running on a PI zero and raspberry 5 mp camera and it works showing up in my mirror using Motion-Eye. I just do not understand at all the code to make it happen…

                        S 1 Reply Last reply Reply Quote 0
                        • S Do not disturb
                          sdetweil @plainbroke
                          last edited by sdetweil

                          @plainbroke I use the GitHub motion project to handle the camera and motion detection.
                          https://github.com/Motion-Project/motion
                          ( I didn’t want to learn how to manage the camera too)

                          it signals motion start and end.
                          the library provides tons of config options and supports just about every camera.

                          I provide the interface script that is called on motion start/end and signals my sleep/wake module to turn off screen or hide modules.

                          you could use the script I provide in the cron job to signal wake up or go to sleep on a timed schedule

                          Sam

                          How to add modules

                          learning how to use browser developers window for css changes

                          plainbrokeP 1 Reply Last reply Reply Quote 0
                          • plainbrokeP Offline
                            plainbroke @sdetweil
                            last edited by

                            @sdetweil
                            What would the script code look like to do this manually instead of using the motion thing. I tried installing it but could not get it to work for me… the autoreconfig would not run at all… make just failed and one other step could not find certain files. There is no indication it actually installed. so I ran remove and it did. not sure where the motion program was installed in the first place I tried to install from inside MagicMirror/modules so I would be easier for me to find with no luck and when I tried to use find to find it nothing was found. Not my cup of tea for sure.

                            Thought if there is a way to run your script manually I would then just incorperate that into a cron job and be done with it.
                            The module I am running autodimmer still glows at night and you can see the modules faintly in the background…

                            S N 2 Replies Last reply Reply Quote 0
                            • S Do not disturb
                              sdetweil @plainbroke
                              last edited by sdetweil

                              @plainbroke autoreconfig?

                              u don’t have to build motion, they have binaries (on every platform I’ve tried so far)

                              my script (launched by something outside mm)
                              creates an empty file in a known folder for each motion event

                              detected
                              ended

                              my module node_helper watches for those files to be created, and then sends notification to my module side to signal sleep or wake depending on the config.

                              the default folder is ‘motion’ inside the MMM-SleepWake folder

                              the script locates the running mm instance, and uses it’s path to locate the module folder and this it’s motion folder

                              the script assumes the path includes the username mm is running under and that username is used to set file permissions, so the module can remove them after processing the detection

                              Sam

                              How to add modules

                              learning how to use browser developers window for css changes

                              plainbrokeP 1 Reply Last reply Reply Quote 0
                              • N Offline
                                Nneuland @plainbroke
                                last edited by

                                @plainbroke

                                If I understand you correctly the dimmer is dimming the modules, but the monitor is still giving off light. A cron job set to turn on/off the monitor at specific times is what you’re looking for.

                                S plainbrokeP 2 Replies Last reply Reply Quote 0
                                • S Do not disturb
                                  sdetweil @Nneuland
                                  last edited by

                                  @Nneuland however, in many cases u cannot turn off the actual monitor… only HDMI port… which then puts up a NO INPUT message, til it powers off (energy star compliant)

                                  I cannot turn off any of mine, so I hide modules instead, but get a glow… (my nightlight)

                                  Sam

                                  How to add modules

                                  learning how to use browser developers window for css changes

                                  plainbrokeP 1 Reply Last reply Reply Quote 0
                                  • plainbrokeP Offline
                                    plainbroke @sdetweil
                                    last edited by plainbroke

                                    This post is deleted!
                                    S 1 Reply Last reply Reply Quote 0
                                    • S Do not disturb
                                      sdetweil @plainbroke
                                      last edited by

                                      @plainbroke for me

                                      sudo apt install motion

                                      was all I needed

                                      Sam

                                      How to add modules

                                      learning how to use browser developers window for css changes

                                      plainbrokeP 1 Reply Last reply Reply Quote 0
                                      • plainbrokeP Offline
                                        plainbroke @sdetweil
                                        last edited by

                                        This post is deleted!
                                        S 1 Reply Last reply Reply Quote 0
                                        • plainbrokeP Offline
                                          plainbroke @Nneuland
                                          last edited by

                                          @Nneuland
                                          Exactly and I have dimmer max set to 1 which should in my understanding blank the screen. It used to but since my reinstall of MagicMirror and all modules it does not seem to work correctly. I am in the process of removing it and reinstalling the dimmer module, to see if that is my problem… It also starts dimming 2 hours early but changing the dim timer has no effect. The reason for removal and reinstall today…

                                          1 Reply Last reply Reply Quote 0
                                          • S Do not disturb
                                            sdetweil @plainbroke
                                            last edited by

                                            @plainbroke yes logitech USB webcam.

                                            just works

                                            I fiddled w delay, and some light flash settings but thing else…

                                            Sam

                                            How to add modules

                                            learning how to use browser developers window for css changes

                                            plainbrokeP 1 Reply Last reply Reply Quote 0
                                            • plainbrokeP Offline
                                              plainbroke @sdetweil
                                              last edited by

                                              @sdetweil
                                              Ok that is what I was wondering. I am playing with it now. I WILL figure it out. I like the idea of it being blank we have enough ambient light from out side. (night time porch lights, I live out in the sticks.) for security lighting…

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