Puckdropper's Place Logo

Main Page | Pictures | Blog
DCC: GP9M Decoder Installation | JMRI on PowerPC
Construction: Painting Track | Module Construction | Module Design

Introduction

This guide will guide the reader through the process of configuring an iBook to run JMRI via Linux for Power PC. This guide covers several steps, including installing Java for Power PC on Debian Linux, acquiring and installing the libraries JMRI requires to run properly, and finally installing JMRI itself.

Detailed Introduction

JMRI is software that controls several different interfaces between model railroad Digital Command Control (DCC) systems and a computer. Many interfaces utilize a 9 or 25 pin serial port, a hardware feature that is quickly disappearing in favor of USB ports. As a result, the interface devices are being updated to support USB. An example of this is the Digitrax MS100. The MS100 uses a 25 pin serial port to connect to a computer and a Digitrax Loconet interface to connect to the DCC system. Updated models such as the Digitrax PR3 utilize USB to connect to the computer and include a MS100 emulation mode.

The interface device is a Digitrax PR3 programmer, connected to an Apple iBook. The iBook is an older Macintosh laptop with a G3 PowerPC processor. The operating system installed on the iBook was Mac OS X 10.2, which has been unsupported by Apple for some time. JMRI requires a more recent version of Java than what is available for OS 10.2, so an operating system upgrade is required. Due to its free and supported nature, Linux was chosen over OS X 10.3 or OS X 10.4.

The Debian distribution of Linux was chosen, as it was available for PowerPC and could be installed on the machine. Java was then installed, along with the JavaComm library. Once these software installations were complete, JMRI was installed.

Technical Requirements and Cautions

This document assumes the user is familiar with Linux commands, and specific operations including:
1) Moving and copying files
2) Setting file permissions
3) Extracting files from archives
4) Editing text files

Parts of this document may require root access. The process itself may not require root access for installation in other locations.

This document is intended as a supplement to the installation instructions for the various components, and is not a replacement for them.

Upgrading to Linux

There are several distributions of Linux that support the PowerPC processor. The two most notable distributions are YellowDog Linux and Debian. YellowDog Linux would hang upon loading the installation program, so Debian was installed.

An unfortunate effect of installing Linux on a Macintosh is there are not yet free software to resize the partition Mac OS is installed on. This means the only way to install Linux is to delete the Mac OS partitions (and with it the OS X installation) and begin again. This process is covered in the clear and well written Debian installation instructions.

When the system is ready for the Debian install, the installation CD (or DVD) is placed in the cup holder--uh--CD ROM drive and the system booted. As soon as the chime is heard, the C key on the keyboard is held down until the system boots off the CD. The installation process guided the user through the installation with relative ease and efficiency.

Installing Java and JavaComm

This is where the installation process got difficult. The problem comes from the PowerPC processor the Mac uses. Sun Microsystems, the company that produces Java, provides a limited selection of versions of its Java Runtime Environment, and the PowerPC on Linux is not one of them. Fortunately, IBM (one of the producers of the PowerPC chip) provides a version of both Java and the JavaComm library for Power PC machines running Linux.

The version of Java is the user's choice, but the JavaComm library cannot be later than 2.0. Hint: Registration is required, and IBM asks for more information as you download parts of other versions of the Java run time. Try J2SE 5.0 first, and see if you can get both the required JavaComm library and the version of Java you need.

Java

Java from IBM can be acquired from:
http://www.ibm.com/developerworks/java/jdk/linux/download.html (registration required)

This installation used Java 6 and the JavaComm from J2SE 1.4.2.

Installation of Java proceeds thusly: The downloaded files are extracted and then moved to their permanent location. The instructions use /opt/ibm/ibm-java-ppc-60/ for Java 6, so this document will too. Java is used from a terminal window, so the bin and jre/bin directories are added to the PATH. For my convenience, the following line was added to my .bashrc file:

export PATH=/opt/ibm/ibm-java-ppc-60/bin:/opt/ibm/ibm-java-ppc-60/sdk/bin:$PATH

The terminal window was closed and reopened to read the new path information.

Java requires libstdc++5 to run, so it was installed using the Synaptic Package Manager.

Testing the Java installation was done by issuing the command /java -version/ and observing the results. If the results were a version number, Java was installed properly. If an error message occurred, the error had to be corrected first.

JavaComm

JavaComm can be downloaded from the same site as Java:
http://www.ibm.com/developerworks/java/jdk/linux/download.html (registration required)

JavaComm is installed by extracting the archive and copying the files to DIFFERENT locations than specified in the archive.

Archive -> Destination
jre/bin/libibmcomm.so -> /opt/ibm/ibm-java-ppc-60/jre/lib/ppc/
jre/lib/javax.comm.properties -> /opt/ibm/ibm-java-ppc-60/jre/lib/
jre/lib/ext/comm.jar -> /opt/ibm/ibm-java-ppc-60/jre/lib/ext/

The execute bit must be set on libibmcomm.so. If it is not set, it must be set: chmod +x libibmcomm.so

Installation of Java and JavaComm is almost complete. To use USB with JavaComm, the javax.comm.properties file must be edited. At the end of the file, there is a line that states "# Uncomment the following line to enable USB-serial devices". The line is uncommented (pound sign deleted) and the ttyUSB= is changed to ttyACM=.

More on USB (optional)

The computer interface device used is a USB serial device. Not every Linux distribution refers to them the same way, so you may see devices such as ttyUSB or ttyACM. To find the way Debian referred to the USB serial device, the device was plugged in and the dmesg command was issued. At the end of the output, there was a message referring to a USB device that wasn't a modem on ttyACM0. That's why the line in the javax.comm.properties file is changed.

Installing JMRI

JMRI can be downloaded from:
http://jmri.sourceforge.net/download/index.html

To install JMRI:
1. Download the Linux version
2. Extract the files to where you want them
3. If desired, set the execute permission on DecoderPro, InstallTest, JmriDemo, LocoTools, and PanelPro scripts. (chmod +x DecoderPro)

Running JMRI:
1. Plug the interface device (Digitrax PR3) in before running JMRI.
2. Start the program by executing the DecoderPro script. (sh ./DecoderPro)
3. To configure JMRI, select the interface device and the COM port that connects to it. If you don't know which COM port to use, try the last one first.

Conclusion

The installation of JMRI was a fairly simple process once Java and JavaComm were installed. The installation took about a day and a quarter, as the resources had to be located. With a working Linux system, installation will probably take an hour or two.

Links

Debian Linux
Digitrax PR3
JMRI
Java for PowerPC from IBM

Home Creative Stuff Model Railroad Ice Rink Computers message board Site Updates