/pi-audio-streamer-setup

A Cal Poly Computer Engineering Senior Project to develop a program that assists in a user configuring a Raspberry Pi as a digital audio streaming device.

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

pi-audio-streamer-setup

A Cal Poly Computer Engineering Senior Project to develop a program that assists in a user configuring a Raspberry Pi as a digital audio streaming device.

Credits to dtcooper for creating Raspotify, which is what we use as the backbone to connect to Spotify. If you want to be able to set that up on your own, see here: https://github.com/dtcooper/raspotify

Required Items

  • Python 3.9+
  • MicroSD Card (8GB or more)
  • Raspberry Pi

We recommend the Raspberry Pi 3A+ as it has a headphone jack and full-size USB/HDMI, so that you don't need any adapters

NOTE: Any Raspberry Pi 1.X or Raspberry Pi Zero models are not supported due to limitations with Raspotify

Configuration Instructions

Flashing the SD Card

First you should download the Raspberry Pi Imager, from the official Raspberry Pi Foundation website raspberrypi.com/software, then click on the version for the correct OS you want to download (This guide was written using MacOS).

image

After installing and launching the imager for the first time, it should look like this.

image

Click on "Choose OS", where you will then select "Raspberry Pi OS (other)" then "Raspberry Pi OS Lite (32-bit)"

image

image

Next, click on the gear in the bottom right of the GUI, where we will pre-configure some settings for the Raspberry Pi, which we will use in our script, as well as to setup connection to streaming services.

Enable the following settings: NOTE: We are going to use the Raspberry Pi username/password later, so be sure to remember or write it down. You should choose something unique.

image

image

Insert your MicroSD card into your computer (using a MicroSD card slot or MicroSD card reader)

Next, click on "Choose Storage" and select your MicroSD card from the list

  • It's likely that it's the first item in the list

image

Next, select the "Write" option, this should finish the setup of the Raspberry Pi OS. On MacOS you may be prompted to enter your password to give the application permission to write to the MicroSD card.

image

Using our program

Once we have the OS set up, we can now move onto using the program to set up Raspotify Initially, you will be greeted with this page in the program.

image

This page includes much of the same information that we just discussed, click "Next"

image

Remove the SD card from your computer, then plug it in to the Raspberry Pi and turn it on.

This page requires you to put in the same username and password that we saved away earlier as the profile for the pi. We are going to use this information to connect to the pi.

You probably will not need to change the raspberrypi.local, however if you are having problems connecting to the Pi, then you can use the IP address of the Raspberry Pi. (can be found in the devices list of your WiFi network page).

Click refresh, then click next when available. If the next button does not work, keep refreshing until it does (the Pi may take some time to turn on). If it does not work after a considerable amount of tries, then try to find the IP address of the Pi (if you do not know how, there are articles that explain how to do so).

image

image

This next screen is where some customization can be done, you can set both the device name and also the icon that will display in Spotify.

Click Next when you are satisfied with your options. At this point, the Raspberry Pi will be configured. This process can take multiple minutes, and it may appear as if the program has frozen. Be assured it is still working.

image

This next page will have a singular drop down, indicating which audio device on your Pi the program will configure itself to. There will be a default option, which you can test by trying to cast to the device via Spotify, but if that audio device isn't playing sound, or it it's quiet, then choose a new audio device and click "Apply". If your device does not appear on the list, attempt to reconnect it and click "Refresh"

NOTE: This is what the device will look like in the casting section of the spotify web application (can be different for mobile). image