Using my Squeezebox Remote for traffic information

I have a Squeezebox Duet, which is great for playing music. But I knew that the remote control was an embedded system running Linux. It’s sitting in it’s charger right next to me during breakfast, and I’ve been thinking about whether it would be possible to use it to check when my bus is coming. My bus is running along a road with heavy traffic, and it can be quite delayed during rush hours in the morning. And since the local traffic information agency is supplying free real time public transport information, I decided to give it a go.

The result

This is how the application looks right now. It’s currently in a state where it’s usable for me.

imageimageimage

If you have a squeezebox and are really bold, the applet can be dowloaded directly from the remote by adding https://github.com/downloads/perfp/TrafikantenSqueezebox/applets.xml to your squeezebox plugin settings (and remember to enable 3. party plugins)

Also, if you wan’t to check out the source, it’s available on https://github.com/perfp/TrafikantenSqueezebox

 

A few technical notes

The Squeezebox runtime environment is called jive and can be programmed in Lua. Lua is a really simple scripting language with a few interesting features, like first-class functions, dynamic typing, garbage collection and closures. I also uses one specific structure for all state, the table, which is more or less a hash table.

After playing a bit with Lua, I started looking at creating Applets for Squeezebox. At first this seemed like a simple task, since Logitech has been kind enough to supply both development guide in their wiki and SqueezePlay, a Windows/Linux/Mac version of the remote control software.

But the documentation is really poor. And they are using a patched version of the interpreter that uses a different syntax from the standard Lua parser. This means that you cannot use the lua parser to unit test your functions.

Another issue is that there is no apparent way to address the file system to reference modules. This is a problem because the relative file structure in squeezeplay on windows is different from the actual hardware, so relative references won’t work.

There is no date/time functions available in the runtime, and the only decent library I could find did not work on the squeezebox, unfortunately.

I still had a lot of fun exploring this platform and learning a new language.


Én kommentar on “Using my Squeezebox Remote for traffic information”

  1. [...] This post was mentioned on Twitter by Per-Frode Pedersen, Henning Solberg. Henning Solberg said: RT @perfp: Finally got around to deploying my #squeezebox public transportation applet: http://bit.ly/gyL2wI [...]


Legg igjen et svar

Fyll inn i feltene under, eller klikk på et ikon for å logge inn:

WordPress.com-logo

Du kommenterer med bruk av din WordPress.com konto. Log Out / Endre )

Twitter picture

Du kommenterer med bruk av din Twitter konto. Log Out / Endre )

Facebookbilde

Du kommenterer med bruk av din Facebook konto. Log Out / Endre )

Kobler til %s

Følg med

Få nye innlegg levert til din innboks.

Bli med 140 andre følgere