Creating a Smart Mirror with Raspberry Pi

Follow “Embedded Mixed Bag“, star the public account, and let’s improve together!

Creating a Smart Mirror with Raspberry Pi

Source: Internet

1. Software Introduction

MagicMirror² is an open-source modular smart mirror system (Raspberry Pi Smart Mirror) that allows you to build your smart mirror, becoming the brain of your mirror, intelligently displaying time, calendar, weather, news, voice interaction, and more. It focuses on a modular plugin system and uses Electron as the application wrapper, so there is no need to install a web server or browser.

2. Project Address

https://magicmirror.builders/

3. Features

  • Open source

  • Modules: The core of MagicMirror² includes a powerful API that allows third-party developers to build additional modules, using existing modules or developing other modules themselves

  • Wide community

4. Installation

Thanks to @MichMich’s excellent open-source code, installing MagicMirror is so convenient and simple.

Step 1

After setting up the Raspberry Pi, upgrading the system, and rebooting, open the terminal and enter:

bash -c “$(curl -sL https://raw.githubusercontent.com/MichMich/MagicMirror/master/installers/raspberry.sh)”

Then you will see the interface below and start the installation.

Creating a Smart Mirror with Raspberry Pi

Step 2

For MagicMirror, some additional settings are required. First, set the screen to display vertically. You need to edit a boot file (Note: Vertical display is not mandatory; if you want wide display or as a landscape display, it is unnecessary) entersudo nano /boot/config.txt, add the following content, and where to add it doesn’t matter:

# Rotate display vertically
display_rotate=1
After writing, pressCTRL-X, YES to confirm save.Creating a Smart Mirror with Raspberry Pi

Step 3

Disable screensaver and lock screen. Settings need to be made in two places, first in the auto boot file:sudo nano /etc/xdg/lxsession/LXDE-pi/autostart Add the following at the end of the file, and save:
@xset s noblank
@xset s off
@xset -dpms

Creating a Smart Mirror with Raspberry PiThen, enter in the terminalsudo nano /etc/lightdm/lightdm.conf Scroll down to find[SeatDefaults] section, findxserver-command, modify it toxserver-command=X -s 0 -dpms After writing, pressCTRL-X, YES to confirm save.Creating a Smart Mirror with Raspberry Pi(Tip: If your system is ubuntu-mate, the above settings are incorrect. You need to set both operations and display to Never in the control center – Power Preferences)

Step 4

The Raspberry Pi system will disable inactive modules by default, including the WIFI module, which may occasionally cause MagicMirror to not receive updates such as news or weather. We can disable power-saving mode in the interface file:sudo nano /etc/network/interfaces Findwlan0, add belowwireless-power off, after adding save and reboot the systemsudo reboot.Creating a Smart Mirror with Raspberry PiAfter rebooting, open the terminal, enteriwconfig, you will find that power-saving mode has been disabled.Creating a Smart Mirror with Raspberry Pi(Tip: The above settings are not applicable to ubuntu-mate system. The specific solution is shown in the figure below.)Creating a Smart Mirror with Raspberry Pi

At this point, you have completed the basic setup of MagicMirror.

Next, create a usable configuration file for testing. Inside the MagicMirrorconfig folder:

pi@magicpi:~ $ cd MagicMirror/config
pi@magicpi:~/MagicMirror/config $ cp config.js.sample config.js
Try to start MagicMirror:
pi@magicpi:~/MagicMirror/config $ cd $HOME/MagicMirror
pi@magicpi:~/MagicMirror $ npm start

If all goes well, your display will show the MagicMirror interface. The weather module may prompt you that there is no valid APPID, but after simple setup it will look like the picture below:Creating a Smart Mirror with Raspberry PiFinally, complete your smart mirror according to the above steps, as shown in the picture below.Creating a Smart Mirror with Raspberry PiPerfect! Your Raspberry Pi smart mirror has been successfully created! Congratulations~

References:

https://my.oschina.net/u/4518087/blog/4758744

This article is sourced from the internet, copyright belongs to the original author. If there are copyright issues, please contact me for deletion.

You may also like:

C Language printf() Detailed Explanation Ultimate Guide

2021-06-22

Creating a Smart Mirror with Raspberry Pi

Basics | Starting with these knowledge points makes learning microcontrollers much easier

2021-06-19

Creating a Smart Mirror with Raspberry Pi

Reply with 1024 in the WeChat public account chat interface to get embedded resources; reply with m to view the article summary.

Leave a Comment

Your email address will not be published. Required fields are marked *