Fork me on GitHub

Herr Knedel/PIFM: 104.6 Worldwide on FM Radio

Created Wed, 17 Jul 2019 00:00:00 +0000 Modified Mon, 28 Mar 2022 18:08:11 +0000 Difficulty level: Can be done by anyone

204 Words

If you are a 104.6 RTL fan and don’t want to spend a day without Berlin’s hit radio, then you are in the right place. You need a single board computer called Raspberry and a cable on GPIO port 4 as an antenna.

The following packages are required

x
+
Terminal

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install sox libsox-fmt-all

I create a download folder and download the PIFM script:
x
+
Terminal

$ mkdir /home/pi/installs
$ cd /home/pi/installs/
$ wget http://omattos.com/pifm.tar.gz
$ tar vfzx pifm.tar.gz

pifm script

I create a new file “$vim /home/pi/radio-streamer.sh” with the following content:

#!/bin/bash 
pkill sox 
pkill pifm 
sleep 1 

sox -v .9 -t mp3 http://stream.104.6rtl.com/rtl-live -t wav --input-buffer 80000 -r 22050 -c 1 - | sudo /home/pi/installs/pifm - 104.6

The script needs the following permissions:

x
+
Terminal

$ sudo chmod 775 /home/pi/radio-streamer.sh

Possible crontjob

The computer is started every night between 4 and 5 o’clock. In addition, the Radion reconnects every hour.

@reboot sleep 60 && sudo /home/pi/radio-streamer.sh 
36 4 * * * sudo pkill sox 
37 4 * * * sudo pkill pifm 
38 4 * * * sudo reboot 
59 * * * * sudo /home/pi/radio-streamer.sh