Magic Mirror
Magic Mirror

 

A Magic Mirror is a raspberry pi powered monitor behind a two-sided mirror. it’s an open source modular magic mirror platform. With a growing list of installable modules, the MagicMirror2  permits you to convert your hallway or rest room mirror into your personal assistant. It focuses on a modular plugin system and uses electron as an application wrapper. Therefore, no more web server or browser installs necessary!

A Magic mirror is a mirror with a screen behind it. That screen can be an android tablet or a monitor. The monitor will make for a larger mirror. It’s also an excellent way to repurpose an old LCD monitor. However, you can’t cram a full computer in there, unless you use a Raspberry Pi.

The Pi is a credit card-sized computer. It runs on Linux-based operating systems, and it has a large community of developers. In fact, the magic mirror DIY community prefers the Pi to all other ways.

 

What is the use of a magic Mirror?

Magic Mirror is the newest in high tech home decor. A custom mirror installation is both a mirror and a display. It takes information from the net including time, weather, stock reports, quotes and more to keep you up to date.

Magic Mirror Technology

Vanity Vision Glass and Acrylic are the newest in magic mirror technology. They provide shaded free and bright text through the mirror with a display behind it.

Before you start, here is a list of all the specified items for the project:

  • An LCD Monitor
  • Raspberry Pi
  • A wooden Frame
  • Two Way Acrylic Glass Mirror
  • HDMI Cable
  • Micro HDMI Cable for Pi Power supply
  • Wood Glue
  • Screws
  • Keyboard (USB)
  • Mouse (USB)

 

How to Make a Wooden Frame and How to Install a Magic Mirror

Raspberry Pi Support

Electron, the app wrapper around MagicMirror², it will only support the Raspberry Pi 2.

Install Magic Mirror (Automatic)

Command: bash -c “$(curl -sL

https://raw.githubusercontent.com/MichMich/MagicMirror/master/installers/raspberry.sh)”

 

Install Magic Mirror (Mutual)

  • Download and install the latest Node.js version.
  • Clone the repository and check out the master branch: git clone https://github.com/MichMich/MagicMirror
  • Enter the repository: cd ~/MagicMirror
  • Install and run the app: npm install && npm start

 

Raspberry Configuration and autostart

Configuring the Raspberry Pi

Rotating the screen and hide Rainbow colored cube

edit /boot/config.txt:

sudo nano /boot/config.txt

display_rotate=1

avoid_warnings=1

 

Reboot the pi

sudo reboot

 

Autohiding the Mouse Pointer

Install unclutter:

sudo apt-get install unclutter

 

Disabling the screen saver

edit ~/.config/lxsession/LXDE-pi/autostart:

sudo nano ~/.config/lxsession/LXDE-pi/autostart

@xset s noblank

@xset s off

@xset -dpms

Edit /etc/lightdm/lightdm.conf:

sudo nano /etc/lightdm/lightdm.conf

xserver-command=X -s 0 -dpms

 

Disable Wi-Fi Power Save

Edit /etc/modprobe.d/8192cu.conf

sudo nano /etc/modprobe.d/8192cu.conf

 

Disable power saving

options 8192cu rtw_poyour_mgnt=0 rtw_enusbss=1 rtw_ips_mode=1

 

For Raspberry Pi 3

Edit /etc/network/interfaces

sudo nano /etc/network/interfaces

wireless-power off

 

Reboot your PI

sudo reboot

 

Enable File Sharing with OS X

Install Netatalk:

sudo apt-get install netatalk

 

Enable VNC

Install x11vnc:

sudo apt-get install x11vnc

 

Set VNC password

x11vnc -storepasswd

 

Create an auto-start file

cd ~/.config

mkdir autostart

cd autostart

nano x11vnc.desktop

[Desktop Entry]

Encoding=UTF-8

Type=Application

Name=X11VNC

Comment=

Exec=x11vnc -forever -usepw -display :0 -ultrafilexfer

StartupNotify=false

Terminal=false

Hidden=false

 

Auto Beginning Magic Mirror

To automatically begin Magic Mirror on boot, and even ways to keep it running in case of a failure.

Using PM2

PM2 is a production method manager for Node.js applications with an inbuilt load balancer. It permits you to keep applications alive forever, to reload them without downtime and to facilitate common system admin tasks. In this case, you will use it to keep a shell script running.

 

Install PM2

sudo npm install -g pm2

 

Start PM2 on Boot

pm2 startup

 

Make a MagicMirror begin script

cd ~

nano mm.sh

cd ~/MagicMirror

DISPLAY=:0 npm start

 

Starting your MagicMirror with PM2

pm2 start mm.sh

 

Enable restarting of the MagicMirror script

pm2 save

 

Controlling MagicMirror via PM2.

Restarting your MagicMirror

pm2 restart mm

Stopping your MagicMirror

pm2 stop mm

Show the MagicMirror logs

pm2 logs mm

Show the MagicMirror process data

pm2 show mm

 

Updating your MagicMirror

git pull && npm install

 

Modules

Clock

This module is one of the default modules of the Magic Mirror. This module displays the current date and time. The data will be updated real-time.

Using the module

To use the clock module, add it to the modules array in the config/config.js file:

modules: [

{

module: “clock”,

position: “top_left”,        // This can be any of the regions (right, top, down etc).

config: {

// the config property is optional.

// See ‘Configuration options’ for more information.

}

}

]

 

Hello World

The hello world module is one of the default modules of the Magic Mirror. It is an easy way to display a static text on the mirror.

Using the module

To use this module, add the hello world module to the modules array in the config/config.js file:

modules: [

location: “Amsterdam,Netherlands”,

locationID: “”, //Location ID from http://openyouathermap.org/help/city_list.txt

appid: “abcde12345abcde12345abcde12345ab” //openyouathermap.org API key.

]

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.