Read the statement by Michael Teeuw here.
Starting mirror with PM2 on boot
-
Hi all,
I have a Pi3, running Magic mirror.
grep version ~/MagicMirror/package.json:
“version”: “2.26.0”,
node ver:
v20.10.0
uname -a:
Linux xxxxPi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
lsb_release -a:
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseyelast I installed and run the PM2.
followed the instruction “AutoStart your MagicMirror²” , Magic mirror starts OK with the command: “pm2 start mm.sh”
Last on the install list, enabling restarting of the Magic Mirror is the command pm2 save that ends successfully (no errors).
rebooting the Pi, Magic Mirror will not start automatically.
running pm2 logs I see 2 errors:
0|mm | [1876:0121/103318.925547:ERROR:object_proxy.cc(590)] Failed to call method: org.freedesktop.portal.Settings.Read: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.portal.Desktop was not provided by any .service files
0|mm | /home/pi/MagicMirror/node_modules/electron/dist/electron exited with signal SIGINT
can anybody help on this?
Thank you -
@eitan ok let’s check mm first
cd ~/MagicMirror npm start
does it start?
if not show me the message from the terminal windowthose freedesktop messages are junk.
-
Thank you for your replay.
Yes, Magic Mirror starts with npm start,
It also starts with PM2, when running it after boot - pm2 start mm.
what I have not been able to do is for it to start automatically after boot. -
@eitan ok, I have not used the install instructions for pm2,
as I have an install script that does all the work ,you can use the fixuppm2 script
it uses a different mm.sh, whcih we ship, in the MagicMirror/installers folderyou will have to delete one of the entries from pm2 after this so you don’t try to start 2.
see
pm2 --help
for the command syntax
-
Hi sdetweil (as I don’t have your name),
Thank you, this worked perfect.
I ran the script, afterwards PM2 had a second line in it named MagicMirror.
I deleted my own mm line (PM2 delete mm) and was left with only MagicMirror in PM2
Stopped started the MagicMirror with PM2 and got an warning from PM2 about the incorrect mm:
[PM2][WARN] Current process list is not synchronized with saved list. App mm differs. Type ‘pm2 save’ to synchronize.
Saved the new status PM2 save
Rebooted the Pi and MagicMirror was up after boot.I was wondering if you can share the content of MagicMirror.sh (if it is an .sh script), so that I can understand what’s the different
In any case, thank you
-
@eitan my name is in each of my replies.
the script is ~/MagicMirror/installers/mm.sh
you can also give pm2 a json file with a more descriptive name.
see the file I create
~/MagicMirror/installers/pm2_magicmirror.jsonsee pm2 --help for all the things it can do
by convention, each command is to provide help 2 ways.
one in response to the only Parm --help and some usage man(ual) page(s)
so
man pm2
will.open that for pm2
-