An out of the box Raspberry Pi Raspbian distro that lets you run MagicMirror² to make an interactive mirror.
- 2A power supply
- Pi 3, 4 & 5. The Raspberry Pi 0/1/2 is currently not supported, the Pi Zero2w might be working.
Variants for 32-bit (armhf in image name) and 64-bit (arm64 in image name) are available.
The new Raspberry Pi Imager v2 does not allow customizations (User/Password/SSH/WiFi/...) when loading an image file from disk. As alternative we provide an own content repository:
-
Start the Pi Imager, select the "App Options" Button
-
Press the "Edit" Button beside "Content Repository"
-
Select "Use custom URL" and add
https://khassel.gitlab.io/magicmirroros/imager.json, then press "Apply & Restart"
You can also start Pi Imager from the command line with
rpi-imager --repo https://khassel.gitlab.io/magicmirroros/imager.jsonso you can skip the above steps.
-
After choosing your Device (Raspberry Pi Model) you have to select between
64-bitand32-bitOS -
Select the image (recommended is the newest at the top)
-
Follow the next steps (Storage/Customization) and finally write the selected image to your SD-Card
Download the image file from here and use the file with your Image Writer.
- With the first start the docker images are pulled which takes some time, you can follow this process by executing
journalctl --user -f - You find the custom files (config/css/modules) of MagicMirror² in the directories under
/opt/mm/mounts/
Under the hood MagicMirrorOS uses this docker setup.
You find the docker setup at /opt/mm/ on your Raspberry Pi. For more information about this setup, how you can start/stop the docker container, how to see the logs , ..., please refer to the Documentation of this project.
-
Option 1
- Edit the file
/opt/mm/run/.envand add e.g. the following lineRANDR_PARAMS="--output HDMI-A-1 --transform 180"to rotate the output by 180 degrees, orRANDR_PARAMS="--output HDMI-A-1 --transform 90"to rotate the output by 90 degrees, to see all possible options login to the container withdocker exec -it labwc bashand then you can look at all the options available withwlr-randr --help. To get the parameter for--outputyou can callwlr-randr, you find the parameter in the first line (in this exampleHDMI-A-1). - Restart the docker container by executing
docker compose upin directory/opt/mm/run.
If you need to change the delay for the wlr-randr options to be applied, e.g. if the display is rotated when MagicMirror² is starting, it can result in a black screen. To avoid this, increase the delay (on slow systems e.g. pi < v4 you have to increase this up to 80s).
- Edit the file
/opt/mm/run/.envand add e.g. the following lineRANDR_DELAY=10sto apply the wlr-randr options after 10 seconds, the default value is 5s. - Restart the docker container by executing
docker compose upin directory/opt/mm/run.
- Edit the file
-
Option 2
You can use css for rotating. Edit the file
/opt/mm/mounts/css/custom.cssand add the lines provided in this forum post.
The setup tries to set the timezone automatically, if you need to change your local timezone:
-
Find your timezone in the "TZ database name" column on Wikipedia
-
nano /opt/mm/run/compose.yamland add:environment: TZ: <your timezone> -
Restart the docker container by executing
docker compose upin directory/opt/mm/run.
- Docker or Vagrant, docker recommended
- Docker Compose Plugin - recommended if using docker build method, instructions assume you have it
- Downloaded Raspbian Lite image.
- Root privileges for chroot
- Bash
- sudo (the script itself calls it, running as root without sudo won't work)
MagicMirrorOS can be built using docker running either on an intel or RaspberryPi (supported ones listed). Build requires about 4.5 GB of free space available.
MagicMirrorOS supports building variants, this setup contains 2 variants for the 2 architectures, armhf and arm64.
You can build it assuming you already have docker and the docker compose plugin installed issuing the following commands:
variant="armhf"
git clone https://github.com/guysoft/MagicMirrorOS.git
cd MagicMirrorOS/src/image
wget -c --trust-server-names 'https://downloads.raspberrypi.org/raspios_${variant}_latest'
cd ..
sudo docker compose up -d
sudo docker exec -it magicmirroros-build build $variantThere is a vagrant machine configuration to let build MagicMirrorOS in case your build environment behaves differently. Unless you do extra configuration, vagrant must run as root to have nfs folder sync working.
To use it:
sudo apt-get install vagrant nfs-kernel-server
sudo vagrant plugin install vagrant-nfs_guest
sudo modprobe nfs
cd MagicMirrorOS/src/vagrant
sudo vagrant upAfter provisioning the machine, its also possible to run a nightly build which updates from devel using:
cd MagicMirrorOS/src/vagrant
run_vagrant_build.sh [Variant]- If needed, override existing config settings by creating a new file
src/config.local. You can override all settings found insrc/config. If you need to override the path to the Raspbian image to use for building MagicMirrorOS, override the path to be used inZIP_IMG. By default, the most recent file matching*-raspbian.zipfound insrc/imagewill be used. - Run
src/build_distas root. - The final image will be created in
src/workspace
Code contribution would be appreciated!