Today I am going to show you how to install MagicMirror² Software on your Raspberry Pi 3 B+.
In fact, after reading this article, you will be able to install the software on your own with all of the kinks worked out.
Let’s dive right in…
Step #1: Update the OS
sudo apt-get update
sudo apt-get upgrade
Step #2: Install MagicMirror²
curl -sL https://raw.githubusercontent.com/MichMich/MagicMirror/master/installers/raspberry.sh | bash
Copy config.js.sample to config.js
cp MagicMirror/config/config.js.sample MagicMirror/config/config.js
Edit config.js (see magicmirror.builders for configuration options)
Turn off the screensaver
sudo nano ~/.config/lxsession/LXDE-pi/autostart
Add the following lines:
@xset s noblank @xset s off @xset -dpms
sudo nano /etc/lightdm/lightdm.conf
Add the following line below [SeatDefaults]
xserver-command=X -s 0 -dpms
Step #3: Configure Settings
- Get Weather API Key: http://openweathermap.org/
- Add API Code to your config file:
sudo nano ~/MagicMirror/config/config.js
How to Start Software Automatically When Booting
Install PM2 using NPM:
sudo npm install -g pm2
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.
PM2 will now show you a command you have to execute.
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.
cd ~ nano mm.sh
Add the following lines:
cd ~/MagicMirror DISPLAY=:0 npm start
Save and close, using the commands
CTRL-X. Now make sure the shell script is executable bij performing the following command:
chmod +x mm.sh
Start MagicMirror with the following command:
pm2 start mm.sh
Save your configuration:
Your MagicMirror will now start automatically on boot. If you make any changes, you can reload MagicMirror with the following command:
pm2 restart mm
Additional configuration instructions can be found at: www.magicmirror.builders.
3rd Party Modules
MagicMirror² Software is completely open source and people are crafting modules to add additional functionality to the smart mirror widgets.
You can check them out here:
Now I Want to Hear From You.
There you have it:
My complete instructions on how to install MagicMirror² software.
Now I’d like to hear from you…
Did you struggle with any of steps I outlined?
Are you going to install any of the 3rd party modules?
Let me know by leaving a comment below right now.