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
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install sox libsox-fmt-all
$ 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:
$ 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