Configuring autostart with pm2
derekhuffman last edited by paviro
I have installed the pm2 stuff and after running ‘pm2 start mm.sh’ the Pi reboots and the Magic Mirror opens.
Now, how do I ‘pm2 save’ to save the current state? Apologies - I’m new to all this. Is there a way to exit the MagicMirror and get back to Terminal to do so? Since I can’t, when I turn off the power and reboot, the Pi just goes back to Raspian.
I really want to get rid of this keyboard and mouse!
- the rPi should not reboot when you first start the process - are you sure it’s actually rebooting, as opposed to you just seeing a gray screen flash, then black, before MM starts displaying the elements on screen? If the rPi reboots, you should see the full log of it starting up, with 4 raspberry icons at the top.
- Issuing the
pm2 savecommand is best done through a remote connection. One way is to setup VNC on the rPi, and use something such as RealVNC (http://www.realvnc.com/) on Windows to remotely access the rPi. Another method is to use an SSH client like PuTTY (http://www.putty.org/) to log into the rPi. Once logged in, you can issue
pm2commands such as:
pm2 save- save the current process list so they automatically relaunch
pm2 stop mm- stop the Magic Mirror process and exit back to desktop
pm2 show mm- show the current status of the Magic Mirror process
PS: the default login on an rPi is:
I strongly recommend you change the password once you’re logged in by issuing the
passwdcommand. Remember the new password you set.
Regarding the ‘keyboard and mouse’ part in your post … I use a wireless set. So the rPi is mounted behind the monitor and only has 2 wires on it: power and HDMI. There’s a USB dongle plugged in that’s for the keyboard and mouse which I rarely use. Specially since I log in remotely. The only time I need the mouse or keyboard is if something bad happened and the rPi won’t boot up normally. But other than that, not needed.