Tools4Roku (t4roku.pl)

Tools4Roku - Pimp up your soundbridge

Why put tons of gadgets on my shelf when I have a nice roku soundbrigde?
This display can show all the information I can think of (weather,
mail, rss, phone calls ...). Further its functionality can be enhanced with some tricks. But lets start simple :-)




* these pictures are screenshots made from a cool software called Java Roku Remote from R.A.Buchanan

Download

You can download the latest Tools4Roku here (2008/08/04, ZIP archive).

A knonw problem is that the display of the roku freezes if the script crashes or network connection is lost during weather information on display. In this case reboot your roku by disconnection of power or log into roku via telnet port 4444 and send the command "sketch -c clear" and "sketch -c quit"
The software is only little tested, used your bandwidth, may be a security risk for your network, may freeze or bake some chips here and there, so use it at you own risk. I do not review or control third party web sites that link to or from this web site, I am not responsible for their content, and do not represent that their content is accurate or appropriate.

Installation

My roku gets its music from Linksys NSLU running uNSLUng firmware and
the mt-daapd music server (besides other services...). To run perl
sripts I had to install perl by
ipkg update
ipkg install perl
I was not successful to install CPAN as well, so I tried to avoid any
additional perl packages. But the Net::Telnet was needed by RokuUI.pm.
So just download it
http://search.cpan.org/CPAN/authors/id/J/JR/JROGERS/Net-Telnet-3.03.tar.gz
install the compiler
ipkg install make
compile it:
perl Makefile.PL
make
make test
make install
Edit the Tools4Roku config (t4local) file to suit your needs ( IP address! )
T4Roku comes with an English, German and French version of t4local.
Please send me the your translations into other languages.
Then you can start Tools4Roku by
perl t4roku.pl
Enjoy :)
You can make the script start when the uNSLUng server starts by making a new file "S80rokuweather" in /opt/etc/init.d (I prefer the nano editor)
cd /opt/etc/init.d
nano S80rokuweather
containing the lines (substitute the propper path name)
cd /t4roku-path/
perl t4roku.pl &
and change the permission to executable
cd /opt/etc/init.d
chmod 711 S80rokuweather

Use

At stand-by

Tools4Roku starts to show weather information shortly after you switch to standby. Information is updated every 30 minutes via RSS feed. You can switch between 3 (4) modi by remote control (UP or DOWN key): Weather of today, weather for today and tomorrow, the time (and a compact view of all data if you have a tall display).

When the roku is on

Press the home button three times and the display will show menu.
Use the Up and Down key to move the cursor and press Select to activate your
selection. Currently the menu lets you choose from:

  1. show the weather data
  2. set the soundbridge to sleep mode
  3. set an alarm
  4. shut down the server (modify the comand in the script for your needs, see line 252). Use with caution!


The Song Rating

If music is playing, the songs can be rated with the remote. The rating is
updated in the mt-daapd database (tested with svn-1696, sqlite2).
The Rating is done from 0-100 (every 20 counts equals 1 star in iTunes).
Press the "right"-button if you like the current song, and press
the "left"-button on your remote if the song is not your taste.
The rating will be racalculated after the formula:

If ("Right") then (Love = 100) else (Love = 0)

NewRating = ( OldRating + Love ) / 2

So a multiple love will bring the rating closer to ultimate love (100),
or the other way round. The function is not symetric, so dislike a much beloved
song once and it will drop below the 50.

Some users dislike this kind of rating and would rather stick to a iTunes like rating.
If there are more demand for this I will make it selectable in the localisation file




!! Caution so far t4roku does not recognise if you browse a menu or something
similar. So if you use the key during browsing a menu and having background
playback, the current song will be rated !!



You will see and responce on the Roku display:




Play similar artists

If music is playing, the current playlist can be replaced by a playlist of
all songs from similar artists in your collection. Simply press the brightnes
button on your IR remote control. The generating may take some seconds.

Background: The current playing artist is read via RCP from your Soundbridge.
With the name a list of similar artist is requested at audioscrobbler.com
Based on that list and the "similarity threshhold" your local collection of
songs ist filtered with those artist names. The new generated playlist is
played shuffled after the query is finished.




Icons

The weahther icons are in the pbm subfolder.
If you not like the icons, then pixel it for yourself in your favorite
application and save or convert to PBM format. Be careful, the t4roku does
not have much error handling!! Size of my icons is 32 x 32 pixel.
Thanks Marco Forschner for the 16 x 16 pixel icons.



© 2008 J.Gluch

To-do

  • error handling for incomplete rss feed ($1 clear ?)
  • show mailbox status on roku display
  • debug "similar artists" function
  • investigate server hang-up if roku is un-powered
  • rating songs: rating formular selectable in localisation file (if there is a demand!)
  • rating songs: SQLite2/3 database selection into localisation file
  • make last.fm scrobbler function (done by somebody else: see here)
  • rating songs from the Roku remote (done)
  • shut down server from roku remotely (done)
  • make "sleep" function available via remote control (done)
  • make "alarm" function available via remote control (done)
  • show local measured temperature via digitemp (done)
  • make Tool4Roku also accessible when playing music (done)
  • make "play similar artists" like current artist function (done)

History

2008/08/04
  • working example of a "Play similar artists" implemented.
    The function is mapped to the brightness button of the IR remote control.
    It asks for the current artist, looks up similar artists at audioscrobbler.com and puts all tracks from local music server from listed artists into new playlist, which is then played in shuffled order
2008/06/23
  • localisation for rating, rating not possible for internet radio (remote stream)
2008/06/20
  • implmented a rating functionality, sqlite must be installed on the NSLU2
2008/03/01
  • made variables for all used strings (for easier localisation)
  • move icon drawing sub call to end of output, optical Roku looks more responsive. Thanks to mic_hall for this idea
  • localisation file based on Michael Polymenakos perl scripts (this version comes with: EN and DE)
  • bug fixed the sleep mode, repeated pressing of select button increases time
  • I like the idea from Steve Forster to alternate view and put it in as well. On/off via config file.
  • merged small and tall display versions (switch in config file). Thanks Marco Forschner for the work to fit the small display
2008/01/28
  • bug fix the remote control exception handling (echo insted of intercept, result: smoother scrolling and volume control, just like without t4roku)
  • new menu function. The door is open to control anything on the server from SB
  • Sleep and Alarm acessible with the remote control via the menu
2008/01/20
  • additional view (modus 2) with all weather data in compact view
  • include digitemp temperature in modus 0 and 2
2008/01/12
  • the weather is now accessible also when soundbridge is switched on, simply press the Home butten three times
  • some bugfixes
2008/01/09
  • first release, shows weather on Roku display when in stand-by
© 31.08.2008 by Jürgen Gluch



Kommentare:

  1. Hi Goemon X,

    Given the age of this posting, I take it you're not (actively) maintaining this posting or the t4roku project any more. I'd like to tell you that I've used this little piece of perl code for quite a while and with lots of pleasure. It had been broken since an update of my server but this morning I went back to it to get it back up and running. Seems to me that Yahoo have changed their web (RSS) feed for the weather information and although I was able to find the line in the script, it doesn't seem to work with what I figure to be the new URL: any request directed to http://weather.yahooapis.com/forecastrss?p=FRXX0076&u=c will be answered by: "Please provide valid credentials. OAuth oauth_problem="OST_OAUTH_PARAMETER_ABSENT_ERROR", realm="yahooapis.com". I'm not enough into this to understand how to make amends but should you have the time and interest to help me get this back up, maybe we please some other folk that would like to see the weather forecast on their Soundbridge. I for one would be much obliged!

    Cheers JP

    AntwortenLöschen
  2. Hi JP,

    Yahoo recently changed their weather service API...

    you can look up the ID for your location (weoid) at

    https://query.yahooapis.com/v1/public/yql?q=select+woeid+from+geo.places%281%29+where+text="paris"

    So Paris is "615702", was "FRXX0076".

    The new query for the wheater will be:

    https://query.yahooapis.com/v1/public/yql?q=select+*+from+weather.forecast+where+woeid=615702

    I have not tested if the response is the same or if the code has to be adopted too.

    PS: I have the code running happyli during the last years too and did not do changes...

    Goemon X

    AntwortenLöschen