Skip to content

INSTALL

AlvinSchiller edited this page Nov 8, 2023 · 28 revisions

Installing Phoniebox

⚠️ Attention: The Phoniebox software V2.x works with the Raspberry Pi OS Buster or Bullseye. Bullseye automatically ships with the Raspberry Pi Imager 1.6.2. This newer version sometimes still causes issues for users. If you still want to use Buster it can be downloaded from their website. To use Buster with RPi Imager, choose the option Use custom and install it the normal way.

Once you finished the installation, read the manual to add audio files and RFID cards.

This project has been tested on Raspberry Pi model 1, 2, 3, 4, and Zero.

One line install command

There is a one line script. Copy and paste it into your Pi terminal - if you have your

This script gets your Phoniebox up and running and automatically configures all necessary parts.

Raspberry Pi OS (previously Raspbian) Buster/Bullseye

A. Default install script (recommended)

⚠️ Spotify has disabled access to libspotify on May 16, 2022. This means currently Phoniebox and many other services can not communicate with Spotify via libspotify (and mopidy-spotify) anymore. The problem is not our code but the cut off by Spotify. For more information, read the Spotify-FAQ.

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

Having said this, you might learn a bit more about your Raspberry Pi to walk through the installation process step by step, like this:

The one line install command contains five separate commands linked up by replacing the end of line with ;. The commands do the following:

  • cd - move to the home directory
  • rm buster-install-* - remove previously downloaded versions of the install script
  • wget https://raw.githubusercont... - download the actual install script from github
  • chmod +x buster-install-default.sh - make the script executable
  • ./buster-install-default.sh - run the script

B. Developer install script

For latest updates, try the version in the develop branch. Attention: it’s likely that things on develop are broken or have to be changed by yourself.

cd; rm buster-install-*; wget https://raw.githubusercontent.com/MiczFlor/RPi-Jukebox-RFID/develop/scripts/installscripts/buster-install-default.sh; chmod +x buster-install-default.sh; GIT_BRANCH=develop bash ./buster-install-default.sh

Install Raspberry Pi OS (previously Raspbian) on your RPi

There are a number of operating systems to chose from on the official RPi download page on www.raspberrypi.org. We want to work with the official distribution Raspberry Pi OS (previously Raspbian).

Install and configure via SSH: if you need to install and configure the Phoniebox via SSH, you might want to jump to the headless installation towards the end of this document.

Currently we recommend to use the latest Buster image.

After you downloaded the zip file, follow the instructions on the official INSTALLING OPERATING SYSTEM IMAGES page. I have used etcher to make the SD card as described.

Plug the SD into your Pi, connect keyboard, monitor and mouse. And fire it up.

Configure your keyboard

In the dropdown menu at the top of the home screen, select:

'Berry' > Preferences > Mouse and Keyboard Settings

Now select the tab Keyboard and then click Keyboard Layout... at the bottom right of the window. From the list, select your language layout.

Configure the WiFi

At the top right of the home screen, in the top bar, you find an icon for Wireless & Wired Network Settings. Clicking on this icon will bring up a list of available WiFi networks. Select the one you want to connect with and set the password.

Note: Follow this link if you have trouble with a USB Wifi card.

Important: Check the country code of your WiFi.

Disable WiFi power management

Make sure the WiFi power management is disabled to avoid dropouts. Firstly, check if it is switched on, type in the terminal:

iwconfig

This should return something like the following:

lo        no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11  ESSID:
          Mode:Managed  Frequency:2.437 GHz  Access Point: 34:31:C4:0A:8F:83   
          Bit Rate=72.2 Mb/s   Tx-Power=31 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=63/70  Signal level=-47 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:2  Invalid misc:0   Missed beacon:0

The line Power Management:on is important: out of the box, it seems to be switched on, so let's switch it off, type:

sudo iwconfig wlan0 power off

And then check again with iwconfig that the line now says: Power Management:off.

Access over SSH

SSH will allow you to log into the RPi from any machine in the network. This is useful because once the Phoniebox is up and running, it won't have a keyboard, mouse or monitor attached to it. Via SSH you can still configure the system and make changes - if you must.

Open a terminal to star the RPi configuration tool.

sudo raspi-config

Select Interface Options and then SSH Enable/Disable remote command line... to enable the remote access.

You should also change your password at this stage in raspi-config. The default password after a fresh install is raspberry.

Find out more about how to connect over SSH from Windows, Mac, Linux or Android on the official RPi page.

Autologin after boot

When you start the Phoniebox, it needs to fire up without stalling at the login screen. This can also be configured using the RPi config tool.

Open a terminal to star the RPi configuration tool.

$ sudo raspi-config

Select Boot options and then Desktop / CLI. The option you want to pick is Console Autologin - Text console, automatically logged in as 'pi' user.

Set a static IP address for your RPi

To be able to log into your RPi over SSH from any machine in the network, you need to give your machine a static IP address.

Check if the DHCP client daemon (DHCPCD) is active.

sudo service dhcpcd status

If you don't get any status, you should start the dhcpcd daemon:

sudo service dhcpcd start
sudo systemctl enable dhcpcd

Check the IP address the RPi is running on at the moment:

$ ifconfig

wlan0     Link encap:Ethernet  HWaddr 74:da:38:28:72:72  
          inet addr:192.168.178.82  Bcast:192.168.178.255  Mask:255.255.255.0
          ...

You can see that the IP address is 192.168.178.82. We want to assign a static address 192.168.178.199.

Note: assigning a static address can create conflict with other devices on the same network which might get the same address assigned. Therefore, if you can, check your router configuration and see if you can assign a range of IP addresses for static use.

Change the IPv4 configuration inside the file /etc/dhcpcd.conf.

sudo nano /etc/dhcpcd.conf

Don't be surprised, if the file is empty. Then only add the lines below. In my case, I added the following lines to assign the static IP. You need to adjust this to your network needs:

interface wlan0
static ip_address=192.168.178.201/24
static routers=192.168.178.1
static domain_name_servers=192.168.178.1

Save the changes with Ctrl & O then Enter then Ctrl & X.

APPENDIX

Installation and configuration via SSH / headless installation

Setting up the Phoniebox via a SSH connection saves the need for a monitor and a mouse. The following worked on Raspberry Pi OS (previously Raspbian) Stretch and Buster.

  • Download the Raspberry Pi OS Lite image from here
  • Flash your SD card with the Raspberry Pi OS image following this guide
  • Eject the card and insert it again. This should get the boot partition mounted.
  • In the boot partition, create a new empty file called ssh (no file extension). This will enable the SSH server later.
  • Create another file in the same place called wpa_supplicant.conf. Set the file content according to the following example:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=DE
network={
    ssid="YOUR_NETWORK_NAME"
    psk="YOUR_PASSWORD"
    key_mgmt=WPA-PSK
}

Replace DE with your 2-letter ISO code for your country The mentioned ISO code is DE for Germany, US for USA... Complete list can be found here.

Note: This works for WPA-secured wifi networks, which should be the vast majority.

  • Save the file
  • Unmount and eject the card, insert it into the Raspy, boot.
  • Find out the IP address of the raspberry. Most Wifi routers have a user interface that lists all devices in the network with the IP address they got assigned.
  • Connect via ssh with username pi and password raspberry.
  • Jump back to the top of this document to walk through the other steps of the installation.

Sources

Home

πŸ”₯ Version 3

Version 3 Pages

Nothing yet

🎢 Version 2

Version 2 Pages

Installation

Specials

RFID Reader

Sound card configurations

Hardware Buttons

Displays (LED, LCD, Matrix, etc.)

Hacks

Bluetooth

AirPlay

MPD tricks

For Developers

Clone this wiki locally