Python and Weebox

In the last few evenings I’ve been looking at getting Python ready for the Weebox. I’ve been fascinated with using my favourite script language as the front-end for the music player; it’s quick and easy to develop with, and there’s an MPD client library for it already.

Before I ran off all excited about using Python on this rather limited embedded system, I first thought I’d better see whether I could compile up Python for the ARM.

Using the Scratchbox setup (described in Building Things), I unpacked the latest build of Python, configured it up and built. Like so many decent Open Source products it compiled straight out of the box with no issues at all. I still can’t quite get over that, having last really played with Linux and its attendant OS packages in the mid 90s, I still expect a four hour head-scratching session every time I build anything.

Fearful that the executable would be too bloated to use, I checked its size: A stripped python weighs in at 1.1MB, not half as bad as I feared. Admittedly it requires a few other support dynamic libraries; but none that won’t already be on the system. Also, it’ll need the python libraries themselves, which are rather more wieghty at 15MB, but a lot of those can be cut out; indeed I’ll only add the exact libraries needed (using modulefinder).

So, looking good on that front; so until I find a problem, Python’s going to be the way forward. Excitedly, today in my spare time I knocked up a mini Tkinter- based mock up of a 24x2 character display, interfacing with MPD using the client library. With a linux distribution running on my main PC in a VMWare virtual PC, I was coding the Python script on the same PC under Windows. Seems a bit overcomplex, I admit; but none of my real Linux PCs have working sound!

The first thing that became clear with my mockup was that 24 characters isn’t much at all! A fair amount of scrolling will be needed, especially if I want to put some graphic equalizer-type display on the unit too!

Fingers crossed some actual real hardware turns up soon!

Filed under: WeeBox Project
Posted at 21:19:42 BST on 3rd July 2006.

About Matt Godbolt

Matt Godbolt is a C++ developer working in Chicago in the finance industry.