sudo apt update
sudo apt install python3-venv python3-pip libsdl2-2.0-0 libsdl2-image-2.0-0 \
libsdl2-ttf-2.0-0 libfreetype6
# only if you feed the dash over MQTT
sudo apt install mosquitto mosquitto-clientsgit clone <your-fork> ~/DIGIFIZ
cd ~/DIGIFIZ
python3 -m venv .venv
.venv/bin/pip install -U pip -r requirements.txtIf you will read an Arduino over USB serial, add your user to the serial group and log out and back in:
sudo usermod -aG dialout $USERThe dash takes the panel's own mode and scales the artwork to fit, letterboxing
if the aspect ratio differs. Set the mode in /boot/firmware/config.txt; for a
typical 5 inch 800x480 HDMI panel:
hdmi_group=2
hdmi_mode=87
hdmi_cvt=800 480 60 6 0 0 0
hdmi_drive=2
disable_overscan=1Check what the dash decided with:
.venv/bin/python -m digifiz.app --source demo --debugThe overlay reports the display size, the scale factor and the letterbox offset.
SDL_VIDEODRIVER=kmsdrm draws directly through DRM/KMS, so the Pi can boot to
a console with no X11, no Wayland and no compositor. Boot to console with
sudo raspi-config → System Options → Boot / Auto Login → Console.
Wire a momentary button between a GPIO pin and ground; the internal pull-up means no resistor is needed. Then:
.venv/bin/pip install gpiozero lgpio
.venv/bin/python -m digifiz.app --mfa-button-pin 17Or set DIGIFIZ_MFA_BUTTON_PIN=17 in the service file. Pin numbers are BCM.
Each press steps one mode along; the button is debounced in software, so a
plain switch is fine.
If the button is wired to the Arduino instead, send mfabtn=1 and mfabtn=0
in the serial line, or publish to cabin/mfa_next/state over MQTT. All three
follow the same mode order.
sudo cp deploy/digifiz.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now digifiz
journalctl -u digifiz -fEdit the unit's Environment= lines to choose the data source
(DIGIFIZ_SOURCE=mqtt|serial|demo|obd) and the broker or serial port.
All artwork is decoded and pre-scaled once at startup. At 800x480 that is a few tens of MB; at the full 1920x720 the process settles around 160 MB resident, which is comfortable on a 2 GB or larger Pi.
A cluster gets its power cut rather than shut down. The odometer is written
atomically (temporary file plus rename) and at most once every 30 seconds, so a
cut cannot truncate it. If you want to go further, mount the root filesystem
read-only and keep odo.txt on a small writable partition.