04
Install MagicMirror^2
Now the fun part. MagicMirror^2 is an Electron
app: a web app wrapped up in its own browser.
Installing it manually is complex, but Michael
and the team have provided an elegant script that
automates the entire process. Get to a command-
line prompt by using Terminal or an SSH client and
carefully enter the following command:
bash -c "$(curl -sL
https://raw.githubusercontent.com/MichMich/
MagicMirror/master/installers/raspberry.sh)"
(For more detailed instructions, see
magpi.cc/magicmirror.)
The script will now install Node (the
programming environment that runs
MagicMirror^2 ), Electron, and the app itself.
05
Configuring MagicMirror^2
During installation you’ll see a lot of
text fly by the screen, along with a couple of
warnings that can be safely ignored. You will be
asked at one point whether you want to install
and enable pm2. Process Manager 2 (pm2) is an
application that simplifies the running of Node
apps (or anything else), starting things at boot or
automatically restarting apps when they crash.
If you reply ‘yes’, pm2 will start MagicMirror^2
immediately on boot. You will also be asked if you
want to start the app right away. If you’re eager to
see it in action, say yes.
06
Initial configuration
MagicMirror^2 is now installed and you
should be able to see the display on your mirror.
The installation process has tweaked a lot of
settings to improve the display quality and has
disabled things such as screen sleeping. You can
customise what is displayed on screen and its
position by having a look at the configuration
file located at ~/MagicMirror/config/config.js.
If you’re finding the screen too crowded, you can
tweak the layout by changing the value of ‘zoom’.
We found 0.6 worked well for the Raspberry Pi
touchscreen. We’ll look into more of these settings
next time. For now, go and get a hook and put up
your new fancy magic mirror!
Your maker.
Photographing a
magic mirror presents
unique challenges
MagicMirror^2 defaults
to a high-contrast black
and white display which
works well with the
reduced visibility
Tip! Restarting
MagicMirror^2
If you have made
a configuration
change, you can
restart without
having to reboot
by typing this at
the command
line: pm2 restart
MagicMirror
GREAT USES FOR
YOUR MAGIC MIRROR
We’re going to be looking at
uses for your magic mirror in
upcoming issues of The MagPi.
In the meantime, let’s whet
your appetite with some of
the cool things you can do.
The link below goes to the
exhaustive list of add-ons
available for MagicMirror^2. They
cover anything from calendar
integration to up-to-the-minute
finance information. Need to
know how many minutes until
the next bus? No problem. Some
go beyond the display itself,
offering voice control via Alexa
and Google Home. How about
a Pokémon of the day or video
live stream? Can’t find what
you need? If you know some
JavaScript, it is surprisingly easy
to write your own modules.
magpi.cc/mirrormodules
TUTORIAL
30 magpi.cc
MagicMirror^2 is now installed
and you should be able to
see the display