• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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 5.1k 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 Jul 9, 2022, 11:16 PM

    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 P E 3 Replies Last reply Jul 10, 2022, 12:13 AM Reply Quote 0
    • E Offline
      evroom @Nneuland
      last edited by Jul 10, 2022, 9:00 AM

      @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.30.0
      Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
      Raspbian GNU/Linux 12 (bookworm)

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

      S N 2 Replies Last reply Jul 10, 2022, 9:27 AM Reply Quote 0
      • S Online
        sdetweil @Nneuland
        last edited by Jul 10, 2022, 12:13 AM

        @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
        • P Offline
          plainbroke @Nneuland
          last edited by Jul 10, 2022, 3:20 AM

          @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
                        }
          },
          
          

          Slow learner. But trying anyways.

          S 1 Reply Last reply Jul 10, 2022, 4:08 AM Reply Quote 0
          • S Online
            sdetweil @plainbroke
            last edited by Jul 10, 2022, 4:08 AM

            @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

            P 2 Replies Last reply Jul 10, 2022, 4:44 AM Reply Quote 0
            • P Offline
              plainbroke @sdetweil
              last edited by Jul 10, 2022, 4:44 AM

              @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…

              Slow learner. But trying anyways.

              1 Reply Last reply Reply Quote 0
              • E Offline
                evroom @Nneuland
                last edited by Jul 10, 2022, 9:00 AM

                @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.30.0
                Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
                Raspbian GNU/Linux 12 (bookworm)

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

                S N 2 Replies Last reply Jul 10, 2022, 9:27 AM Reply Quote 0
                • S Online
                  sdetweil @evroom
                  last edited by Jul 10, 2022, 9:27 AM

                  @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 Jul 10, 2022, 5:26 PM

                    @evroom

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

                    1 Reply Last reply Reply Quote 0
                    • P Offline
                      plainbroke @sdetweil
                      last edited by Jul 14, 2022, 2:31 AM

                      @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…

                      Slow learner. But trying anyways.

                      S 1 Reply Last reply Jul 14, 2022, 2:40 AM Reply Quote 0
                      • S Online
                        sdetweil @plainbroke
                        last edited by sdetweil Jul 14, 2022, 2:43 AM Jul 14, 2022, 2:40 AM

                        @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

                        P 1 Reply Last reply Jul 14, 2022, 3:32 PM Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 1 / 3
                        1 / 3
                        • First post
                          2/22
                          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