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.

    Stop Magic Mirror interface and Shutdown R Pi automatically at given timepoints

    Scheduled Pinned Locked Moved Troubleshooting
    4 Posts 2 Posters 3.9k Views 2 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.
    • V Offline
      vortex
      last edited by

      Hi all,

      first, I m new to this and I am a total noob in programming and setting up stuff.
      Anyway, somehow I managed to build my own MM with the help of tutorials and guides from this site :)

      I m planning to shutdown my R Pi at different timepoints, for example every evening at 11 pm.
      I googled and I found out that I can do this using cronjob.

      To date, I manually stop my MM interface using the “pm2 stop mm” command in the console. This brings me back to the desktop. Then I shut down my R Pi using either the shutdown button in the R Pi Menu or by the shutdown command in the console.

      I m planning now to use a cronjob to shut down my R pi. Here s my problem:

      Do I have to stop my MM interface (using the “pm2 stop mm” command in the console) before I shut down my R pi with the cronjob? Will there be any errors occuring after next boot if the R pi just shuts down at 11 pm without stopping the Magic Mirror surface in advance?

      Or can I add to the cronjob that MM interface should stop, before executing the shutdown?
      I don´t know how to handle/set up this.

      Can you help please?

      Thanks and Best regards
      Lukas

      1 Reply Last reply Reply Quote 0
      • V Offline
        vortex
        last edited by

        Hi all,

        after some more reading I constructed the following:

        sudo crontab -e

        Adding:
        55 7 * * 0-4 /pm2 stop mm
        (at 07:55 am quit Magicmirror , sundays - thursdays)
        0 8 * * 0-4 /sudo shutdown -h
        (at 08:00 am shutdown R Pi , sundays - thursdays)

        After shutdown: Power off with timeclock

        Can anyone verify that this will work?

        Thank you very much

        Greetings
        Lukas

        J 1 Reply Last reply Reply Quote 0
        • J Offline
          j.e.f.f Project Sponsor Module Developer @vortex
          last edited by

          @vortex No need to stop MM if you are doing a full shutdown. Whether you have MM managed by PM2 or are starting MM manually with npm start, the processes will be killed as part of the shutdown process.

          I’ve restarted or shut down my Mirror many times without stopping MM, and I have not run into any issues.

          1 Reply Last reply Reply Quote 0
          • V Offline
            vortex
            last edited by

            Hi Jeff

            thanks for your reply and help!
            Now I will skip the stopping process and directly go for shutdown.

            Greetings
            Lukas

            1 Reply Last reply Reply Quote 0
            • 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