{"id":47686308,"url":"https://github.com/markwmccall/vinyl-tap","last_synced_at":"2026-04-02T14:51:34.935Z","repository":{"id":340708441,"uuid":"1167249067","full_name":"markwmccall/vinyl-tap","owner":"markwmccall","description":"NFC card tap → Apple Music album plays on Sonos. Python/Flask web UI on Raspberry Pi for search, tag write, and verify.","archived":false,"fork":false,"pushed_at":"2026-03-30T21:27:31.000Z","size":565,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-30T23:37:35.376Z","etag":null,"topics":["apple-music","flask","home-automation","nfc","pn532","python","raspberry-pi","sonos"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markwmccall.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-26T05:01:15.000Z","updated_at":"2026-03-30T21:27:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/markwmccall/vinyl-tap","commit_stats":null,"previous_names":["markwmccall/vinyl-emulator","markwmccall/vinyl-tap"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/markwmccall/vinyl-tap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwmccall%2Fvinyl-tap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwmccall%2Fvinyl-tap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwmccall%2Fvinyl-tap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwmccall%2Fvinyl-tap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markwmccall","download_url":"https://codeload.github.com/markwmccall/vinyl-tap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwmccall%2Fvinyl-tap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31308446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple-music","flask","home-automation","nfc","pn532","python","raspberry-pi","sonos"],"created_at":"2026-04-02T14:51:34.402Z","updated_at":"2026-04-02T14:51:34.928Z","avatar_url":"https://github.com/markwmccall.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vinyl Tap\n\n\u003cimg src=\"static/logo.svg\" width=\"80\" alt=\"Vinyl Tap logo\"\u003e\n\n[![Tests](https://github.com/markwmccall/vinyl-tap/actions/workflows/tests.yml/badge.svg)](https://github.com/markwmccall/vinyl-tap/actions/workflows/tests.yml)\n\nTap an NFC card → an album or song plays on your Sonos speaker.\n\nInspired by [Mark Hank's Sonos/Spotify Vinyl Emulator](https://www.hackster.io/mark-hank/sonos-spotify-vinyl-emulator-3be63d), this project adapts the concept for **Apple Music** and adds a full web UI for searching, writing, and verifying tags — no terminal required after initial setup.\n\n---\n\n## How it works\n\nEach physical NFC card stores a reference to an album or song. When a card is tapped on the reader, the Raspberry Pi reads it, looks up the tracks via the iTunes API, and queues them on your Sonos speaker.\n\nA web app running on the Pi lets you:\n- Search Apple Music for albums or songs\n- Write a tag to any NFC card\n- Play directly to Sonos from the browser\n- Verify what's written on any card\n\n---\n\n## Hardware\n\n| Item |\n|------|\n| **Raspberry Pi Zero 2 W** (with headers pre-soldered) |\n| **Waveshare PN532 NFC HAT** |\n| **microSD card** (16 GB+, Class 10) |\n| **Raspberry Pi power supply** (5V/2.5A USB-C) |\n| **NTAG213 NFC cards or stickers** (25–50 pack) |\n\n\u003e **Tip:** The Pi Zero 2 W often ships without a GPIO header. Order the version with headers pre-soldered, or budget time to solder a 2×20 pin header yourself.\n\n---\n\n## Setup\n\n### 1. Flash the SD card\n\nDownload [Raspberry Pi Imager](https://www.raspberrypi.com/software/). Select **Raspberry Pi OS Lite (64-bit)**. Before writing, open the settings and configure:\n\n- Hostname: anything you like (e.g. `vinyltap`) — this becomes `hostname.local` on your network\n- Enable SSH\n- Set a username and password\n- Configure your WiFi network\n\n### 2. Assemble the hardware\n\nAttach the PN532 NFC HAT to the Pi's 40-pin GPIO header. Before powering on, configure the HAT DIP switches for SPI mode as described in the [Waveshare PN532 HAT wiki](https://www.waveshare.com/wiki/PN532_NFC_HAT):\n\n1. **Set the mode jumper caps** — I0 to L, I1 to H.\n2. **Connect RSTPDN to D20** using a jumper cap.\n3. **Set the DIP switches** as follows:\n\n   | SCK | MISO | MOSI | NSS | SCL | SDA | RX | TX |\n   |-----|------|------|-----|-----|-----|----|----|\n   | ON  | ON   | ON   | ON  | OFF | OFF | OFF| OFF|\n\n4. **Leave INT0 unconnected.**\n\n\u003e **Note:** The Waveshare HAT routes NSS (chip select) to GPIO4 (D4), not the standard CE0 (GPIO8). This is handled automatically by the software.\n\nInsert the SD card and power on. Wait about 60 seconds, then SSH in:\n\n```bash\nssh your-username@your-hostname.local\n```\n\n### 3. Verify the HAT is detected\n\n```bash\nls /dev/spidev*\n```\n\nYou should see `/dev/spidev0.0`. If nothing appears, check that the HAT is firmly seated and the DIP switches are set to SPI mode.\n\n### 4. Install\n\n```bash\ncurl -sSL https://raw.githubusercontent.com/markwmccall/vinyl-tap/main/scripts/install.sh | bash\n```\n\nThis downloads the latest release and runs setup — installs dependencies, enables SPI, generates an SSL certificate, creates the config, and installs the `vinyltap` systemd service. It will prompt you to reboot at the end.\n\n\u003e **Note for Pi Zero 2 W users:** The first run compiles `lxml` from source, which can take 10–20 minutes. This is a one-time cost.\n\n### 5. Configure\n\nAfter rebooting, open `https://your-hostname.local` in your browser. Your browser will show a security warning for the self-signed certificate — click through to accept it (this is expected for a local device). Go to **Settings**, use the **Discover** button to find your Sonos speaker IP, and the **Detect** button to find your `sn` value automatically.\n\n\u003e **Sonos AppLink redirect URI:** When linking music services via Settings → Music Services, use `https://your-hostname.local/sonos/callback` as the redirect URI.\n\n---\n\n## Updating\n\nOpen `http://your-hostname.local` in your browser, go to **Settings → Update**, and click **Update Now**. The app will download and install the latest release and restart itself.\n\n---\n\n## Troubleshooting\n\n**`http://your-hostname.local` doesn't load**\n- Check the service is running: `sudo systemctl status vinyltap`\n- Check the Pi is on the network: `ping your-hostname.local`\n- Try the IP address directly if mDNS isn't resolving\n\n**HAT not detected**\n- Confirm the DIP switches on the HAT are set to SPI mode (I0=L, I1=H) — see the [Waveshare PN532 HAT wiki](https://www.waveshare.com/wiki/PN532_NFC_HAT)\n- Check the HAT is firmly seated — all 40 pins engaged\n- Verify with `ls /dev/spidev*` — you should see `/dev/spidev0.0`\n- If `/dev/spidev0.0` is missing, SPI may not be enabled — re-run `scripts/setup.sh` or run `sudo raspi-config` and enable SPI under Interface Options\n\n**Music doesn't play after tapping a card**\n- Check `sudo systemctl status vinyltap` for errors\n- Confirm `speaker_ip` and `sn` are set correctly in Settings\n- Try Play Now from the web UI to rule out a Sonos configuration issue\n\n**`sn` detection finds nothing**\n- You need at least one Apple Music item saved as a Sonos favorite\n- Try small values manually: `3` or `5` are common\n\n**Speaker IP keeps changing**\n- Handled automatically — the system stores the speaker's room name and rediscovers it if the IP changes\n\n---\n\n## Configuration\n\nSettings are managed through the web UI at `http://your-hostname.local/settings`. The underlying `config.json` file contains:\n\n| Key | Description |\n|-----|-------------|\n| `speaker_ip` | IP address of your Sonos speaker. Use the **Discover** button to find it. |\n| `sn` | Apple Music service number assigned by Sonos. Use the **Detect** button to find it automatically (requires at least one Apple Music favorite saved in the Sonos app). If detection finds nothing, try `3` or `5`. |\n\n---\n\n## Web UI\n\n| Page | Description |\n|------|-------------|\n| Search | Search albums or songs by name |\n| Album / Song | Track listing, Play Now, Write to Tag |\n| Verify Tag | Read a card and show what album/song it points to |\n| Collection | Browse, sort, and delete written tags |\n| Settings | Speaker IP, account number, updates |\n\n---\n\n## iPhone shortcut\n\nWrite `http://your-hostname.local` as a URL record on a spare NTAG213 sticker and stick it on the Pi enclosure. Tapping it with an iPhone opens Safari directly to the web UI — no app needed.\n\n---\n\n## Contributing\n\nSee [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md).\n\n---\n\n## Acknowledgements\n\nConcept adapted from [Sonos / Spotify Vinyl Emulator](https://www.hackster.io/mark-hank/sonos-spotify-vinyl-emulator-3be63d) by Mark Hank.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkwmccall%2Fvinyl-tap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkwmccall%2Fvinyl-tap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkwmccall%2Fvinyl-tap/lists"}