Close
0%
0%

NFC Music Box

Touch and see your curated music (again).

Similar projects worth following
Using NFC music tags to drive a networked music playing device. There are a few examples of these, notably inspired by https://brendandawes.com/projects/plasticplayer2. This started with a simple Automate process on an Android tablet for my toddler and escalated with attempt to fix a random person's home made version of the Brendan's Plastic Player. Down the rabbit hole I went!

Stops along the way:
* Android Intents
* Automate app
* NXP Tagwriter app
* Investigating Espruino(espruino.com)
* Depreciated Spotify API
* Spotify API
* Librespot Spotify Connect
* (Unofficial) TIDAL APIs
* International Standard Recording Code
* Music Player Daemon
* HifiBerry DAC
* NFC Type 2 Tag Operation Specification
* NFC NDEF messages
* Reversal film (via 35mm Movie film)
* Vintage slide transparency viewers
* NeoPixels
* PN532 modules
* SSD1306 OLED screen
* Building with ESP32-WROOM-32 module
* Micropython (vs Circuitpython)
* Heap memory troubleshooting
* OTA updates
* PCB design with KiCAD

  • Shipped!

    Adam Chasen10/25/2022 at 14:33 0 comments

    These logs are not in order as I am kinda starting from the end and moving backwards.

    I am shipping my first unit out to NY this week. It supports (insecure) OTA firmware and code updates, so it shouldn't require a serial connection to consume updates.

    It isn't pretty and the code is a bit slapped together but it works and is robust enough to send out

View project log

  • 1
    Setup Raspberry Pi Spotify Connect Device
    1. Install raspberrypi os https://www.raspberrypi.com/software/
    2. install raspotify https://dtcooper.github.io/raspotify/
    3. configure raspotify for username/password auth (/etc/raspotify/conf)
    4. configure raspotify for playback settings
    5. (optional) configure DAC
    6. restart raspotify

    Hints:

    xz -d < 2022-09-06-raspios-bullseye-armhf-lite.img.xz | sudo dd of=/dev/sdg bs=4M conv=fsync status=progress
    touch /run/mediaXXX/boot/ssh
    openssl passwd -6
    vi /run/media/xxx/boot/userconf.txt

    Headless rpi setup: https://www.raspberrypi.com/documentation/computers/configuration.html#setting-up-a-headless-raspberry-pi

    Setup user: https://www.raspberrypi.com/documentation/computers/configuration.html#configuring-a-user

    SSH enable by adding `ssh` file to boot partition: https://www.raspberrypi.com/documentation/computers/remote-access.html#ssh

    sudo apt-get -y install curl && curl -sL https://dtcooper.github.io/raspotify/install.sh | sh
    
    sudo vi /etc/raspotify/conf
    sudo systemctl restart raspotify.service
    #LIBRESPOT_AUTOPLAY=
    #LIBRESPOT_DISABLE_CREDENTIAL_CACHE=
    LIBRESPOT_DISABLE_DISCOVERY=
    LIBRESPOT_BITRATE="320"
    LIBRESPOT_FORMAT="S24"
    LIBRESPOT_USERNAME="<username>"
    LIBRESPOT_PASSWORD="<password>"
     #TMPDIR=/tmp

     HiFiberry DAC already included in upstream Raspberry Pi OS, but needs configuration. Note the kernel 5.14+ instructions.

    https://www.hifiberry.com/docs/software/configuring-linux-3-18-x/

  • 2
    Configure Network

    I assume the Spotify Connect device is functional and visible as a "device" in the Spotify interface (or API).

    This is for NFC reader portion.

    Factory reset if need:

    1. Remove power
    2. Hold down button A (or both if you don't know)
    3. Apply power
    4. Release button A
    5. Press button 0 (boot select button on PCB next to ESP32 module)
    6. Release button 0
    7. Wait 10 seconds
    8. Remove power
    9. Apply power and you are in factory reset state

    Configure Network:

    1. Apply power
    2. Join WifiManager SSID with PSK `tayfunulu`
    3.  Navigate to http://192.168.4.1
    4. Select SSID
    5. Enter WLAN PSK
    6. Submit
  • 3
    Configure Spotify API

    This requires a client which supports mDNS addresses. Most major web browsers and operating systems support mDNS. I have tested with Firefox on Fedora 36.

    1. Navigate to Spotify config address of device indicated on OLED
    2. Enter Spotify API client id: 4efe77ff069f45a79d7cc3279e2ba870
    3. Enter Spotify Secret: 8d52b8bd5e8f48ed96987d07d76adf37
    4. Submit
    5. Wait for device to reboot (~10-20 seconds)
    6. Web browser may timeout
    7. Click "retry" on web browser after 10 seconds
    8. Select Spotify Connect device
    9. Submit

View all 5 instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates