Current standard and tested setup is:
-
Raspberry Pi 4 Model B Raspberry Pi OS Bookworm
-
Official 7" touchscreen
-
HiFiBerry MiniAmp
-
ICY BOX Dual Raspberry Pi GPIO Header
-
Visaton FRS 8M speakers
-
ATX Power On Off Switch with Power LED for ATX mainboards (4 cables)
-
User & group name
raspifm
If not mentioned otherwise, setup instructions refer to this setup.
NO WARRANTIES AT ALL, BUT ESPECIALLY NOT ON ANY HARDWARE SETUP/CONNECTION/MODIFCATION!
Do a sudo apt update
first.
-
- Mount the MiniAmp on the GPIO header and the header to the Raspberry board, so that that unused GPIO Pins still can be used
-
- Make a backup of config.txt file to your current directory:
cp /boot/config.txt ./
- Make a backup of config.txt file to your current directory:
-
- Edit config.txt:
sudo nano /boot/config.txt
- Edit config.txt:
-
- Disable the line
dtparam=audio=on
to# dtparam=audio=on
- Disable the line
-
- Edit the line
dtoverlay=vc4-kms-v3d
todtoverlay=vc4-kms-v3d,noaudio
- Edit the line
-
- Add lines
dtoverlay=hifiberry-dac
andforce_eeprom_read=0
before the first filter section (cm4)
- Add lines
-
- Connect DSI and power cables (to the GPIO header), official documentation on www.raspberrypi.com
-
- I connected 5V to Pin 2/5V and Ground to Pin 14/Ground as I took Pin 6/Ground for the Power Switch (see next section)
-
- Connect Power LED + to Pin 7/GPIO 4, Power LED - to Pin 9/Ground and the Power Switch cables over Pin 5/GPIO 3 and Pin 6/Ground
-
- Edit config.txt:
sudo nano /boot/config.txt
(backup done in MiniAmp setup, if not do it now!)
- Edit config.txt:
-
- Add lines
dtoverlay=gpio-shutdown,gpio_pin=3
andgpio=4=op,dh
before the first filter section (cm4)
- Add lines
-
- Create a new directory for the repository:
mkdir ~/raspifm_repo
and switch to the directory:cd ~/raspifm_repo
.
- Create a new directory for the repository:
-
- Clone the repository:
git clone https://github.com/Drexel2k/raspiFM .
- Clone the repository:
-
- If you do not want to use the latest commit, but the latest release, look up the latest release tag: https://github.com/Drexel2k/raspiFM/releases or https://github.com/Drexel2k/raspiFM/tags and do:
git checkout tags/v1.0
- If you do not want to use the latest commit, but the latest release, look up the latest release tag: https://github.com/Drexel2k/raspiFM/releases or https://github.com/Drexel2k/raspiFM/tags and do:
-
- Copy spotifyd binary to /usr/bin:
sudo cp ~/raspifm_repo/libs/spotifyd-0.3.5-dbus-pulse_aarch64 /usr/bin/spotifyd
- Care! Current spotifyd stable release hase some issues due to Spotify backend changes. Use the latest build instead:
sudo cp ~/raspifm_repo/libs/spotifyd-commit-e280d84124d854af3c2f9509ba496b1c2ba6a1ae-librespot-0.4.2-dbus-pulse_aarch64 /usr/bin/spotifyd
- Copy spotifyd binary to /usr/bin:
-
- Copy the spotifyd config file from configs to /etc:
sudo cp ~/raspifm_repo/configs/spotifyd.conf /etc
- Copy the spotifyd config file from configs to /etc:
-
- Set up daemon: Copy the file from configs to /etc/systemd/system:
sudo cp ~/raspifm_repo/configs/spotifyd.service /etc/systemd/user
- Set up daemon: Copy the file from configs to /etc/systemd/system:
-
- Enable the daemon/autostart:
systemctl --user enable spotifyd.service
- Enable the daemon/autostart:
-
- Allow the spotifyd daemon to register services on the system DBus: Copy the file from configs to /usr/share/dbus-1/system.d:
sudo cp ~/raspifm_repo/configs/spotifyd-dbus.conf /usr/share/dbus-1/system.d
- Allow the spotifyd daemon to register services on the system DBus: Copy the file from configs to /usr/share/dbus-1/system.d:
-
- Reboot
-
- Install gui libraries and nginx for web interface:
sudo apt install qt6-base-dev libqt6svg6-dev qt6-wayland nginx
- Install gui libraries and nginx for web interface:
-
- Create directory for raspiFM files and set permissions:
sudo mkdir -p /usr/bin/local/raspifm
and set permissions:sudo chown raspifm:raspifm /usr/bin/local/raspifm
- Create directory for raspiFM files and set permissions:
-
- Add www-data user to raspifm group:
sudo usermod -a -G raspifm www-data
- Add www-data user to raspifm group:
-
- Copy the raspiFM files to the directory:
cp -r ~/raspifm_repo/src/. /usr/bin/local/raspifm
- Copy the raspiFM files to the directory:
-
- Setup python environment/dependencies:
python3 -m venv /usr/bin/local/raspifm/.venv
/usr/bin/local/raspifm/.venv/bin/python3 -m pip install -r ~/raspifm_repo/piprequirements.txt
/usr/bin/local/raspifm/.venv/bin/python3 -m pip install ~/raspifm_repo/libs/PyQt6-6.6.1-cp38-abi3-manylinux_2_28_aarch64.whl
-
- Setup nginx:
sudo cp ~/raspifm_repo/configs/raspifm.nginx /etc/nginx/sites-available/raspifm
sudo ln -s /etc/nginx/sites-available/raspifm /etc/nginx/sites-enabled/
-
- To password protect the web interface see the comment in
/etc/nginx/sites-available/raspifm
, edit it withsudo nano /etc/nginx/sites-available/raspifm
- To password protect the web interface see the comment in
-
- Setup autostart for raspiFM:
- Create the autostart directory:
mkdir -p ~/.config/autostart
- Copy the desktop file to the autostart directory:
cp ~/raspifm_repo/configs/raspifm.desktop ~/.config/autostart
Reboot.