How to install the programs to listen to an internet radio on the Raspberry Pi

In the last Tutorial we successfully connected to the Raspberry Pi and now we need to log into the Raspberry Pi. The standard Login is:

Login as: pi
pi@192.168.0.83's password: raspberry

ADVICE: You can copy and paste in the command line of the Raspberry Pi with selecting and right clicking. (Example: Copy the Login Name pi from here with Ctrl+c and paste it with a right click into the Raspberry Pi command line)

By tipping in the password you won’t see what you type. Just type in “raspberry” and hit enter. (Without the quotation marks obviously)

This should be on your screen now:

login as: pi
pi@192.168.0.83's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.

pi@raspberrypi:~ $

Next you need to type in the following command to update all your system packages:

sudo apt-get update

This will take a few minutes. You need to wait until there is this line at the bottom again:

pi@raspberrypi:~ $

In the next step you will upgrade all the installed packages to their latest version. This can take a few minutes as well:

sudo apt-get dist-upgrade

While the Raspberry is doing this there could be a question if you want to continue that looks like this:

You simply type in “y” and hit enter. (Without the quotation marks obviously)

After the update is finished the next step is to install the player for the internet radio. Maybe the Raspberry will ask you again if you want to continue the installation. Just type “y” and hit enter again. (Without the quotation marks obviously)

apt-get install mplayer

At next you create a file that will open the internet radio you want with the mplayer. (The file will be automatically opened ready to write something in it)

sudo nano player.sh

After this we need to write the necessary code into this file. But first you need to get the IP address of the internet radio you want to listen to. Normally you can find the IP by searching for the stream of the internet radio you want. In this case I selected a random internet radio from this radio stations list. After you have chosen a stream you write “mplayer the_stream_you_want” into the file that is already opened. Make sure you replace “the_stream_you_want” with a real IP address like so:

mplayer http://212.83.150.15:8189/stream/

After this is written to the file you press Strg+x and the Raspberry will ask you if you want to save the modified buffer. You hit y and enter. Now you should be back in the command line.

You can type the following to start the file and listen to the internet radio. But don’t forget to attach your speaker to the Raspberry Pi first.

bash player.sh

If this is not working you probably have not written the stream correctly into the file you created. Just look for some typos there.

You can close the file again by pressing Ctrl+c.

Now you have a file that can open an internet radio stream!

In the next Tutorials you can see how to get these file into the startup folder of the Raspberry PI and how you can use the WLAN adapter to get the Raspberry Pi into your WLAN network.

These two tasks are not that complicated but it will be necessary to provide you an internet radio that is easy to use. It wouldn’t be practical if you always need to have a cable lying around and so it wouldn’t be practical if you need to start the file manually every time you restart the Raspberry Pi. So jump to the next Tutorial to see how this works.

Leave a Reply

Your email address will not be published.