Partlist

1 x Raspberry Pi Zero W 2


1 x Hifiberry miniAMP


1 x GPIO header edge


1 x Pinmoroni OnOff SHIM


1 x Rotary encoder KY-040


2 x Cherry MX Blue switch


1 x Mico-SD card


1 x Micro-USB solder plug


1 x Dupon housing 1×5


13 x Dupon housing 1×1


4 x Crimp contact male


19 x Crimp contact female


1 x 3D-Druck-Teile


1 x Visatron FR8 TA, 10W, 4Ω


Speaker cable (≈0,5 mm2)


Cable (≈0,14 mm2)


1 x LED (5 mm)


1 x USB-C socket


4 x M3 / 8-10 mm


4 x M3 / 5 mm


4 x M2.5 / 5 mm


To save shipping costs, I order most of the components via reichelt.de. Except for the USB-C socket and screws, everything is available there: REICHELT SHOPPING LIST.

The printing files for the housing can be downloaded from PRINTABLES.COM.

Cables

1 x Speaker


Länge:160 mm
End 1:naked
End 2:naked

5 x Rotary encoder


Länge:180 mm
End 1:Crimp female
End 2:Crimp female

4 x OnOff SHIM


Länge:110 mm
End 1:Crimp female
End 2:Crimp male

4 x Buttons


Länge:180 mm
End 1:naked
End 2:naked

2 x LED


Länge:180 mm
End 1:naked
End 2:Crimp female

Connection

Assembly

Software installation

1. Install operating system

Download the Raspberry Pi imager from the official website and install it.

  • Raspberry Pi Model: Raspberry Pi Zero 2 W
  • Operating system: Raspberry Pi OS (Other) > Raspberry Pi OS (Legacy, 64-Bit) Lite Bullseye
  • SD card: Select the SD card

Make sure that you have selected the operating system version “Bullseye”, otherwise the OnOff SHIM will run incorrectly.

Click on CONTINUE and confirm that you want to edit the OS settings by clicking on ADJUST SETTINGS:

GENERAL:

  • Hostname: gusi
  • Username: gusi
  • Password: enter a password
  • Set up wifi: Enter the login data for your WLAN network
  • Wifi country: select your country code
  • Set language settings: Set the correct time zone and keyboard layout

SERVICES:

  • Enable SSH: Use password for authentication

Click on SAVE, confirm with YES that you want to use the settings and start the installation with CONTINUE.

After successfully writing on the SD card, insert it into the Raspberry Pi and start it.
The first start takes a little longer. Wait five minutes until you go to the next step.

2. Identify IP address

To be able to access the Raspberry, you need the IP address.
You can search for the device “gusi” in your router and note the IP, or you can use your computer’s console (CMD in Windows, Terminal in Mac and Linux). Enter the following command and confirm with the ENTER key:

ping gusi.local

If the request is successful, you should be able to read out the IP address of the radio. In my example:
64 bytes from 192.168.1.22: icmp_seq=8 ttl=64 time=5.323 ms

3. SSH connection

Open the console (CMD or Terminal) on your computer and enter the command to connect via SSH. Replace the example IP with yours!

ssh gusi@192.168.1.22

4. Activate sound card

In the configuration file, we now activate the sound card and deactivate the Bluetooth module. The last is of course optional.

sudo nano /boot/config.txt

Place the following text at the end:

################## GUSI ################
# Disable Bluetooth
dtoverlay=pi3-disable-bt

# Enable Hifiberry Soundcard
dtoverlay=hifiberry-dac

Save the change with CTRL + X and confirm with Y and ENTER.

5. Installation

5.1 Install the required packages to be able to operate the radio:

sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get install -y git mpd mpc alsa-utils python3-pip python3-gpiozero hostapd dnsmasq

5.2 Clone the data from the Git project:

git clone https://github.com/earlmckay/gusi-radio.git

5.3 Start the installation script:

chmod +x /home/gusi/gusi-radio/setup_gusi.sh && sudo /home/gusi/gusi-radio/setup_gusi.sh

Select your preferred language and which model of the radio you are using (BM2K).

5.4 Install the Pimoroni OnOff SHIM. The component ensures that the Raspberry shuts down cleanly when it is switched off and starts up again when the on/off button is pressed again:

curl https://get.pimoroni.com/onoffshim | bash

Restart the device after the installation has been completed.

After the restart, the device is ready for operation and should already start playback.
In the next tab, we will explain how to store your favorite stations.

Customizing

6. Personalize radio stations

6.1 Connect to the radio via SSH and open the script that controls the playback. (Alternatively, you can edit the script locally on your computer using e.g. FileZilla).

sudo nano /home/gusi/gusi-radio/gusi.py

6.2 Create a separate variable for each streaming link. E.g. “S1” for the first station, “S2” for the second station etc. …

S1 = "https://server7.streamserver24.com:61424/stream"
S2 = "http://www.segenswelle.de:8000/deutsch"
S3 = "https://server23644.streamplus.de/stream.mp3"

In the variable stations you determine which stations are used and, especially, in which order.
The announcements variable determines which announcements are used and in which order.
The “s1.mp3” plays: “Station one”. The announcements are stored up to “Station six”.

#---------- RADIO STATIONS ORDER ----------#
stations = [S1, S2, S3]

#---------- ANNOUNCEMENTS ORDER ----------#
announcements = ["s1.mp3", "s2.mp3", "s3.mp3"]

6.3 Example:
You want to use two stations on your radio. 1live and WDR5. The code should look like this:

einslive = "https://wdr-1live-live.icecastssl.wdr.de/wdr/1live/live/mp3/128/stream.mp3"
wdr5 = "https://wdr-wdr5-live.icecastssl.wdr.de/wdr/wdr5/live/mp3/128/stream.mp3"

#---------- RADIO STATIONS ORDER ----------#
stations = [einslive, wdr5]

#---------- ANNOUNCEMENTS ORDER ----------#
announcements = ["s1.mp3", "s2.mp3"]

7. Auto shutdown

The radio has an automatic shutdown function. This is defined with the variable shutdown_timeout.
The default value is 60 x 60 seconds = 60 minutes.
The countdown starts as soon as the volume = 0, or playback is paused.

shutdown_timeout = 60 * 60

8. Customized announcements

8.1 The announcements were generated with the help of TTS ( for example elevenlabs). You can use any voice you like and personalize the station’s announcement. As in our example “Eins live” and “WDR fünf”. (My audio files are normalized to -14 LUFS)

Transfer the data (e.g. with FileZilla) to the Raspberry in the main directory (/home/gusi/gusi-radio/).

8.2 Move the MP3 file to the correct directory.
Make sure to enter the correct file name in the command!

sudo mv "/home/gusi/gusi-radio/wdr5.mp3 /var/lib/mpd/music/

8.3 Update the music database after all required announcements have been moved:

mpc update