MikeyOT
Posts: 7
Joined: Wed Feb 05, 2014 3:03 pm

Internet Radio (Issue 35)

Sat Jul 18, 2015 6:38 am

Had a bit of trouble with this one. This is actually the first project I have attempted. I bought the "Monk Makes" Electronic Starter Kit from the man himself and then bought an oled display from Ebay. Installed a fresh download of Raspbian and followed the instructions in the article. Much Googling later I discovered in addition to the published code, I needed to do the following:

sudo apt-get install python-dev

I also needed to add the following two lines to /etc/modules:
i2c-bcm2835
i2c-dev

Then it all works. However, the biggest problem is that I can find very few internet radio stations that work, including all the BBC channels, except World Service. These were the main ones I wanted! Can anyone explain how to modify the code to receive more channels?

User avatar
DougieLawson
Posts: 36178
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Internet Radio (Issue 35)

Sat Jul 18, 2015 8:29 am

I2C isn't enabled that way any more.

There's an option in sudo raspi-config's advanced menu to do that stuff for you.

You'll need to check the streaming addresses for the BBC channels by searching on the internet and update the code to use the changed addresses. The BBC keep messing about with that stuff for some unknown reason.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

MikeyOT
Posts: 7
Joined: Wed Feb 05, 2014 3:03 pm

Re: Internet Radio (Issue 35)

Sat Jul 18, 2015 9:23 am

DougieLawson wrote:I2C isn't enabled that way any more.

There's an option in sudo raspi-config's advanced menu to do that stuff for you.
Thanks for the reply, Dougie. The article said to enable I2C in raspi-config, as you say, and I did that but I got no response from "i2cdetect -y 1". Only got this after I added those two lines to /etc/modules
You'll need to check the streaming addresses for the BBC channels by searching on the internet and update the code to use the changed addresses. The BBC keep messing about with that stuff for some unknown reason.
I understood that and have read all about the BBC changing to AudioFactory etc. The article gave three examples: Radio Paradise, a fip stream ending in .mp3 and BBC World Service. Paradise and World Service work but not the .mp3 stream. The author also suggested looking at http://www.dronkert.net/rpi/radio.html for more streaming radio stations.. Very few of the stations listed there work. A station called Ancient, which was a URL with a port number, works but when I mistyped the port number one time, I got Abbey104, a local station based in Sherborne, Dorset!

My basic problem is ignorance. I'm new to this. I have no idea whether the streams are not working because the URIs have been changed or mpd cannot handle certain types of stream. I've had a look at mpd's config file but am no wiser. The new BBC radio streams are asx/m3u format and I do not yet understand how to deal with those.

User avatar
Paul Webster
Posts: 801
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
Contact: Twitter

Re: Internet Radio (Issue 35)

Sat Jul 18, 2015 1:31 pm

.asx and .pls are text files ... so if you wget them you can take a look inside.
You will easily spot the stream URLs.

Plus ... another opportunity to mention that LMS (Logitech Media Server) has access to a curated database of thousands of internet radio stations (including FIP that I am listening to now ... and often do).
LMS works well on RPi.

User avatar
Nfarrow
Posts: 47
Joined: Sat Dec 20, 2014 1:24 am
Location: Oklahoma, USA
Contact: Website Facebook Twitter YouTube

Re: Internet Radio (Issue 35)

Thu Jul 30, 2015 7:40 am

Have you tried using PianoBar?
it's an open-source, lightweight terminal program which runs Pandora Radio. Setup is simple - run the following from a terminal

Code: Select all

sudo apt-get install pianobar
After entering "y" to all the prompts, Pianobar should be successfully installed. By entering pianobar in a terminal, the program begins. Log into your Pandora account, and get a feel for the program. (Hint: typing "?" will give a list of keybindings for controlling Pianobar)

http://www.instructables.com/id/Pandora ... made-with/
Twitter: @farrownick
Instagram veggievampire
I own a lot of Pis....

MikeyOT
Posts: 7
Joined: Wed Feb 05, 2014 3:03 pm

Re: Internet Radio (Issue 35)

Thu Jul 30, 2015 7:54 am

Update: SOLVED!

First of all, all I was trying to do was to get the internet radio project from MagPi issue 35 working. I know I can use other programs etc on the RPi. The problem was that some of the URLs the author included have changed and no longer work and neither do most of those listed on the website he suggested (http://www.dronkert.net/rpi/radio)

I have now discovered vTuner:
http://vtuner.com/setupapp/guide/asp/br ... CurrPage=4

These all work - particularly the BBC stations, which was what I actually wanted.

User avatar
Mr. Whiskers
Posts: 1
Joined: Wed Apr 22, 2015 1:47 am

Re: Internet Radio (Issue 35)

Fri Jul 31, 2015 2:20 am

I followed the instructions as listed in Issue 35.

I received no table at all when
sudo i2cdetect -y 1
was entered.

I made the changes suggested by MikeyOT, rebooted, and the table with my I2C device appeared!

I add stations manually by editing playlists in /var/lib/mpd/playlists
You can operate the mpc from command line.

Thanks!

User avatar
DougieLawson
Posts: 36178
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Internet Radio (Issue 35)

Fri Jul 31, 2015 10:50 am

There's a option in sudo raspi-config (on the advanced menu) to get I2C running.

You also need to edit (with sudo nano) /etc/modules and add

Code: Select all

i2c-dev
After that a reboot should get I2C working.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

johndavies
Posts: 185
Joined: Fri Dec 20, 2013 1:00 pm

Re: Internet Radio (Issue 35)

Fri Aug 21, 2015 8:11 am

I have only just seen this post so I apologise for the delay. Sites such as Radiofeeds, Listenlive and VTuner which provide radio playback often contain a code within a code. Look at the site's radio station address in your browser or inside any file that the site saves. Open up LXTerminal. Type in "curl", leave a space and then type or paste the site's code for that station. After pressing "Enter" this will give another code which can be played via mpc or omxplayer through the LXTerminal. This is how i found out the new BBC radio codes which were introduced around February. it was this change that made the BBC stations on Dronkert's list unplayable.
You may see three lines of letters, characters and numbers when you enter BBC radio stations using "curl". You only need to copy part of the first line, from http down to and including _p or _q.

Natural Sound
Posts: 1
Joined: Tue Jan 05, 2016 8:32 pm

Re: Internet Radio (Issue 35)

Tue Jan 05, 2016 10:51 pm

Hello, after struggling with "pillow" I finally got this working. I had to add the following before pillow would install.

Code: Select all

sudo apt-get install libjpeg-dev
Does anyone know how to make the screen scroll if the information wont fit the width of the display?

Thanks in advance

galaxyrider
Posts: 33
Joined: Sat Dec 26, 2015 2:36 pm

Re: Internet Radio (Issue 35)

Fri Feb 19, 2016 9:35 am

Hello. I am having problems with this too. I've done the python dev update. Where do I add i2c-bcm2835 and
i2c-dev to the code, I can't see a line with etc/module in it. Thanks.

User avatar
GTR2Fan
Posts: 1601
Joined: Sun Feb 23, 2014 9:20 pm
Location: South East UK

Re: Internet Radio (Issue 35)

Fri Feb 19, 2016 10:16 am

Eyes up! See DougieLawson's post a few posts above yours.
Pi2B Mini-PC/Media Centre: ARM=1GHz (+3), Core=500MHz, v3d=500MHz, h264=333MHz, RAM=DDR2-1200 (+6/+4/+4+schmoo). Sandisk Ultra HC-I 32GB microSD card on '50=100' OCed slot (42MB/s read) running Raspbian/KODI16, Seagate 3.5" 1.5TB HDD mass storage.

m.meadows
Posts: 2
Joined: Mon May 16, 2016 12:27 am
Location: Delaware, US

Re: Internet Radio (Issue 35)

Wed Jun 08, 2016 12:00 am

Time to resurrect an old project...
When I run the python program I get
Traceback (most recent call last):
File "internet_radio.py", line 17, in <module>
small_font = ImageFont.truetype('Arial.ttf', 12)
File "/usr/lib/python2.7/dist-packages/PIL/ImageFont.py", line 240, in truetype
return FreeTypeFont(font, size, index, encoding)
File "/usr/lib/python2.7/dist-packages/PIL/ImageFont.py", line 137, in __init__
self.font = core.getfont(font, size, index, encoding)
IOError: cannot open resource
I tried looking, and I can't seem to figure it out. I've also tried to change the font.

User avatar
startrek.steve
Posts: 383
Joined: Thu Aug 30, 2012 7:19 pm

Re: Internet Radio (Issue 35)

Wed Jun 08, 2016 7:59 am

DougieLawson wrote:I The BBC keep messing about with that stuff for some unknown reason.
That reason would be trying to nobble get_iplayer...
Steve
Pi 2 running LibreElec Krypton, Pi 2 running Wheezy Desktop, Pi 1 headless Wheezy, downloading Radio, Pi 1 running Picore headless Media Server, Pi Zero to be an Old Time Radio Project. Pi 3 testing. Pi Zero W downloading Radio shows headless.

Return to “The MagPi”