Read the statement by Michael Teeuw here.
Brand New Install works until I enable PM2 Autostart
-
Hi All,
Newbie here having an issue with new installs where everything works perfectly following the official installation instructions (https://docs.magicmirror.builders/getting-started/installation.html) until I implement PM2.
I am using Bookworm 64bit desktop on a 3A+ with a 32gb SD. Running “npm run start” launches Magic Mirror on the desktop and all is good.
But as soon as I try to autostart (https://docs.magicmirror.builders/configuration/autostart.html#using-pm2) when it launches, it is actually launching an empty black Electron app on the desktop. If I close that app then the Magic Mirror 2 app launches and runs fine. It’s completely weird. I have run through this from scratch 3 times and the same issue each time.
Any help is much appreciated.
Anthony
-
@cowlam did you do these steps?
https://docs.magicmirror.builders/configuration/autostart.html#using-pm2
if YOU execute mm.sh does it open MM?
so, if you do
pm2 statusthen
pm2 remove 0 pm2 savethen resume the steps
pm2 start mm.shif it starts then
pm2 saveor , you can use my scripts. (remove the entry in pm2 first so you don’t get two)
see
https://github.com/sdetweil/MagicMirror_scriptsthe last script on that page will setup pm2 to launch mm
-
@sdetweil Thank You for the suggestions.
It launches correctly with “pm2 start mm.sh”.
But when I then run “pm2 save” and stop mm and start it again it launches the black Electron screen.
So I then remove it (had to run “pm2 del 0”), and save (pm2 save --force).
Then I ran “pm2 start mm.sh” again.
I then ran “pm2 stop mm”.
Then I ran “pm2 save”.
I can successfully run “pm2 start mm.sh” after that providing I saved it in the stopped state.
But that means when the pi reboots it isn’t started automatically. -
-
pm2 start mm.sh
Magic Mirror launches successfullypm2 save
pm2 restart 0 (can confirm that is the correct id from pm2 status - only one entry which is mm)
Magic Mirror is closed down… and an black Electron window opens and does not change ever after several minutes.
If I right-click the Electron window and close it, after a few seconds the Magic Mirror launches successfully again on its own. -
-
-
@cowlam can u change the cd line to
cd ~/MagicMirrorthe one u have is MagicMirror from here (.)
not MagicMirror from user home (~)also the pm2 status line has a column with a circled arrow header, that is restarts
and after 5 rapid it stopsI suspect the cd doesn’t work, mm doesn’t start,
but the saved info says u need electron started. -
@sdetweil Sam: Just to let you know, if PM2 is not running any tasks, it won’t save with a plain
pm2 save- you have to usepm2 save --forceto clear the list after deleting everything.
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