Page 1 of 1

Internet Radio (Issue 35)

Posted: Sat Jul 18, 2015 6:38 am
by MikeyOT
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?

Re: Internet Radio (Issue 35)

Posted: Sat Jul 18, 2015 8:29 am
by DougieLawson
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.

Re: Internet Radio (Issue 35)

Posted: Sat Jul 18, 2015 9:23 am
by MikeyOT
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.

Re: Internet Radio (Issue 35)

Posted: Sat Jul 18, 2015 1:31 pm
by Paul Webster
.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.

Re: Internet Radio (Issue 35)

Posted: Thu Jul 30, 2015 7:40 am
by Nfarrow
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/

Re: Internet Radio (Issue 35)

Posted: Thu Jul 30, 2015 7:54 am
by MikeyOT
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.

Re: Internet Radio (Issue 35)

Posted: Fri Jul 31, 2015 2:20 am
by Mr. Whiskers
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!

Re: Internet Radio (Issue 35)

Posted: Fri Jul 31, 2015 10:50 am
by DougieLawson
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.

Re: Internet Radio (Issue 35)

Posted: Fri Aug 21, 2015 8:11 am
by johndavies
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.

Re: Internet Radio (Issue 35)

Posted: Tue Jan 05, 2016 10:51 pm
by Natural Sound
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

Re: Internet Radio (Issue 35)

Posted: Fri Feb 19, 2016 9:35 am
by galaxyrider
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.

Re: Internet Radio (Issue 35)

Posted: Fri Feb 19, 2016 10:16 am
by GTR2Fan
Eyes up! See DougieLawson's post a few posts above yours.

Re: Internet Radio (Issue 35)

Posted: Wed Jun 08, 2016 12:00 am
by m.meadows
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.

Re: Internet Radio (Issue 35)

Posted: Wed Jun 08, 2016 7:59 am
by startrek.steve
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