MagicMirror is an open source modular smart mirror platform. With a growing list of installable modules, the MagicMirror allows you to convert your hallway or bathroom mirror into your personal assistant. MagicMirror² focuses on a modular plugin system and uses Electron as an application wrapper. So no more web server or browser installs necessary!
Lorna Kimani
Sylvester Omondi
Gloria Givondo
Vincent Otach
Electron, the app wrapper around MagicMirror², only supports the Raspberry Pi 2/3. The Raspberry Pi 0/1 is currently not supported. If you want to run this on a Raspberry Pi 1, use the server only feature and setup a fullscreen browser yourself.
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt install -y nodejs
git clone https://github.com/Lornakimani62/Rafiki-Smart-Mirror-.git
cd MagicMirror/
npm install && npm start
\
For Server Only use: npm install && node serveronly
.:warning: Important!
npm install
will take a very long time, often with little or no terminal response! \
For the RPi3 this is ~10 minutes and for the Rpi2 ~25 minutes. \
Do not interrupt or you risk getting a :broken_heart: by Raspberry Jam.Also note that:
npm start
does not work via SSH. But you can use DISPLAY=:0 nohup npm start &
instead. \
This starts the mirror on the remote display.npm start dev
which will start MM with Dev Tools enabled.ALT
key.Developer Tools
from mirror mode, use CTRL-SHIFT-I
or ALT
and select View
.In some cases, you want to start the application without an actual app window. In this case, you can start MagicMirror² in server only mode by manually running node serveronly
or using Docker. This will start the server, after which you can open the application in your browser of choice. Detailed description below.
Important: Make sure that you whitelist the interface/ip (ipWhitelist
) in the server config where you want the client to connect to, otherwise it will not be allowed to connect to the server. You also need to set the local host address
field to 0.0.0.0
in order for the RPi to listen on all interfaces and not only localhost
(default).
var config = {
address: "0.0.0.0", // default is "localhost"
port: 8080, // default
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:172.17.0.1"], // default -- need to add your IP here
...
};
This is when you already have a server running remotely and want your RPi to connect as a standalone client to this instance, to show the MM from the server. Then from your RPi, you run it with: node clientonly --address 192.168.1.5 --port 8080
. (Specify the ip address and port number of the server)
Copy /home/pi/MagicMirror/config/config.js.sample
to /home/pi/MagicMirror/config/config.js
. \
Note: If you used the installer script. This step is already done for you.
Modify your required settings. \
Note: You'll can check your configuration running npm run config:check
in /home/pi/MagicMirror
.
The following properties can be configured:
Option | Description |
---|---|
port |
The port on which the MagicMirror² server will run on. The default value is 8080 . |
address |
The interface ip address on which to accept connections. The default is localhost , which would prevent exposing the built-in webserver to machines on the local network. To expose it to other machines, use: 0.0.0.0 . |
ipWhitelist |
The list of IPs from which you are allowed to access the MagicMirror². The default value is ["127.0.0.1", "::ffff:127.0.0.1", "::1"] , which is from localhost only. Add your IP when needed. You can also specify IP ranges with subnet masks (["127.0.0.1", "127.0.0.1/24"] ) or directly with (["127.0.0.1", ["192.168.0.1", "192.168.0.100"]] ). Set [] to allow all IP addresses. For more information see: follow post ipWhitelist HowTo |
zoom |
This allows to scale the mirror contents with a given zoom factor. The default value is 1.0 |
language |
The language of the interface. (Note: Not all elements will be localized.) Possible values are en , nl , ru , fr , etc., but the default value is en . |
timeFormat |
The form of time notation that will be used. Possible values are 12 or 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. The array must contain objects. See the next table below for more information. |
electronOptions |
An optional array of Electron (browser) options. This allows configuration of e.g. the browser screen size and position (example: electronOptions: { fullscreen: false, width: 800, height: 600 } ). Kiosk mode can be enabled by setting kiosk: true , autoHideMenuBar: false and fullscreen: false . More options can be found here. |
customCss |
The path of the custom.css stylesheet. The default is css/custom.css . |
Module configuration:
Option | Description |
---|---|
module |
The name of the module. This can also contain the subfolder. Valid examples include clock , default/calendar and custommodules/mymodule . |
position |
The location of the module in which the module will be loaded. Possible values are top_bar , top_left , top_center , top_right , upper_third , middle_center , lower_third , bottom_left , bottom_center , bottom_right , bottom_bar , fullscreen_above , and fullscreen_below . This field is optional but most modules require this field to set. Check the documentation of the module for more information. Multiple modules with the same position will be ordered based on the order in the configuration file. |
classes |
Additional classes which are passed to the module. The field is optional. |
header |
To display a header text above the module, add the header property. This field is optional. |
disabled |
Set disabled to true to skip creating the module. This field is optional. |
config |
An object with the module configuration properties. Check the documentation of the module for more information. This field is optional, unless the module requires extra configuration. |
The following modules are installed by default.
If you want to update your MagicMirror² to the latest version, use your terminal to go to your Magic Mirror folder and type the following command:
git pull && npm install
If you changed nothing more than the config or the modules, this should work without any problems.
Type git status
to see your changes, if there are any, you can reset them with git reset --hard
. After that, git pull should be possible.
Please keep the following in mind:
Copyright (c) Rafiki-Smart-Mirror