尚未收集儲存庫資訊。
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗spotifactory.com · website source in site/ (see docs/website.md)
A Raspberry Pi music box that plays albums from instant photos. Print an album's cover on an Instax Square printer, stick an NFC tag on the back, and from then on standing that photo on Spotifactory plays the album; lifting it off pauses.
spotifactory.startup) as a systemd service.spotify:album: / spotify:playlist: URI and starts playback through
the Spotify Web API.deploy/portal/) for WiFi, then a QR code that logs in to Spotify through a small Cloudflare
Worker relay (deploy/relay/, PKCE — no client secret on the device).| Screen | Up | Down | Left / Right | Press |
|---|---|---|---|---|
| Home (now playing) | repeat: off → album → track | shuffle on/off | tap: previous / next track; hold: scrub through the track | display: now playing → time → album |
| Menus | move | move | back / select | select |
| Running tasks | — | — | Left cancels where possible | — |
The three buttons beside the screen, top to bottom: volume up, volume down (both repeat when held), and menu, which opens the menu from home and goes straight back to home from anywhere in it (over a prompt it's Back). There's no pause button: lift the album off to pause, put it back to carry on.
Menus return to the home screen after a minute idle (tags only work there), and the screen sleeps after ten minutes with nothing playing.
Once, on your computer: copy deploy/provision.env.example to
deploy/provision.env (git-ignored) and fill in your Spotify client ID. Setup
merges it into each box's .env, so nothing needs editing on the Pi.
spotifactory, user
spotifactory, SSH and WiFi set in Imager.scp deploy/provision.env [email protected]:~/spotifactory-provision.env
sudo apt-get update && sudo apt-get install -y git
git clone https://github.com/peasus/spotifactory.git ~/spotifactory
cd ~/spotifactory && bash deploy/setup.sh
Logs: journalctl -u spotifactory -f.
Boxes update themselves from the stable branch: each night around 3:30
(skipped while someone's using it), or from the menu with Check for
Updates. To release, try it on your own box first, then:
git push origin main:stable
Each update pulls the code, reinstalls Python packages if pyproject.toml
changed, runs deploy/upgrade.sh (service files and the sudo rule, so those
reach boxes in the field too), and restarts the app. If the app doesn't come
back within two minutes it rolls back, and won't try that release again. To
update one now over SSH: sudo systemctl start spotifactory-update; to see what
happened: journalctl -u spotifactory-update -n 30.
Your development box can follow main (SPOTIFACTORY_UPDATE_BRANCH=main in
.env) or skip the nightly run (SPOTIFACTORY_AUTO_UPDATE=0). Note that a box
that has updated is on a detached checkout, not a branch: update it with the
updater rather than git pull.
A Pi set up before the updater existed needs the system part installed once
(asks for your password): cd ~/spotifactory && git pull && sudo bash deploy/upgrade.sh
python3 -m venv .venv && .venv/bin/pip install -e ".[dev]"
.venv/bin/python -m pytest -q # tests
.venv/bin/spotifactory --sim # Tk simulator (arrow keys, Enter, T = fake tag)
On a Mac, put SPOTIPY_CLIENT_SECRET and SPOTIPY_REDIRECT_URI in .env to
log in through the browser instead of the relay.
enclosure/ holds a parametric build123d model of the case: a body, a
faceplate, a base plate, spacers and two reader keepers, all designed to print
without supports. There are also models for a print crate (crate.py) and a
tag-sticker dispenser (dispenser.py), and small fit-test prints
(keeper_test.py, crate_test.py). vinyl_stencil.py makes a dummy print with a window
where the photo's picture is: a guide for cutting a vinyl square and for
sticking it on the panel behind the photo.
python3 -m venv enclosure/.venv && enclosure/.venv/bin/pip install build123d trimesh matplotlib networkx
enclosure/.venv/bin/python enclosure/easel.py # renders + STL/STEP into enclosure/out/
enclosure/.venv/bin/python enclosure/check.py # fit, assembly and printability checks
Printed in PLA on a Bambu P1S (0.4 mm nozzle) with Bambu Studio's Generic PLA filament profile, at 0.12 mm layers. The STLs come out already oriented for the bed. Settings that matter:
Parts to buy are in enclosure/BOM.md, with DigiKey and Mouser part numbers
and what neither distributor carries. enclosure/bom_digikey.csv and
enclosure/bom_mouser.csv import straight into either cart. The screws:
The reader's cable (USB-C at the reader, micro-USB at the Pi) can be a regular straight cable: a USB-C plug up to 12.5 mm wide and 6.5 mm thick (plug and strain relief up to 28 mm long), and any straight micro-USB plug at the Pi.
Before assembly, set the screen HAT to I2C: both switches on its back (SW1, SW2) to 0. The app talks to the screen over I2C only (at 400 kHz, which setup configures).
Assembly order, with the body upside down or on its back:
A square of black self-adhesive vinyl on the panel, exactly where the photo's
picture sits. enclosure/vinyl_stencil.py writes out/print/vinyl_stencil.stl:
a dummy Instax Square print (72 × 86 × 1.6 mm) with a 62 × 62 window where
the picture is, and BOTTOM engraved below it. It stands in the groove like a
real print. Print it flat; it needs no supports.
The top few mm of the square wrap over the panel's rounded top edge; press
that edge down firmly. The stencil assumes the picture starts 6 mm below the
print's top edge (TOP_BORDER); if yours differs, change it and re-run.
| Path | What |
|---|---|
src/spotifactory/runner.py | Platform-independent UI loop: input, tasks, rendering |
src/spotifactory/tasks/ | Home screen, printing, speakers, Bluetooth pairing, Spotify login |
src/spotifactory/hardware/ | NFC reader, Instax printer, Bluetooth, Sonos |
src/spotifactory/platforms/ | SeenGreat HAT, Adafruit OLED and simulator front ends |
deploy/ | Pi setup script, systemd unit, auth relay Worker |
enclosure/ | Case model, checks and parts list |
connect-helper/ | Rust helper that plays Spotify on Sonos speakers (experimental) |
docs/sonos.md | What does and doesn't work with Sonos speakers |
Spotifactory, the app and the enclosure, is © 2025–2026 Joe Pease, under the PolyForm Noncommercial License 1.0.0: free to use, change and share for personal and other noncommercial purposes. Selling it, or using it commercially, needs permission: ask at [email protected].
src/spotifactory/vendor/instax/ is from
InstaxBLE by Jasper van Loenen, under its
own MIT license.