Read the statement by Michael Teeuw here.
2nd MagicMirror
-
So I have my 1st magicmirror completed for quite some time now and it works perfectly. it Does everything I want. Good job guys on creating all the modules for it. I normally start it by using a very simple script, inside is
pm2 start MagicMirror
and it’s executed in terminal modeI want to create another magicmirror from scratch. but I want to keep the one I have
I could call my new one magicmirror2, When it’s completed
I would like to be able to start either 1 by using pm2 . If this is possible
can you please tell me how to do thishas anybody tried this
-
@Ray sure. make another script in the installers folder, mm.sh is the current one
fix the pm2_MagicMirror.json
name and script name
then
pm2 start pm2_MagicMirror.jsonthen pm2 save
note you can use a different config file on the same install to run two different instances
for example
mm1.sh#!/bin/bash # This file is still here to keep PM2 working on older installations. cd ~/MagicMirror export MM_CONFIG_FILE=config/config.js DISPLAY=:0 npm start
and mm2.sh
#!/bin/bash # This file is still here to keep PM2 working on older installations. cd ~/MagicMirror export MM_CONFIG_FILE=config/config2.js DISPLAY=:0 npm start
the pm2_MagicMirror.json (from my scripts repo)
{ "apps" : [{ "name" : "MagicMirror", "script" : "/home/pi/MagicMirror/installers/mm.sh", "watch" : ["/home/pi/MagicMirror/config/config.js"] }] }
change the name and the paths
-
@sdetweil okay I think I understand. I will give it a try . I am going to make my new magic mirror in a couple of days
wanted feedback 1st before I startI appreciate the response
I will let you know how it goes -
@Ray my install and fixuppm2.sh scripts use the pm2_MagicMirror.json to give the app a good name
(instead of mm.sh)
https://github.com/sdetweil/MagicMirror_scriptspm2 status shows the names of the managed apps.
pm2 info (appname or number) give all the info about it
pm2 --help shows all it can do
-
@sdetweil okay I think I get it
so just to make sure my current magic mirror folder is called
I will be renaming that MagicMirror_1st_mirror
not shouldn’t hurt anything. It should start as normal -
@Ray you don’t have to make a new folder, only a new config file
-
@sdetweil I am aware of that. now Sam, I did not know we could do all that.
In the future I will have 2 options now
But following your instructions that you gave meI wanted to thank you very much for the help that you gave me
I followed your instructions that you gave me after several tries, I now have
2 MagicMirror folders one is labeled MagicMirror and the 2nd 1 I labeled
MagicMirror_First_Mirror
and both folders are now listed in pm2│ 1 │ FirstMirror │ fork │ 0 │ stopped │ 0% │ 0b │
│ 0 │ MagicMirror │ fork │ 0 │ stopped │ 0% │ 0b
Thank you very much for your help.
I would be happy to post my procedures. for other beginners If you like.
Just let me know and I will post it here. It’s my way of giving back to this site for all the hard work everyone does -
@Ray cool! glad you got it working
did u actually create two directories (folders) with Magic mirror installed ?
you didnt have to do that… just different start scripts using different config files
-
@sdetweil I understand that now, but I already made it
and it works perfectly. in the future I will have 2 choices nowThe reason I was looking for something like this. I want to generate a separate mirror for testing. That way if it crashes I won’t have to worry about it because all files and folders will be separated from the 2nd mirror folder
the 2 separate magic mirrors will work perfectly for me. I will definitely consider your 2nd option. In the future -
@Ray ok, understood