Setting up PiFace Control And Display Radio

Difficulty: medium

How to setup the PiFace Radio example to play internet radio through speakers or headphones, and control it with PiFace Control And Display.

Add stations to PiFace Radio

Changing the list of radio stations on PiFace Radio is simple.

First copy the radio program to your home directory so you don't lose the original, open a Terminal and enter
cp /usr/share/doc/python3-pifacecad/examples/ ~

You will also need to copy the radiolircrc file aswell
cp /usr/share/doc/python3-pifacecad/examples/radiolircrc ~

Now open your newly copied file in your home directory, with your favourite text editor, eg

Near the beginning of the code, you will see a line beginning like this

This is the list of radio stations. To remove a station you don't want, delete the 3 lines associated with it (name, source and info) and remove the {} also.

To add a station find its web address, one that plays the station without having to click anything on the page, and the address ends in a audio file format such as pls ormp3. Enter the station into the list in the form
{'name': "station name",
'source': 'station web address',
'info': 'station info web address' or None},

To check this works, use as your radio station (we checked this one).

Rearrange the list so your favourite stations are at the top, as PiFace radio will play them in order when you cycle through the stations