Support #980
Updated by Daniel Curtis about 21 hours ago
This is a guide on installing MagicMirror for Debian Bookworm on a Raspberry Pi 2 h2. Prepare the Environment * Make sure everything is up to date: <pre> sudo apt update && sudo apt upgrade </pre> * Install nodejs repo: <pre> curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh sudo bash nodesource_setup.sh </pre> * Install required dependencies: <pre> sudo apt install wayfire seatd xdg-user-dirs git nano openssl ca-certificates wget gnupg libgtk-3-0 libx11-xcb-dev libnss3-dev libxss1 libxtst6 libasound2 libdrm2 libgbm1 fonts-arphic-uming procps arp-scan libatk1.0-0 libraspberrypi-bin libllvm14 libgl1-mesa-dri libglapi-mesa libsensors5 libdrm-radeon1 libelf1 libdrm-amdgpu1 libdrm-nouveau2 libgpiod-dev nodejs </pre> * Edit @cmdline.txt@ : <pre> sudo nano /boot/firmware/cmdline.txt </pre> * Add *wayland=on* to the command line options: <pre> console=serial0,115200 console=tty1 root=PARTUUID=ef31a647-01 rootfstype=ext4 fsck.repair=yes wayland=on rootwait cfg80211.ieee80211_regdom=US </pre> * Create the magicmirror user: <pre> sudo adduser --uid 1001 -ingroup users --shell /bin/bash --comment "magicmirror" mm </pre> * Create a wayfire service file: xdg-runtime-dir service: <pre> sudo nano /etc/systemd/system/wayfire.service /etc/systemd/system/create-xdg-runtime-dir.service </pre> #* And add the following: <pre> [Unit] Description=Wayfire Wayland Compositor Description=Create XDG_RUNTIME_DIR for magicmirror After=rc-local.service After=local-fs.target [Service] User=root Type=oneshot Type=simple ExecStart=/bin/mkdir -p /run/user/1001 ExecStart=su - mm -c "/usr/bin/wayfire -c /home/mm/.config/wayfire.ini" ExecStart=/bin/chown 1001:1001 /run/user/1001 Restart=on-failure Environment=XDG_RUNTIME_DIR=/var/run/user/1001 ExecStart=/bin/chmod 700 /run/user/1001 [Install] WantedBy=multi-user.target </pre> * Reload systemd and enable the service at boot: xdg-runtime-dir service: <pre> sudo systemctl daemon-reload sudo systemctl enable wayfire xdg-runtime-dir </pre> * Reboot the pi: <pre> sudo reboot </pre> h2. Install MagicMirror * Switch to the magicmirror user: <pre> sudo su - mm </pre> * Add *XDG_RUNTIME_DIR* to @.bashrc@: <pre> echo "export XDG_RUNTIME_DIR=/run/user/1001" >> ~/.bashrc </pre> * Clone the MagicMirror repository: <pre> git clone https://github.com/MagicMirrorOrg/MagicMirror </pre> * Install the applicationy: <pre> cd MagicMirror npm run install-mm </pre> * Create the config file: <pre> cp config/config.js.sample config/config.js </pre> h2. Autostart MagicMirror * Create a launch script: <pre> nano /home/mm/launch-mm.sh </pre> #* And add Start the following: application using wayland: <pre> #!/bin/bash cd /home/mm/MagicMirror npm run start:wayland </pre> * Create a wayfire config nano /home/mm/.config/wayfire.ini #* And add the following: <pre> [core] plugins = autostart [autostart] boot = /home/mm/launch-mm.sh </pre> h2. Resources * https://docs.magicmirror.builders/getting-started/installation.html * https://github.com/sdetweil/MagicMirror_scripts/blob/master/raspberry.sh * https://gitlab.com/khassel/magicmirror/-/raw/master/build/Dockerfile-debian?ref_type=heads * https://gist.github.com/seffs/2395ca640d6d8d8228a19a9995418211 * https://www.raspberrypi.com/documentation/computers/configuration.html#wayland * https://utdream.org/xdg_runtime_dir-is-invalid-or-not-set-on-raspberry-pi-5/ * https://forums.raspberrypi.com/viewtopic.php?t=376273