The Official Raspberry Pi Projects Book - Projects_Book_v4

(singke) #1

Install the software to your Raspberry Pi and make your mirror truly magical


The sample configuration file gets you
started, but there’s way more you can do

MIRROR


PROGRAM YOUR


nce you’ve hung your mirror on the wall, or
placed it wherever it’s now going to live, it’s
time to install the software. Michael has made
the process incredible easy, and all you need to do is
type the following command:

curl -sL http://magpi.cc/MirrorInstall | bash

It will go through the installation process and set up
some defaults... and that’s it! Your mirror is ready to use.

PERSONALISATION
Well, almost ready: you may want to have a quick
look at editing those default values to make sure it’s
running as you’d like it to. The settings are kept in a
config file which you can create by using:

cp ~/MagicMirror/config/config.js.sample ~/
MagicMirror/config/config.js

You can now access and modify it with:

nano ~/MagicMirror/config/config.js

Here are some of the options you can modify...

O


OPTION DESCRIPTION


port The port on which the MagicMirror server will run
on. The default value is 8080.

address The IP address of the mirror you use to connect to it.

ipWhitelist The list of IPs which are allowed to connect to
the mirror. The default value is ["127.0.0.1",
"::ffff:127.0.0.1", "::1"]. It is
possible to specify IPs with subnet masks
(["127.0.0.1", "127.0.0.1/24"]) or define
IP ranges (["127.0.0.1", ["192.168.0.1",
"192.168.0.100"]]).

zoom This allows scaling of the mirror interface with a
given zoom factor. The default value is 1.0.

language The language of the interface. Possible values are
en, nl, ru, fr, and so on, but the default value is en.

timeFormat The style of clock to use. The accepted values are
12 and 24. The default is 24.

units The units that will be used in the default weather
modules. Possible values are metric or imperial.
The default is metric.

modules An array of active modules. There must always be
an object in here.

electronOptions An optional array of Electron (browser) options.
This allows configuration of e.g. the browser screen
size and position (defaults .width = 800 and
.height = 600). Kiosk mode can be enabled by
setting .kiosk = true, .autoHideMenuBar =
false, .fullscreen = false.

Feature


(^128) The Official Raspberry Pi Projects Book raspberrypi.org/magpi

Free download pdf