Skip to content

Latest commit

 

History

History
204 lines (165 loc) · 7.68 KB

INSTALL-COMPLETE-GUIDE.md

File metadata and controls

204 lines (165 loc) · 7.68 KB

How to set up a Phoniebox from scratch

  1. What you need
  2. Install Raspberry Pi OS
  3. Initial Boot
  4. Prepare hardware
  5. Audio
  6. Install Phoniebox software
  7. Verify Phoniebox setup

1. What you need

All parts marked with a star (*) are optional but improve the overall experience. All linked components are examples but have proven to work together. You are free to choose different equipment.

  1. Micro SD Card (e.g. 32 GB)
  2. Raspberry Pi
    • Model 3 B+ - recommended
    • Model 4 B - could be a little overhead
    • (Model 1, 2, 3 and Zero are possible, but they are slower...)
  3. USB RFID Reader
  4. RFID Chips or RFID Cards
  5. Speakers with 3.5mm jack

To improve the sound, we recommend:

Alternatively you can use an external sound card, but sometimes that doesn't seem to improve much:


2. Install Raspberry Pi OS

Before you can install the Phoniebox software, you need to prepare your Raspberry Pi and install

  1. Connect your Micro SD card (through a card reader) to your computer
  2. Download the Raspberry Pi Imager and open it
  3. Select Raspberry Pi OS as the operating system
  4. Select your Micro SD card (your card will be formatted)
  5. Click Write
  6. Wait for the imaging process to be finished (it'll take a few minutes)

3. Initial Boot

You will need a terminal, like PuTTY for Windows or the Terminal for Mac to proceed with the next steps.

  1. Open a terminal of your choice
  2. Insert your card again if it has been ejected automatically
  3. Navigate to your SC card e.g., cd /Volumes/boot for Mac or D: for Windows
  4. Enable SSH by adding a simple file
    $ touch ssh
    
  5. Set up your Wifi connection
    • Mac
      $ nano wpa_supplicant.conf
      
    • Windows
      D:\> notepad wpa_supplicant.conf
      
  6. Insert the following content, update your country, Wifi credentials and save the file.
    country=DE
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    
    network={
        ssid="network-name"
        psk="network-password"
    }
    
  7. Eject your SD card and insert it into your Raspberry Pi
  8. Start your Raspberry Pi by attaching a power supply
  9. Login into your Raspberry Pi, username is pi and password is raspberry. If raspberrypi.local does not work, find out your Raspberry Pi's IP address from your router.
    $ ssh pi@raspberrypi.local
    
  10. Update the Pi's software. This may take a bit
    $ sudo apt update && sudo apt full-upgrade
    
  11. Reboot with sudo reboot
  12. Login again with SSH and open the Raspberry Pi config
    $ sudo raspi-config
    
  13. Update the following settings
    1 System Options
        S5 Boot / Auto Login -> B2 Console Autologin
        S6 Network at Boot -> Yes
    
  14. Close the settings panel with <Finish>
  15. Shutdown your Raspberry Pi with sudo shutdown

4. Prepare hardware

  1. Connect the RFID Reader
  2. Conntect USB Sound Card if available
  3. Plug in the 3.5" speakers with the Ground Loop Isolator in between. If you have chosen the example speakers from above, you can power them either through the Raspberry Pi or through an external power source.
  4. Boot your Raspberry Pi
  5. Open a terminal in your second computer and login via SSH using the pi user and default password raspberry. If you see a question about authentication and fingerprint, type yes and hit enter
    ssh pi@raspberrypi.local
    

5. Audio

5a. On-board headphone

Installing with an external monitor (HDMI) can create a problem if you use the mini-jack audio out. The problem is that if you plug in a HDMI monitor an additional sound output is added and the index changes. This bothering behavior was introduced, when Raspberry Pi separated headphones jack and HDMI into two different devices in May 2020. Also see Troubleshooting: headphone audio unavailable after unplugging HDMI

5b. USB sound card

  1. Open the Raspberry Pi config

    $ sudo raspi-config
    
  2. Update the following settings

    1 System Options
        S2 Audio -> 1 USB Audio
    
  3. Close the settings panel with <Finish>

  4. Make your soundcard the primary sound device. To update the sound card priority order, edit the following file:

    $ sudo nano /usr/share/alsa/alsa.conf
    
  5. Find the following variables and change their value from 0 to 1

    defaults.ctl.card 0
    defaults.pcm.card 0
    
    // to
    
    defaults.ctl.card 1
    defaults.pcm.card 1
    
  6. Reboot

  7. Test your audio! Check if you hear white noise in stereo when running the following command from your connected speakers. If not, refer to this resource to troubleshoot.

    speaker-test -c2
    

6. Install Phoniebox software

If you want to install the Spotify+ version, read this first.

Run the following command in your SSH terminal and follow the instructions

cd; rm buster-install-*; wget https://raw.githubusercontent.com/MiczFlor/RPi-Jukebox-RFID/master/scripts/installscripts/buster-install-default.sh; chmod +x buster-install-default.sh; ./buster-install-default.sh
  1. Yes to Continue interactive installation
  2. No to the Wifi Setting step - it's already set!
  3. Speaker to CONFIGURE AUDIO INTERFACE (iFace)
  4. Setup Spotify (optional)
    1. You need to generate your personal Spotify client ID and secret
    2. Visit the Mopidy Spotify Authentication Page
    3. Click the button Authenticate Mopidy with Spotify
    4. Login to Spotify with your credentials
    5. Once logged in, the code snippet on the website is updated with your client_id and client_secret
    6. Provide your Spotify username, password and paste your client_id and client_secret into your terminal
  5. Yes to CONFIGURE MPD
  6. Yes to FOLDER CONTAINING AUDIO FILES
  7. Optional: In this scenario, we do not install GPIO buttons, so feel free to choose No
  8. Yes to Do you want to start the installation?
  9. ... Wait a bit for the installation to happen ...
  10. Yes to Have you connected your RFID reader?
  11. 1 to select 1. USB-Reader
  12. Choose the # that resonates with your RFID reader, in our case HXGCoLtd Keyboard
  13. Yes to Would you like to reboot now?

7. Verify Phoniebox setup

  1. Open a browser in your computer and navigate to your Raspberry Pi: http://raspberrypi.local
  2. You should see the Phoniebox UI
  3. In your navigation, choose Card ID
  4. Swipe one card near your RFID reader. If Last used Chip ID is automatically updated (you might hear a beep) and shows a number, your reader works
  5. Verify Spotify (optional)
    1. Click Spotify+ in the menu
    2. Mopidy opens, a second web player which was also installed
    3. You should be able to search and play Spotify content here