BrickOS on Ubuntu 10.10 Maverick Meerkat
April 27th, 2011 | by Sean |BrickOS was an integral part of some work I did many years ago and I’ve been trying to dig the code up recently. It seems as though it fell out of the Ubuntu repositories some time ago (in as legos before the name change), so I’m currently installing the source package from the BrickOS sourceforge repository.
I followed the BrickOS installation instructions. Binutils was downloaded from packages.debian.org (stable/squeeze). Ubuntu Software Centre reminded me that the package was available from normal software channels – but I tried that first and failed! Next up, gcc-h8300-hms (stable/squeeze), also installed via Ubuntu Software Centre.
Attempting to ‘make install’ the BrickOS source at this point got me a “Error: invalid operands” fail, but a search turned up a lugnet comment by ‘Kyle’ who had the same problem and posted a link to his own notes on how to install BrickOS. He used a patch by Jochen Hoenicke to fix the problem. I used ‘wget http://hoenicke.ath.cx/rcx/brickOS/brickos-gcc33.diff’ in the BrickOS source directory to download the patch and ‘patch -p0 < brickos-gcc33.diff’ to apply it. After applying the patch ‘make install’ finished without error.
The next problem is that none of my current PCs have a serial port! I have some USB-serial adapters that work a treat with some other hardware. According to /var/log/messages (watched with the Log File Viewer from the System..Administration menu) my serial port is ttyUSB0. The installation notes tell me to issue the command ‘export RCXTTY=/dev/ttyUSB0’. The first attempt at using firmdl3 got me no result at all, it just sat there apparently doing nothing. I got much the same response from the ‘dll’ command. Not sure what might have been going on, I installed a serial terminal emulator (gtkterm / moserial) and connected to the serial port. A few random keypresses later, I spotted the green LED in the lego IR tower lighting up and some kind of data being sent back to the serial terminal. firmdl3 and dll both seemed to work just fine with the tower after that.
The last step is to try communicating with my 2 RCXes which have been languishing in a box for 6 years. I’ve a feeling at some point in the past when I had access to more RCXes, I may have ended up with mis-matched IR towers. I have one RCX2.0 and one RCX1.0 – I have old pictures of the 2.0 in action, but couldn’t connect to it with either of my IR towers. I successfully uploaded BrickOS and the helloworld demo to the 1.0 though, even if the RCX1.0 took a lot of cell-rolling before it would even switch on (both rechargeable cells and contacts were corroded).
So I’m rolling on RCX1.0, BrickOS and Ubuntu Maverick Meerkat – time to make some progress! Not sure what to do with the RCX2.0 – it’s going back in the box for now until I can work up the motivation to probe the problem in greater detail.