티스토리 뷰

1. RPi 설치

Note that you will need to install the latest full version of Raspbian, don't use the Lite version.

1.1. Apt update

sudo apt-get update sudo apt-get upgrade

1.2. Hangul font setup

sudo apt-get --yes install fonts-nanum fonts-symbola reboot


2. MagicMirror2 설정

원본링크 : https://github.com/MichMich/MagicMirror#manual-installation

2.1. 설치

2.1.1. 손쉬운 자동 설치

새로 설치한 RPi에 MagicMirror² 를 설치하는 경우, 다음의 bash 명령을 실행

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

2.1.2. 메뉴얼 설치

최신버전 Node.js 다운로드와 설치

curl -sL https://deb.nodesource.com/setup\_10.x | sudo -E bash -sudo apt install -y nodejs

레포지토리 복제와 마스터 브렌치 체크아웃

git clone https://github.com/MichMich/MagicMirror

레포지토리로 이동

cd MagicMirror/

앱 설치와 실행

npm install && npm start

서버 온리 모드 실행은

npm install && node serveronly

중요: 앱 설치(npm install)는 시간이 오래 걸려요.

note: npm start 는 SSH에서 동작 안함. 대신 원격 디스플레이에서 미러를 시작하기 위해서DISPLAY=:0 nohup npm start & 을 사용 툴바메뉴 액세스를 원하면 ALT 키를 누름

미러모드에서 (web) Developer Tools로 변경하려면 CTRL-SHIFT-I 또는 ALT와 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 ip
Whitelist: ["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)

도커

MagicMirror² in server only mode can be deployed using Docker. After a successful Docker installation you just need to execute the following command in the shell:

docker run -d \ --publish 80:8080 \ --restart always \ --volume ~/magic_mirror/config:/opt/magic_mirror/config \ --volume ~/magic_mirror/modules:/opt/magic_mirror/modules \ --name magic_mirror \ bastilimbach/docker-magicmirror

To get more information about the available Dockerfile versions and configurations head over to the respective GitHub repository.

2.2. 설정

​2.2.1. Raspberry Specific

MagicMirror² 초기 설정에 다음의 위키링크 참고

2.2.2. 일반

설정파일 복사 /home/pi/MagicMirror/config/config.js.sample을 /home/pi/MagicMirror/config/config.js로 복사

Note: 자동 설치 스크립트를 사용할 경우, 이미 설정파일 복사도 자동으로 수행됨

필요한 설정값 변경

Note: 설정값 체크를 위해 /home/pi/MagicMirror 디렉토리에서 npm run config:check 실행​

속성

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.

모듈 설정

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.

2.3. 모듈

디폴트 설치 모듈

For more available modules, check out out the wiki page MagicMirror² 3rd Party Modules. If you want to build your own modules, check out the MagicMirror² Module Development Documentation and don't forget to add it to the wiki and the forum!

2.4. 업데이트

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.


3. RPi 설정

3.1. Electron's CPU 사용을 줄이기 위해 Open GL 드라이버 활성화 <-- 이놈도 화면은 검게

OpenGL 드라이버가 로드되지 않았을 경우 electron가 많은 양의 cpu 파워를 사용하고 RPi가 오버히팅 된다. 이 문제 해결을 위해 다음 라인을 /boot/config.txt에 삽입하여 experimental desktop Open GL 드라이버를 사용한다.

sudo nano /boot/config.txt

다음 라인 삽입

dtoverlay=vc4-kms-v3d

ℹ️ Activating the Open GL drive can also be accomplished by using the raspi-config tool by running sudo raspi-config. Go to the Advanced Options menu and select A7 GL Driver. Next, select the G1 GL (Full KMS) OpenGL desktop driver with full KMS. Note that this option will be selected in the menu even when the GL drive is not yet configured.

Unfortunately, as a result, the display_rotate=1 (see below) won't have any effect on the display. If you want to rotate the display when the Open GL driver is in use, we need to use the xrandr tool which allows us to rotate the display when in desktop mode. To do so, edit the autostart file: (autostart file has been moved in the latest version of Raspbian Stretch, Version: April 2019, Release Date: 2019-04-08 Kernel: 4.14 to /etc/xdg/lxsession/LXDE-pi/autostart ):

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

And add the following line:

@xrandr --output HDMI-1 --rotate right

ℹ️ As was mentioned in the forums you can also use the fake kms driver instead.

And add the following line to /boot/config.txt:

dtoverlay=vc4-fkms-v3d

With the fake KMS you can rotate the display from /boot/config.txt (see below)

ℹ️ If you want to rotate the display the other direction, please use: @xrandr --output HDMI-1 --rotate left

After the desktop has finished booting, the display will rotate.

3.2. 스크린 회전, 무지개 큐브 숨기기

⚠️ Please make sure to read the information above about the GL driver since this affects the capability to rotate the display!

edit /boot/config.txt:

sudo nano /boot/config.txt

Add the following line:

display_rotate=1 avoid_warnings=1

#display_rotate=0 Normal

#display_rotate=1 90 degrees

#display_rotate=2 180 degrees

NOTE: You can rotate both the image and touch interface 180º by entering lcd_rotate=2 instead #display_rotate=3 270 degrees

Then reboot the pi:

sudo reboot

3.3. 마우스 커서 자동 숨기기 -- 이 녀석이 데스크탑을 검은색으로 만듬

unclutter 설치

sudo apt-get install unclutter

You can create an .xinitrc script to run the tool.

See https://wiki.archlinux.org/index.php/Unclutter

But a simpler option is to add a line to the end of the file:

$ nano ~/.config/lxsession/LXDE-pi/autostart ... @unclutter -display :0 -idle 3 -root -noevents

This will add a 3 second delay, before the pointer disappears from the screen when not using it.

3.4. 스크린세이버 비활성화

(Please note, you will need the x11-xserver-utils package installed.)

edit /etc/xdg/lxsession/LXDE-pi/autostart:

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

다음 라인 삽입

@xset s noblank @xset s off @xset -dpms

/etc/lightdm/lightdm.conf 편집

sudo nano /etc/lightdm/lightdm.conf

Add the following line below [SeatDefaults] (Please note, you may need to add the [SeatDefaults] section.)

xserver-command=X -s 0 -dpms

3.5. WiFi 파워세이브 비활성

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

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

Add the following lines

# Disable power saving options 8192cu rtw_power_mgnt=0 rtw_enusbss=1 rtw_ips_mode=1

RPi 3 (Jesse 와 이전 버전의 경우)

Edit /etc/network/interfaces

sudo nano /etc/network/interfaces

Add the following line under the wlan0 section

wireless-power off

Reboot your PI

sudo reboot

RPi 3 (라즈비안 스케치의 경우)

We no longer have any default entries in /etc/network/interfaces, instead we make a plugin to the (service) startup script. Copy paste the following into your terminal:

cat << EOF | sudo tee /etc/network/if-up.d/off-power-manager #!/bin/sh # off-power-manager - Disable the internal power manager of the (built-in) wlan0 device # Added by MagicMirrorSetup iw dev wlan0 set power_save off EOF

Then set the permissions and reload the network daemon.

sudo chmod 755 /etc/network/if-up.d/off-power-manager sudo /etc/init.d/networking restart

You don't need to reboot for this to take effect, but do it anyway to make sure it works. After reboot and your wifi is back up, test with:

iw dev wlan0 get power_save

3.6. OS X와 파일 공유 활성화

Netatalk 설치

sudo apt-get install netatalk

3.7. VNC 활성화

x11vnc 설치

sudo apt-get install x11vnc

VNC 암호 설정

x11vnc -storepasswd

auto-start 파일 생성하고

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

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크