• 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.

Two Instances in PM2

Scheduled Pinned Locked Moved Troubleshooting
19 Posts 6 Posters 10.3k Views 5 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.
  • S Offline
    shazglass @Mykle1
    last edited by Jul 11, 2018, 5:46 AM

    @mykle1 hi. So glad to hear you are doing well. Bit chilly here in SA but all good thnx.
    Ok so I went into the MagicMirror module in terminal as you suggested and ran npm start. It ran a whole bunch of lines then went into Mirror mode. Everything is there. Then to stop it I held control + q to stop. It stops it and puts me back to the terminal I started in. How for demo purposes would I go in and out of the mirror now? How do I get it back to easy access? And what did I do wrong? On install when it asked do u want to use pm2 I said Y. Then is new clean terminal I did pm2 startup. I copied and pasted the line required. I rebooted. Then typed nano mm.sh and added ~/MagicMirror
    DISPLAY=:0 npm start
    Saved then typed
    Chmod +x mm.sh
    Then typed pm2 save
    That’s where I get two instances one MagicMirror that won’t respond until ur way
    And the other is mm which I deleted with your thread instructions.
    So how do I get easy in and out of mirror mode? Thanx my life saver once again!

    Also. I can’t disable the screen saver with the new version. How do I stop it now?
    Thnx. Look forward to hearing from youπŸ˜‰

    1 Reply Last reply Reply Quote 0
    • S Offline
      shazglass @Mykle1
      last edited by Jul 11, 2018, 8:14 AM

      @mykle1 ok. Don’t worry about screen saver. Sorted that out. But not sure how I did it. LOL!

      1 Reply Last reply Reply Quote 0
      • S Offline
        shazglass
        last edited by Jul 14, 2018, 6:39 AM

        Hi everyone.
        Please help. I have two instances of mm starting on boot up. I don’t know what I did wrong. When pi starts the cpu is showing movement but doesn’t boot into mm. I have to type is pi pm2 stop mm. Then pm2 stop MagicMirror to stop the cpu usage. I go into cd MagicMirror and type npm start and my mirror starts. Control q and quits. But this isn’t the right way to do it. How and in what directory do I go into to delete pm2 as I have two instances. Thnx everyone. Appreciate all help.

        M 1 Reply Last reply Jul 15, 2018, 1:23 AM Reply Quote 0
        • M Offline
          Mykle1 Project Sponsor Module Developer @shazglass
          last edited by Jul 15, 2018, 1:23 AM

          @shazglass

          About 9 posts up from here are the directions on how to delete one instance on autostarting MM

          Create a working config
          How to add modules

          S 1 Reply Last reply Jul 15, 2018, 6:39 AM Reply Quote 0
          • S Offline
            shazglass @Mykle1
            last edited by Jul 15, 2018, 6:39 AM

            @mykle1 hi againπŸ˜‰. Yep. I did do that and that’s when both run in the background but none go to mirror mode. Then u suggested going into cd MagicMirror and running npm start and then it goes into mirror mode. I use control q to quit but I still have two instances. I need to delete both and reinstall but without losing my mirror and that’s what I don’t know how to do. I want it back to boot up going straight to mirror mode and then just control q to quit then pm2 stop MagicMirror and pm2 start MagicMirror. Right now I have mm and MagicMirror. I’m just at a loss☹️

            B 1 Reply Last reply Jul 15, 2018, 11:04 PM Reply Quote 0
            • B Offline
              bhepler Module Developer @shazglass
              last edited by Jul 15, 2018, 11:04 PM

              @shazglass All right, we’ll get you through it.

              pm2 runs on Pi startup and will start your mirror process for you. There should be only one listing. If you ran the installation script and said β€œyes” to using pm2, there should be only one process called MagicMirror in pm2.

              To remove the mm process from pm2, enter the following:

              cd ~
              pm2 stop all
              pm2 delete mm
              pm2 save
              rm mm.sh
              pm2 flush
              pm2 start MagicMirror
              

              At this point, your Magic Mirror interface should appear after a minute or so. You can press ctrl-q to exit the Magic Mirror interface, but pm2 should bring it back up in short order.

              S 1 Reply Last reply Jul 16, 2018, 1:38 PM Reply Quote 2
              • S Offline
                shazglass @bhepler
                last edited by Jul 16, 2018, 1:38 PM

                @bhepler hi there.
                Thank you for the instructions. I did exactly as you said. It has taken away the β€œmm” instance. I am left with only the MagicMirror one now. However. It will not boot Into mirror mode on start up, although I can see the CPU is being used, so I type pm2 stop MagicMirror and it shows that it has stopped. Only way I can get the mirror to show is by typing cd MagicMirror
                Then in that directory I type npm start. It does a small load thing and then my mirror shows. How can I get it to how it should be without having to go into the mirror directory?
                Thank you for your patience. Most appreciated!

                B 1 Reply Last reply Jul 17, 2018, 11:29 AM Reply Quote 0
                • B Offline
                  bhepler Module Developer @shazglass
                  last edited by Jul 17, 2018, 11:29 AM

                  @shazglass - Hmm. I don’t know. It should be working normally at this point. Let’s try switching to the previous process. We’ll delete the one that the installer created, then add the one to your script.

                  First, we remove the existing process:

                  cd ~
                  pm2 delete MagicMirror
                  pm2 save
                  

                  Then we use your mm.sh script that you had earlier.

                  pm2 flush
                  pm2 start mm.sh
                  pm2 save
                  

                  At this point, your mirror should come up in about 30 seconds. If it does not, enter pm2 log mm and copy the results here. Be sure to use the forum markup tools to help format your log messages.

                  S 1 Reply Last reply Jul 17, 2018, 3:37 PM Reply Quote 1
                  • S Offline
                    shazglass @bhepler
                    last edited by Jul 17, 2018, 3:37 PM

                    @bhepler hithere
                    I did as per your instructions - except I dont know how to use the forum markup tool…so just copied and pasted.
                    I now dont have any instances running? I can only access my mirror if i go ino cd MagicMirror and then type npm install.

                    pi@raspberrypi:~ $ pm2 stop all
                    [PM2] Applying action stopProcessId on app [all](ids: 0)
                    [PM2] MagicMirror βœ“
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚ Name β”‚ mode β”‚ status β”‚ β†Ί β”‚ cpu β”‚ memory β”‚
                    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€
                    β”‚ MagicMirror β”‚ fork β”‚ stopped β”‚ 6 β”‚ 0% β”‚ 0 B β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    Use pm2 show <id|name> to get more details about an app
                    pi@raspberrypi:~ $ pm2 delete MagicMirror
                    [PM2] Applying action deleteProcessId on app [MagicMirror](ids: 0)
                    [PM2] MagicMirror βœ“
                    β”Œβ”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚ Name β”‚ mode β”‚ status β”‚ β†Ί β”‚ cpu β”‚ memory β”‚
                    β””β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    Use pm2 show <id|name> to get more details about an app
                    pi@raspberrypi:~ $ pm2 save
                    [PM2] Saving current process list…
                    [PM2] Nothing to save !!!
                    [PM2] In this case we keep old dump file. To clear dump file you can delete it manually !
                    pi@raspberrypi:~ $ pm2 flush
                    [PM2] Flushing /home/pi/.pm2/pm2.log
                    [PM2] Logs flushed
                    pi@raspberrypi:~ $ pm2 start mm.sh
                    [PM2][ERROR] script not found : /home/pi/mm.sh
                    script not found : /home/pi/mm.sh
                    β”Œβ”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚ Name β”‚ mode β”‚ status β”‚ β†Ί β”‚ cpu β”‚ memory β”‚
                    β””β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    Use pm2 show <id|name> to get more details about an app
                    pi@raspberrypi:~ $ pm2 save
                    [PM2] Saving current process list…
                    [PM2] Nothing to save !!!
                    [PM2] In this case we keep old dump file. To clear dump file you can delete it manually !
                    pi@raspberrypi:~ $ pm2 start mm
                    [PM2][ERROR] script not found : /home/pi/mm
                    script not found : /home/pi/mm
                    β”Œβ”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚ Name β”‚ mode β”‚ status β”‚ β†Ί β”‚ cpu β”‚ memory β”‚
                    β””β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    Use pm2 show <id|name> to get more details about an app
                    pi@raspberrypi:~ $ pm2 log mm
                    [TAILING] Tailing last 15 lines for [mm] process (change the value with --lines option)
                    [PM2][ERROR] No file to stream for app [mm], exiting.
                    pi@raspberrypi:~ $ pm2 log MagicMirror
                    [TAILING] Tailing last 15 lines for [MagicMirror] process (change the value with --lines option)
                    [PM2][ERROR] No file to stream for app [MagicMirror], exiting.
                    pi@raspberrypi:~ $

                    B 1 Reply Last reply Jul 17, 2018, 6:54 PM Reply Quote 0
                    • S Offline
                      shazglass
                      last edited by Jul 17, 2018, 3:42 PM

                      I did find this in the cd MagicMirror???

                      pi@raspberrypi:~/MagicMirror $ pm2 log MagicMirror
                      [TAILING] Tailing last 15 lines for [MagicMirror] process (change the value with --lines option)
                      /home/pi/.pm2/logs/MagicMirror-out.log last 15 lines:
                      /home/pi/.pm2/logs/MagicMirror-error.log last 15 lines:
                      0|MagicMir | at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
                      0|MagicMir | at Function.Module._load (internal/modules/cjs/loader.js:498:3)
                      0|MagicMir | at Module.require (internal/modules/cjs/loader.js:598:17)
                      0|MagicMir | at require (internal/modules/cjs/helpers.js:11:18)
                      0|MagicMir | Error: ENOENT: no such file or directory, open β€˜package.json’
                      0|MagicMir | at Object.fs.openSync (fs.js:660:18)
                      0|MagicMir | at Object.fs.readFileSync (fs.js:565:33)
                      0|MagicMir | at Object. (/home/pi/MagicMirror/js/app.js:15:32)
                      0|MagicMir | at Module._compile (internal/modules/cjs/loader.js:654:30)
                      0|MagicMir | at Object.Module._extensions…js (internal/modules/cjs/loader.js:665:10)
                      0|MagicMir | at Module.load (internal/modules/cjs/loader.js:566:32)
                      0|MagicMir | at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
                      0|MagicMir | at Function.Module._load (internal/modules/cjs/loader.js:498:3)
                      0|MagicMir | at Module.require (internal/modules/cjs/loader.js:598:17)
                      0|MagicMir | at require (internal/modules/cjs/helpers.js:11:18)

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 2 / 2
                      2 / 2
                      • First post
                        13/19
                        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