Java Psion Link - post-mortem

Quite some time ago I started a project to create a Java version of PsiWin. This project was Java Psion Link.

A little background

PsiWin was the bit of software that Psion provided to communicate/sync/convert files between a regular PC and their (now defunct) PDAs - such as the 5mx, Revo and netBook.  You connected your Psion to your PC with a serial connection (RS232) and could then treat the Psion like a disk on your PC.  You could navigate the Psion's file system just like any disk and transfer files.  In addition you could use PsiWin to open and convert Psion's native/custom files in normal Windows applications.

I myself owned a netBook and really enjoyed having it. It was a really small laptop that I could carry around with me easily. It even came travelling with me and had enough power to let me noodle around writing compilers and all sorts on the road. In retrospect it was a bit pricey, but it was still a wonderful machine. I've been eyeing up the EEE PC in the hope that it'll make a good replacement for my netBook. Though I'm probably going to wait for the bigger screened version to come out, as then it'll at least have the same screen size. Shame there won't be a touch screen on it...


There is still quite a thriving Psion community out there - well over five years since the last Psion rolled off of the production line.  People loved their Psions and rightly so.  These were fantastic machines, that unlike other "PDAs" were fully functioning computers and weren't totally reliant on having a PC to act as a mothership.  In fact saying "people loved their Psions" is probably the wrong tense - people still love their Psions and continue to use them.   Even now I'll still have the occasional mail about using JPL and looking at the sourceforge site shows people are still downloading it.

Version 1.0

So the one main problem I had was that I had an iMac, running MacOS 9 and PsiWin would only work on a PC.  This was around 2000.  There was a Mac version called MacConnect, but it only handled file transfer and came on a 3.5" disk.  My iMac didn't have a 3.5" disk drive and didn't feel like having to buy MacConnect (when PsiWin was free with the Psion) _and_ have to buy a USB disk drive.  So for quite a while I persevered with using the Comms app on the Psion to transfer files directly over a USB serial port adapter, as well as transferring files via compact flash (CF) disks.

Then I stumbled on some reversed engineered documentation for the "Psion Link Protocol" (PLP).  Without that documentation I would never have started writing JPL.  Even with this documentation it was quite a lot of hard work getting everything going.  I did finally get my head around hexadecimal notation.  Not bad for someone who'd done AI and no regular CS at uni.

Version 1.0 of JPL more or less worked, but was a bit flaky.  It'd crash and bring down the VM and sometimes even the mac itself!  It also suffered from being a bit of a hack job - I wrote enough to get it working, but didn't really go back and rewrite things and refactor.

Still I put it online and had a few people downloading it and then started getting mail about it.  There's a lot to be said for having people actually using your software - even if it is a bit flaky and needs some work!

However at about that point I took a year to go travelling in Australia, so development on JPL ground to a halt.  I did have the netBook in tow though and had got a java compiler working on it.  So with that and a gsm modem vaguely kept my eye on things.

Version 2.0

I started coding version 2 of JPL in a bar in Ko Pha Ngan on the netBook itself.  I couldn't run the code of course, but I was able to get a lot of the structure down and compile the code.  In fact the code I wrote then still lived on, though greatly modified, into the version of JPL 2 I finally released.

I created myself an API for the Psion Link Protocol to code the GUI application against.  I was able to create input and output streams to write to individual files on the psion, so I could treat it like it's own file system.  It took quite a bit of effort to make that happen, but it greatly simplified writing the overall application. I was effectively writing my own library for accessing the psion and also writing an application to use that library.

Of course I never quite achieved the level of separation I'd have liked.  In retrospect I wish I'd actually treated JPL as two projects.  I could have then released the library for other developers to use and then coded the GUI like I was a user of the library.  Hopefully this would have meant the core library would be quite small and focussed.

Another thing I wish I had done was to have actually made use of unit-testing in JPL.  At the time I had no real experience of unit-testing, but since then have come to realise how useful automated tests can be.  It would of required a fair bit of thought in some places though.  Programming in Java would have required me to carefully consider how to mock-up a serial port and so on - no monkey patching to get you out of jail in Java!

At the time though Java was a pretty good choice for me.  The language is receiving quite a lot of flak nowadays, but I'd spent two years previously chained to a C++ compiler.  Java by comparison was markedly more productive.  Plus it meant that I could get JPL running on the Mac, Windows and Linux.  The much vaunted "write once, run anywhere" paid off in my case.  Which is not to say I could just ignore platform differences, but it meant that the app was essentially functional on the three major platforms with little extra work.

As my main development platform was a mac I spent extra time exploiting some of the extra features of the mac's java runtime (MRJ).  This meant that JPL was able to better act like a regular mac application.  By using java's reflection api I only had to create one version of the code.  JPL would detect whether certain classes were available and if so expose extra features to the user.

The real-world

JPL was for the most part a hobby project.  I did get donated a Revo and a 5mx for testing and a little bit of funding at one point.  This helped get at least one more release of JPL out, but in the end the real-world got in the way.  In particular I started my MSc.  Though I was able to spend some time working on JPL during this period I couldn't really spend too long on it.  Taking out a career development loan to fund your further education does kind of sort out your priorities like that!

I also found that I was using my netBook less and less, so JPL itself was not as useful to me.  So like many open source projects, once I lost interest the incentive disappeared and work ground to a halt.  Which is not to say anything would have been different if I'd been running JPL as a commercial project.  I'm not sure there would have been enough users to have supported the cost of extra development.

Still it was an interesting project to have worked on.  It represented my first real "large" project outside of work and academia.  Since then I've always felt a need to have something I'm working on in my spare time.  Something to hone my skills with.  JPL was very useful for keeping my knowledge of Java up-to-date.  Now that I'm mostly coding in Python at home, having little side-projects is a great way to get some extra experience.  The trouble with most day-jobs of course being that you actually have clients and deadlines - so exploratory coding often goes out the window.

There's nothing quite like trying to create something useful on your own time.  Writing software from beginning to end by yourself can give you insights that you might otherwise never get.  I'd thoroughly recommend it.