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.

    Auto start does not work

    Scheduled Pinned Locked Moved Troubleshooting
    8 Posts 6 Posters 16.1k Views 6 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.
    • G Offline
      greda
      last edited by

      Hello,
      I have a little problem. I use PM2 to do an auto start but it does not work. I followed the tutorial: https://github.com/MichMich/MagicMirror/wiki/Auto-Starting-MagicMirror
      I need to manually start: pm2 start mm.sh
      Thank you for your help.

      N 1 Reply Last reply Reply Quote 0
      • T Offline
        tomyboy96 Project Sponsor
        last edited by

        Here you have the solution!

        https://forum.magicmirror.builders/topic/4499/pm2-do-not-start-at-bootup-on-my-rpi-2-works-fine-on-my-rpi-3/9

        Good Luck!

        1 Reply Last reply Reply Quote 0
        • G Offline
          greda
          last edited by

          Hi

          I tried this procedure but it did not work. I still have the same automatic restart problem.
          Thank you.

          1 Reply Last reply Reply Quote 0
          • S Offline
            shbatm Module Developer
            last edited by shbatm

            See my previous post here: https://forum.magicmirror.builders/topic/1094/pm2-mm2-not-starting-on-start-up/20

            This method may help you:

            Set pm2 to startup using systemd with user pi and home directory /home/pi

            sudo pm2 startup systemd -u pi --hp /home/pi
            

            And then use pm2 save to save the state.

            1 Reply Last reply Reply Quote 0
            • G Offline
              greda
              last edited by

              Hi
              I followed instructions now it works and I figured out how it works.
              THank you so much

              1 Reply Last reply Reply Quote 0
              • T Offline
                thammanitn
                last edited by

                I installed Nodejs 9.8.0 on my raspberry Pi 3 model B before run the installation script for raspberry.
                MagicMirror does not autostart until I found a fix on internet:
                sudo env PATH=$PATH:/usr/local/bin pm2 startup systemd -u pi --hp /home/pi

                1 Reply Last reply Reply Quote 0
                • N Offline
                  ntmatter @greda
                  last edited by

                  @greda, I was able to figure a solution I’d sort of seen elsewhere to this exact issue, as I was having the same problem. Created an account to document the solution as this is the first thread that comes up when searching for a solution.

                  On a completely clean installation, and copy/pasting the terminal commands to install, I could get MM running just fine using pm2, but it would not auto-start. As it turns out, I missed a part of the auto-start instructions, and this caused the problem. Here’s my solution:

                  1. Look for the step “Starting PM2 on Boot”
                  2. Command is “pm2 startup”
                  3. There’s an instruction line there that’s easy to miss, which is this: "PM2 will now show you a command you need to execute."
                  4. IN THE TERMINAL, there is an output to the “pm2 startup” command when it’s done running saying that you need to copy and then re-paste to sent environmental variables
                  5. Copy/paste the output text from “pm2 startup” out of, then back into, Terminal
                  6. Proceed with the rest of the auto-start instructions as documented

                  This cleanly and easily solved the issue for me - it’s an easy step in the instructions to miss as it’s the only one where you need to do something with the output of the setup commands.

                  S 1 Reply Last reply Reply Quote 0
                  • S Away
                    sdetweil @ntmatter
                    last edited by

                    @ntmatter you can also run the fixuppm2 script from my automation library listed as alternative in the mm doc

                    see https://github.com/sdetweil/MagicMirror_scripts

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    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