This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| raspberry_magic_mirror [2020/01/25 20:11] – created herwarth | raspberry_magic_mirror [2024/04/19 12:38] (current) – herwarth | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Raspberry as Magic Mirror ====== | + | ====== Raspberry |
| =====Prerequisites===== | =====Prerequisites===== | ||
| Use the Kiosk howto to install a R/O Kiosk. Magic Mirror software runs from the home directory of the user and can only be R/W. I used a USB SSD connected to the USB3 port of the Raspberry Pie 4. | Use the Kiosk howto to install a R/O Kiosk. Magic Mirror software runs from the home directory of the user and can only be R/W. I used a USB SSD connected to the USB3 port of the Raspberry Pie 4. | ||
| Line 21: | Line 21: | ||
| tmpfs / | tmpfs / | ||
| tmpfs / | tmpfs / | ||
| - | tmpfs / | + | tmpfs / |
| - | tmpfs / | + | tmpfs / |
| </ | </ | ||
| Reboot and see if /home is mounted. Create a directory for the user pi | Reboot and see if /home is mounted. Create a directory for the user pi | ||
| Line 30: | Line 30: | ||
| chown pi. /home/pi | chown pi. /home/pi | ||
| </ | </ | ||
| - | ===== X-server | + | ===== Display settings ===== |
| + | ==== X-server ==== | ||
| Now we are going to undo the changes of the system wide autostart and put them in the homedir of the pi user. Make it look like it was: | Now we are going to undo the changes of the system wide autostart and put them in the homedir of the pi user. Make it look like it was: | ||
| <code - / | <code - / | ||
| Line 61: | Line 62: | ||
| xset s noblank | xset s noblank | ||
| unclutter -idle 0 & | unclutter -idle 0 & | ||
| - | cd ~/ | ||
| xrandr --output HDMI-1 --rotate left & | xrandr --output HDMI-1 --rotate left & | ||
| - | npm start & | ||
| </ | </ | ||
| Rotate the graphical interface does not seem to work on a Pi 4. As you can see we are using xrandr to rotate. Rotation of the console must be disabled and the GL driver must be enabled. | Rotate the graphical interface does not seem to work on a Pi 4. As you can see we are using xrandr to rotate. Rotation of the console must be disabled and the GL driver must be enabled. | ||
| Use raspi-config to change to GL driver: 7 Advanced Options -> A8 GL driver -> G2 GL (Fake KMS) | Use raspi-config to change to GL driver: 7 Advanced Options -> A8 GL driver -> G2 GL (Fake KMS) | ||
| + | ==== Console ==== | ||
| Then change / | Then change / | ||
| Line 84: | Line 84: | ||
| disable_splash=1 | disable_splash=1 | ||
| </ | </ | ||
| - | + | The console messages will be in unrotated format which is ugly. Disable all console logging: | |
| - | + | <code - / | |
| - | + | console=serial0, | |
| + | </ | ||
| + | ===== Install===== | ||
| + | We are going to use the recommended manual way: | ||
| + | ====Install packages==== | ||
| + | We must be the pi user | ||
| + | < | ||
| + | curl -sL https:// | ||
| + | </ | ||
| + | < | ||
| + | sudo apt-get -y install git nodejs libnss3 libxtst-dev libxss-dev | ||
| + | </ | ||
| + | ==== Install Magic Mirror ==== | ||
| + | < | ||
| + | cd ~ | ||
| + | git clone https:// | ||
| + | cd MagicMirror/ | ||
| + | npm install | ||
| + | npm audit fix | ||
| + | npm install electron@6.0.12 | ||
| + | </ | ||
| + | Now copy the sample config in place: | ||
| + | < | ||
| + | cd ~/ | ||
| + | cp config.js.sample config.js | ||
| + | </ | ||
| + | ==== Autostart Magic Mirror on boot ==== | ||
| + | Install PM2 process manager | ||
| + | < | ||
| + | sudo npm install -g pm2 | ||
| + | pm2 startup | ||
| + | </ | ||
| + | The startup command creates a commandline we need to execute to create a systemd service. Execute it. In our case: | ||
| + | < | ||
| + | sudo env PATH=$PATH:/ | ||
| + | </ | ||
| + | Create a little script in homedir of pi with name mm.sh | ||
| + | <code - / | ||
| + | cd ~/ | ||
| + | DISPLAY=:0 npm start | ||
| + | </ | ||
| + | < | ||
| + | chmod +x mm.sh | ||
| + | </ | ||
| + | < | ||
| + | bash -c " | ||
| + | </ | ||
| + | Reboot and enjoy | ||
| + | {{tag> | ||