Magic Mirror

I had seen this in a youtube video and wanted to make one for myself, this way i can see various things like:

  • Time
  • Weather
  • Calendar
  • Latest News
  • Spotify Music

Some of the materials used:

  • Picture frame big enough for screen.
  • One way mirror film, bigger than picture frame.
  • In my case an old computer screen (dismanteled).
  • Also in my case an old laptop (dismanteled).
  • Wires and switches so we can turn everything on without needing to take it of the wall.

On my first iteration i had the server running on the laptop which is slow (old devices problem). After that i had Magic Mirror running on a server which speeded things up and on the laptop i had Spotify and Chrome running in fullscreen with the webpage from the local magic mirror server.

This way it's still possible to use Spotify from your phone and choose song, start and stop music on the Laptop.

How to setup an Magic Mirror Server

I have various Magic Mirror Servers running on one Ubuntu server to show this i have a mini guide with some if not all the necesary steps to get one running.

  1. Download and install the latest Node.js version:
    • curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
    • sudo apt install -y nodejs
  2. Download and install the latest Node.js version:
    • git clone https://github.com/MichMich/MagicMirror
  3. Enter the repository:
    • cd MagicMirror/
  4. Install the application:
    • npm install
  5. Make a copy of the config sample file:
    • cp config/config.js.sample config/config.js
  6. Change config to allow local network connections
    • nano config/config.js
    • on the address line substitute localhost with 0.0.0.0
    • To close the script press CTRL + X followed by Y when prompted to save and then Return
  7. Install PM2:
    • sudo npm install -g pm2
  8. Start PM2
    • cd ~
    • nano mm.sh
    • you can create more than one mm.sh if you have various magicmirror servers
  9. Add the following to the mm.sh script
    • cd ~/MagicMirror
    • DISPLAY=:0 npm start
    • To close the script press CTRL + X followed by Y when prompted to save and then Return
  10. Testing if the mm.sh script is excecutable
    • chmod +x mm.sh
    • After a short while, you should get confirmation that the script is executable.
  11. Now you can start Magic Mirror by entering:
    • pm2 start mm.sh
  12. Don't forget to save the state of the scripts running via PM2
    • pm2 save

With all this you have created a basic version of a magicmirror server which you can access on any browser inside the local network. The only thing missing is personalizing the modules to your liking.