This website was originally written in Ruby and hosted on the Raspberry Pi. It's now archived at GitHub for posterity!

Using the Palm m500 as a Raspberry Pi LCD

If there's one thing that everyone agrees would be a cool addition to the Raspberry Pi, it's an LCD. There are plenty of breakout board endowed LCDs on the market in a variety of styles, sizes, resolutions and capabilities... but I, for one, found myself a little overwhelmed by the choice.

Enter the Palm m500. I had one knocking around, it has an LCD. Surely I could work with this?

Incidentally, it was easier than I thought. Once I'd cast the idea of gutting the m500 for its LCD and attempting to bitbang it to life, or find a datasheet somewhere online telling me how to use it directly, I found a handy little PalmOS app called PalmOrb.

PalmOrb makes your PalmOS device emulate an LCD. A Matrix Orbital LK204-25 LCD to be specific. This is a serial LCD, but fortunately can be used with USB using your Palm dock to make things easier.

Setting up is as simple as downloading and installing PalmOrb on your device, firing it up, picking USB mode in the settings and then finding your favourite LCD driver to send it data goodness.

To drive the Palm running PalmOrb I chose lcdproc, installing it is a simple "apt-get install lcdproc" away on Debian, and configuring isn't much trickier. Following the instructions on the PalmOrb page I got everything up and running in a jiffy. I used /dev/ttyUSB1 which was one of the two entries to appear when the Palm is connected. Using /dev/ttyUSB0 seemed to crash PalmOrb.

Finally, I ran lcdproc with a command like "lcdproc C M L G D U K". The end result is this:

Okay, it's not very impressive, but it's a cheap and easy way to get a status LCD connected if you have a spare PalmOS device and USB dock kicking around. For the more enterprising of hacker, PalmOrb also supports data over IR and Bluetooth, the latter potentially allowing a nice wireless status monitor

There is another way to get this sort of setup. If you've got a spare old phone, tablet or iPod touch then you can set up a status monitor similar to mine and simply open it as a webpage on your device. Easy as pie wireless LCD output! You could even stream an image or framebuffer capture if you're feeling brave.

For those who want to persue the latter option, here's the messy code I use to get system stats in my Ruby websocket service:

def self.get()
    @diskinfo = `df | grep rootfs | awk '{print $2,$4,$5}'`
    @diskinfo = @diskinfo.split(' ')
    @diskinfo_size = (@diskinfo[0].to_f / 1024 / 1024).round(2)
    @diskinfo_free = (@diskinfo[1].to_f / 1024 / 1024).round(2)
    @diskinfo_perc = @diskinfo[2].sub('%','')

    @cpu_perc = `vmstat | awk '{print $13}'`.split("\n").last

    @mem	  = `cat /proc/meminfo | grep Mem | awk '{print $2}'`
    @mem_total= (Float(@mem.split("\n").first) / 1024).round(2)
    @mem_free = (Float(@mem.split("\n").last) / 1024).round(2)

    @mem_perc = ((100/@mem_total)*(@[email protected]_free)).round.to_s

    @uptime = `uptime`.chomp.to_s.to_s.sub('load average','load')

« Back to index Posted on 2012-06-21 by