We love to listen to FIP, as it’s a public radio, without commercials and not so much speaking.
Unfortunately, this radio is FM brodcasted in only few city in France, and here in Grenoble, the only way to get is internet.

So we built this small kitchen radio, music playing in 14 seconds, and quite pleasantly aesthetic, in the same line as my previous nixie clock.

The large solid aluminium knob with amplifier pot ON/OFF produces a comforting click to power ON/OFF the device or adjust the volume.
The shiny stainless steel button is for future upgrade to allow changing from few radio as currently only one is available.

Hardware part

Here are almost all the items needed for this DIY hack:

  • Ikea box (4€)
  • 4″ coax speaker (10€)
  • 1″ tweeter (3€)
  • Rpi 3b (40€)
  • USB sound card (5€)
  • Stereo 5V amplifier (1€)
  • aluminium knob (5€)
  • stainless steel push button (1€)
  • C5 pannel connector for main supply (0.1€)
  • USB wall wart
  • piece of 5mm plywood
  • speaker fabric for front pannel
  • 30cm of leather belt
  • washed nuts

A total of about 60€

Step by step assembly

Let’s remove the USB sound card along with the extra not needed capacitors and jack connector (desoldering station is realy a must here)

Make a slot for the micro SD card on the back: remember, the Wifi credential are stored here.

A XY table on a drill press was usefull, I didnt imagine bamboo being so hard to mill.

Piece of leather bought in Texas, this is what’s left from my buckle-less belt I made few years ago, it could be an entry someday.

With the washer nuts, it look nice.

The C8 pannel connector, wired to the wall wart.

Everything fitted ni the box, held in place with double side tape (Multicomp from Farnell)

Piece of plywood for the front panel, with the speaker cloth.

Held in place with thin double side tape.

Software part

Download RPI image

Download a RPI image, in this case, I choose : pipaOS A lighweight, fast, Raspbian based distro for the Raspberry PI

Once the image unziped, copy to a fresh high performance micro SD card

sudo dd bs=4M if=./pipaos-tamarillo-4.7.img of=/dev/mmcblk0

in order to boost performances, I use a Samsung EVO+ for high performance for a very fast boot

ssh sysop@ (password posys)

Connect to WIFI network

Rpi 3 rev B and Zero W have integrated wifi

Edit WIFI credentials

The file  /etc/network/interfaces should NOT be modified, as it’s overwritten at start.

Edit the file

sudo nano /boot/network.ini

To add your credential:

 # interfaces - setup your networking devices here

auto lo
 iface lo inet loopback

allow-hotplug eth0
 iface eth0 inet dhcp

allow-hotplug usb0
 iface usb0 inet dhcp

# pipaOS Will automatically try to connect
 # to wireless ESSID "pipaos" passphrase "pipa123pass"
 allow-hotplug wlan0
 iface wlan0 inet dhcp
 wpa-ssid YOUR_SSSID
 wpa-psk YOUR_WIFI_KEY

High quality sound

Rasberry Pi have 3.5mm stereo jack output but the quality is pure crap, wondering why they even bother populate a jack.

So lets connect a cheap UBS sound card and check what appends


sould display something like

[ 106.865142] usb 1-1.2: new full-speed USB device number 5 using dwc_otg
 [ 107.006372] usb 1-1.2: New USB device found, idVendor=0d8c, idProduct=0102
 [ 107.006387] usb 1-1.2: New USB device strings: Mfr=0, Product=2, SerialNumber=0
 [ 107.006395] usb 1-1.2: Product: USB Sound Device

[ 107.042816] input: USB Sound Device as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.3/0003:0D8C:0102.0002/input/input1
 [ 107.105630] hid-generic 0003:0D8C:0102.0002: input,hidraw0: USB HID v1.00 Device [USB Sound Device ] on usb-3f980000.usb-1.2/input3



will output:

 Bus 002 Device 009: ID 0d8c:0102 C-Media Electronics, Inc. CM106 Like Sound Device
 Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


Create startup service : webradio

sudo apt-get install mplayer
mplayer `curl -w "%{url_effective}\n" -I -L -s -S http://direct.fipradio.fr/live/fip-midfi.mp3 -o /dev/null`

Webradio player script

create non returning script:

sudo nano /home/sysop/webradio.sh
while true
 do mplayer http://chai5she.cdn.dvmr.fr:80/fip-midfi.mp3
 sleep 1

create init.d service: webradio

 #webradio daemon
 # chkconfig: 345 20 80
 # description: mwebradioapp daemon
 # processname:webradio



 DESC="My daemon description"

case "$1" in
 printf "%-50s" "Starting $NAME..."
 PID=`$DAEMON $DAEMONOPTS > /dev/null 2>&1 & echo $!`
 #echo "Saving PID" $PID " to " $PIDFILE
 if [ -z $PID ]; then
 printf "%s\n" "Fail"
 echo $PID > $PIDFILE
 printf "%s\n" "Ok"
 printf "%-50s" "Checking $NAME..."
 if [ -f $PIDFILE ]; then
 if [ -z "`ps axf | grep ${PID} | grep -v grep`" ]; then
 printf "%s\n" "Process dead but pidfile exists"
 echo "Running"
 printf "%s\n" "Service not running"

Install startup service

update-rc.d webradio defaults

Start service manually

sudo service webradio start

Check startup time and performance

Startup time with RPI 3 B: Startup finished in 2.602s (kernel) + 4.386s (userspace) = 6.988s

Not bad at all for a full featured computer with wifi and usb audio

Leave a Reply

Your email address will not be published. Required fields are marked *