Monday, 12 February 2007

Streaming Last.fm to Reciva internet radios (Logik IR100)

The choice of stations on the Logik WiFi internet radio via Reciva is vast but I also like to listen to Last.fm's personalised radio on my PC. After trying a few similar personalised radio services such as Pandora and Yahoo Music Last.fm seems to have the best system for finding similar music and I can listen to it for hours without hearing a bad or out of place track. The problem is Last.fm uses a proprietory audio stream and the Reciva radios only play stations listed on Reciva (out of the box anyway).

The following is a quick guide to getting a Logik IR100 or similar Reciva internet radio to play Last.fm via a PC. It’s a bit of a longwinded process but it seems to work.

  • Firstly download LastFMProxy which is a proxy server that turns the Last.fm stream into a stream other players can deal with. It is written in Python so should work on Linux, OS X or Windows. You may also need to install Python at this point if you don't already have it.
  • Decompress LastFMProxy somewhere on your hard drive and follow the README instructions to setup the config with your Last.fm username and password.
  • Run main.py and you should now be able to point your web browser to:http://localhost:1881/and play an audio stream from:http://localhost:1881/lastfm.m3u (which can be tested in Winamp or similar)

The next stage is to connect your internet radio to this proxy stream using the 'My Streams' option on Reciva.com.

  • Create a Reciva account if you don't already have one. Login and go to 'My Account' and select 'My radios' then follow the instructions to add your radio to your account.
  • Add the Last.fm stream to the 'My Streams' section on Reciva entering a URL for your LastFMProxy PC. This will probably be the LAN IP e.g.http://192.168.1.9:1881/lastfm.m3u
  • Back at the internet radio you should now have an option under 'Stations' for 'My Stuff' where you should find your streams. If not you may need to force the radio to download the station lists by pulling the power on it and restarting.
  • Select your stream and after a few seconds you should be listening to Last.fm on your WiFi radio. If you have any problems check you don't have a firewall blocking TCP port 1881 on the proxy PC and test the proxy is running correctly with Winamp or similar.

15 comments:

Anonymous said...

Is there a way I can do the same with Pandora as I really like listening to it.
Beryl

Tim said...

This worked well for last.fm on my PC, but on my radio I get 'Station Data Not Loaded' all the time. Any ideas?

Rob Smith said...

Hi Tim, have you tried rebooting the radio by unplugging it?

Tim said...

Yeah, I did try that.
It is a very new IR100, could it have different software maybe?

Rob Smith said...

Have you correctly registered your radio on the reciva site so it is linked to your reciva account? Take a look at http://logikir100.tripod.com/Logik.htm
for info on firmware versions, it would be interesting if you have a newer firmware. Let me know how you get on.

Tim said...

I think I must have registered it correctly, otherwise the last.fm stream I've set up wouldn't appear on my radio would it?

I checked the page you mentioned regarding firmware and I don't seem to have an unusual one, so it can't be that.

Rob Smith said...

I've not come across the problem myself. It's worth making a post on the Reciva.com community forums though to see if anyone there has some ideas.

mindful said...

I'm having problems with an early step in this process.

When I run main.py, a command (DOS) window briefly appears and then immediately closes. If, after this, I enter the URL http://localhost:1881/ into my browser, I get a 'link not found error'. Same for the other URL you provide in your post.

Not sure if I've misunderstood the instruction, or if there is perhaps something wrong with Python running on my system (I did download this, and it appears to be happily on my system, but I can't be sure).

FYI - I'm running Windows XP and using Google Chrome for all of the browser stuff.

Thanks,
Stu

Rob Smith said...

Hi Stu, try running the script from the command line (start > run > type "cmd"). This way the window should stay open and you will see any error message.

mindful said...

@ Rob,

Thanks for the advice. Error message is as follows:

line 103
print "Unhandled method" ", req [0]
Syntax error: invalid syntax

looks like it is trying to return some kind of error code for a failed method/function of some sort.

Not sure if I did this correct, all I did was open a DOS window (a cmd window) and typed in the path to main.py, i.e. I put the following into the cmd window:

C:\Documents and Settings\Stu\My Documents\lastfmproxy-1.3b\lastfmproxy-1.3b\main.py

Was that the correct thing to enter?

Stu

Rob said...

Not too sure Stu as I'm on a Mac so can't check. Try entering:
"python C:\Documents and Settings\Stu\My Documents\lastfmproxy-1.3b\lastfmproxy-1.3b\main.py"

Have you got the latest version on Python? Try downloading a new version of the last fm proxy to a new folder and run it before changing any config. You should just get an error about the username/password. Then just change the login details and try it again in case your text editor has caused a problem.

Anonymous said...

"line 103
print "Unhandled method" ", req [0]
Syntax error: invalid syntax"

Same problem (with python 3.x)
running lastfmproxy with python 2.6 fixes it

obviously no full downward compatibility

Anonymous said...

Hi,
I get an error message when I try to test the URL http://localhost:1881/, in the command window, "Unhandled method:['']
Strangeness! No tracks in playlist?"
then it trys to see if my neighbours' list is available, but can't obtain it and stops.
"IndexError: list index out of range"

I do have a playlist in my last fm account.. what am I doing wrong?

slowmo69 said...

Did you setup the PATH enviorment var? Try:

set PATH=E:\Python\;E:\Python\Lib:E:\Python\Lib\idlelib;E:\Python\libs;E:\Python\Lib\site-packages;%PATH%

set your python version for
i.e. for version 3.1:

set PATH=E:\Python31\;E:\Python31\Lib:E:\Python31\Lib\idlelib;E:\Python31\libs;E:\Python26\Lib\site-packages;%PATH%

greetz SlowMo aka Riddick

Abdul Bari Chanessra said...

As an Authorized GE MDS Radio Distributor, Remote Site Products sells all MDS Radios and Accessories, and MDS Power Supply Kits MDS radios from remotesiteproducts.com,