Topic: How to get last.fm on chumby without another PC
Finally gotten my chumby this week, and haven't been able to put it down I got it first and foremost as a replacement for my alarm clock, so the first thing I looked for were the internet radio streams of my fave radio stations. They were all WMA streams of course, so no go. I tried cross-compiling bluetune, but the WMA decoder was missing in the source (in a special BlueTuneExtras package apparently), so that was no option.
So plan B was to get last.fm working, at least until chumby releases the chumby radio addon (which is probably based on this from the src). The only solutions I saw were ones that involved another PC, and that's just not green
Poked around a bit more, and the result is a last.fm player on the chumby itself that's supported by the chumby control panel. Ok, I'm getting ahead of myself here - right now, you can tune into the desired streams and listen to them, but that's about it.
To use it, download this (UPDATED to 0.2 - see below), and extract it on to your USB drive's root folder.
NOTE - if you already have a debugchumby file, this will overwrite it; backup and merge the debugchumby files manually. The same goes for profile.xml.
Now, assuming your USB drive is E:, go to E:\lastfmproxy-1.3b and open up config.py in a text editor. Fill in the gaps with your last.fm username and password and save.
Plug the USB drive into your chumby and reboot it.
Once it's done loading, go to the control panel, then to Music, then My Streams, and New.
To add global tag streams, use the following URL:
http://localhost:1881/globaltags/metal.m3u where metal is the global tag name (use %20 to represent spaces in tag names).
To add similar artists streams, use:
http://localhost:1881/artist/Evermore/similarartists.m3u where Evermore is the artist name (use %20 to represent spaces in artist names).
Essentially, its the lastfm:// url without the lastfm:// bit, http://localhost:1881/ added to the start, and .m3u tacked on the end.
Alternatively, you can use the URL http://localhost:1881/lastfm.m3u to play your last listened to artist/tag and control what gets played via the web interface, accessible on port 1881 (i.e. http://<chumby ip address>:1881/). See here for more info on how to control the player over the web interface.
Choose m3u as the type, save, and click play. If its configured properly, you should start hearing last.fm music in a few secs.
And because it comes through as a stream, you can use it as an alarm wakeup stream as well.
Couple of warnings - I have deliberately made the web interface accessible to the entire network, so I can see what it is playing on my computer. Because of that though, it is a security risk you should be wary of - change it if you want in the config.py file.
Technical stuff
This works using the lastfmproxy project, and duane's chumby python files. I've packaged them up into one file for convenience.
I was originally going to implement the lastfm stuff in C++, using the chumbyradio code as a base (just release the damn device already!), but then came across the python binaries and lastfmproxy, and didn't see the point in rewriting what had already been written Thanks to both projects - I really didn't do much apart from slap it all together.
what next?
Well, I'm considering writing a frontend for last.fm as a widget, so you can control it directly on the chumby. However, with talk of chumby working with last.fm on a solution, I'm not really hot on doing something that the chumby guys can do better because they have access to the control panel code. Any news on that front, chumbians?
Let me know if there are any issues/bugs.
UPDATE (06/06/2008): I've tidied up the python code, strengthened it for chumby-specific cases (e.g. the chumby has no shutdown process, so when writing files to /mnt/usb, they can get corrupted, so lastfmproxy has been updated to better handle corruption), fixed the web interface, and... wrote a flash widget for it!
Yeh, couldn't wait. The flash widget just displays the current song, and skip/love/ban buttons. Nothing fancy, but enough to make it usable.
The flash widget is included in the download link above.
The flash source is available here.