Digital Dashboard - Part 2
This guide is broken into two parts. This part I show you how to setup your raspberry pi as a digital dashboard.
In Part 1, I show you how to mount your tv and sound bar to have a clean wire-free look to it.
If you have any questions, reddit is the best place right now for help from myself or others.
17. Copy the next line and wait for it to install
sudo apt install -y nodejs
18. Clone the repository and check out the master branch by copying and pasting the command into the terminal window.
git clone <https://github.com/MichMich/MagicMirror
>
19. We will now install the Magic Mirror Software. First we need to go to that folder by copying and pasting this command.
cd MagicMirror/
20.Install the application by copying and pasting this command. This step may take some time.
npm install
21. Make a copy of the config sample file by copying and pasting the command into the terminal window
cp config/config.js.sample config/config.js
22. Start the Magic Mirror application by copying and pasting the command into the terminal window
nom run start
This may take a bit to start the first time. Your screen should go black for a second before the modules begin to load. To exit the Magic Mirror application, press Control+Q
24. copy and paste the following command to install a program called PM2
sudo npm install -g pm2
25. To make sure PM2 can do it's job when (re)booting your operating system, it needs to be started on boot. Luckily, PM2 has a handy helper for this. Copy and paste
pm2
startup
PM2 will now show you a command you need to execute.
Make a MagicMirror start script.
26. To use PM2 in combination with MagicMirror, we need to make a simple shell script. Preferable, we put this script outside the MagicMirror folder to make sure it won't give us any issues if we want to upgrade the mirror. Copy and paste the following command:
cd ~ nano mm.sh
27. Add the following lines:
cd ./MagicMirror DISPLAY=:0 npm start
This will have the Magic Mirror software automatically start on HDMI 0, so you can still use HDMI 1 if you need to access your pi without closing the Magic Mirror software.
28. Save and close, using the commands:
CTRL-O
and then CTRL-X
29. Now make sure the shell script is executable by performing the following command:
chmod +x mm.sh
Starting your MagicMirror with PM2
30. Simply start your mirror with the following command:
pm2 start mm.sh
You mirror should now boot up and appear on your screen after a few seconds. Press CTRL + Q to exit.
Enable restarting of the MagicMirror script.
31. To make sure the MagicMirror restarts after rebooting, you need to save the current state of all scripts running via PM2. To do this, execute the following command
pm2 save
Then press CTRL+X then press Y
And that's all there is! You MagicMirror should now reboot after start, and restart after any failure.