This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| raspberry_magic_mirror [2020/01/25 20:20] – herwarth | raspberry_magic_mirror [2024/04/19 12:38] (current) – herwarth | ||
|---|---|---|---|
| Line 21: | Line 21: | ||
| tmpfs / | tmpfs / | ||
| tmpfs / | tmpfs / | ||
| - | tmpfs / | + | tmpfs / |
| tmpfs / | tmpfs / | ||
| </ | </ | ||
| Line 62: | 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. | ||
| Line 90: | Line 88: | ||
| console=serial0, | console=serial0, | ||
| </ | </ | ||
| - | ===== Install | + | ===== Install===== |
| We are going to use the recommended manual way: | We are going to use the recommended manual way: | ||
| ====Install packages==== | ====Install packages==== | ||
| Line 100: | Line 98: | ||
| sudo apt-get -y install git nodejs libnss3 libxtst-dev libxss-dev | sudo apt-get -y install git nodejs libnss3 libxtst-dev libxss-dev | ||
| </ | </ | ||
| - | Install Magic Mirror | + | ==== Install Magic Mirror |
| < | < | ||
| cd ~ | cd ~ | ||
| Line 113: | Line 111: | ||
| cd ~/ | cd ~/ | ||
| cp config.js.sample config.js | 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 | Reboot and enjoy | ||
| + | {{tag> | ||