L i n  T r a i n

Model Railway Digital Command Control for Linux

What

Who

Platforms

Download

News

Support

What is LinTrain ?

LinTrain is a DIY model railway control system based around a PC running Linux. The code is distributed under the terms of the GNU General Public License. There is also some hardware involved. Schematics and PCB layouts are available for download, but we don't sell the boards.

There is a rather limited GUI within LinTrain. This owes quite a lot to Brian Ward's tktrain. That was written in TCL and used a command station interface, for which LinTrain includes a replacement. The "native" LinTrain GUI is written in Python, using a set of Python bindings to present the core LinTrain functions as a Python module.

Over time, the original concept of using minimal hardware - a PIC for pulse train generation - and the PC to do all the work, has become less of a benefit. While fully-fledged DCC command stations are still pricey, there are plenty of Arduino-based and similar DIY designs out there which don't need your PC running. Also, they don't need your PC to have a parallel port!

The LinTrain project is gradually morphing into something different from its origins.


Who is LinTrain ?

Currently, it is being developed by Rob Pearce.

Patches, bug-fixes, ideas and code contributions are, of course, welcome.


What Platforms are Supported ?

Linux, like it says. I've erased the evidence of a past life in which MS-DOS was mentioned....

The main bulk of LinTrain compiles on Linux for x86/amd64, using gcc. It includes a kernel device driver module to do the low level DCC stuff, but that has been updated to use PARPORT so it should work on non-PC platforms. At the moment this driver is compatible with 2.6 series kernels and later, although I've only actually tested on a few (2.6, 4.11, 5.6).

There is also some code for the PIC micros used on the various bits of hardware. This can be compiled with Microchip MPASM or the GNU GPASM.

Hardware design began in SeeTrax Ranger but it's all been converted to Cadsoft Eagle now. And yes, I am aware that Eagle is now an Autodesk product but I've stuck with V7.7 as I have a license for that.


Downloading LinTrain

The LinTrain source tree is currently located at SourceForge.

I've done another release (first in 15 years!) with the kernel and Python updates : v0.4

Work continues in SVN. If you have SVN capability, the following will get you the latest sources.

svn checkout svn://svn.code.sf.net/p/lintrain/trunk lintrain
cd lintrain

You can browse our subversion repository here.

SourceForge has further documentation on accessing subversion here.


Recent NEWS

June 5th, 2020 -- Another baseline tarball - v0.4

This one drags the project into the 2010s with support for kernel 5, ParPort, and Python 3. It's also got the GUI updates and the XTrkCAD layout import.

June 2nd, 2020 -- update

Everything's now migrated over to SVN and I've committed the local updates I had. I've also updated the driver to suit modern kernels and the Python module to work with Python3. I should probably do another release...

May 12, 2020 -- update

Wow! If I thought that last hiatus was long... The Covid-19 lock-down has got me tinkering with trains again and I've been doing odds and ends on my local copy of the LinTrain project. As CVS is now read-only on SourceForge, I'm migrating to SVN and checking in the new stuff I've got. It's all a bit "work in progress" at the moment, though.

July 12, 2009 -- update

After a very long hiatus I've started doing a bit more. I was rather busy with other stuff when the PC I was running the railway with expired. Since the rest of my boxes were all on unsupported kernels, I couldn't do much until I had time to sort the driver. That has now been done in CVS (though not much tested yet).
In the mean time, the Python GUI has been enhanced to include an attempt at a layout control panel. Layouts can be loaded from XTrackCAD files, though as yet some of the information required is not available.

May 22, 2005 -- Another baseline tarball - v0.3

With some further work on the GUI, the joystick port throttles, and the accessory decoders, I felt it was time for another "release".

December 21, 2004 -- update on work

The track zone occupancy detector schematics have now been updated, and also ported into Eagle.
The line-of-sight optical detector also had a PCB error (using an input-only pin on the PIC as an output). This has been fixed.
There has been quite a lot of work done on Python language bindings and a TkInter based GUI. It's almost useful now! There's also the beginnings of a decoder programmer application.
Two new bits of hardware have been added, both accessory decoders. One is a cheap four channel low current device suitable for LEDs or lights. The other is a capacitor discharge turnout motor unit. Both designs incorporate some surface mount components so good eyesight is needed.

February 22, 2004 -- update on work

The track zone occupancy detector required a few (fairly small) circuit changes but is now working. Unfortunately the schematics have not yet been updated. Meanwhile I have created a line-of-sight optical detector. Like the zone detector this talks to the PC over a wired-or serial bus, which I am calling the LinTrain Status Bus. The hardware is based on the ISO9141 / LIN automotive standards, though the protocol has a collision detection scheme closer to CAN.

August 30, 2003 -- update on work

There hasn't been much progress on the JNI wrapper, but I have added the work I've done so far on a track zone occupancy detector. I finally got the first prototype PCB this week, so I'm about to start testing it.

January 25, 2003 -- update on work

If you check the CVS repository you'll see I've not been entirely inactive. The interface to "tktrain" is now a little better, some of the compiler warnings have been eliminated, etc. I've also started looking at doing a JNI wrapper to integrate LinTrain into the JMRI project.

October 26, 2002 -- CVS updates

Some minor compiler warnings fixed

June 29, 2002 -- CVS updates

A problem in the kernel module has been fixed, which means it now compiles and works on 2.4.x series kernels (at least 2.4.2 anyway). This is only in CVS as yet.

April 21, 2002 -- v0.2 Released

Although not much changed from V0.1 this release has some bugs fixed. In particular, the following changes have been made :

  • The build process now works out-of-the-box. Previously an important header file was not built first time through. Also the "mtd" application is now built as part of "all".
  • A file buffering bug has been fixed in mtd, which now means the tktrain cabs remain up to date. There's also some added information produced, but this is not used by the standard tktrain system.
  • The tktrain "status" and "accessory" protocols are now supported by mtd.

March 31, 2002 -- v0.1 Released

This is the first public release, and should be regarded as "Alpha test" software. In practice, I've been fiddling with this for a while, so the bulk of the low level stuff is fairly stable. In particular :

  • The hardware is fundamentally sound (as long as it's built right!).
  • The PIC code is fully working
  • The Kernel module has been tested on both 2.2.5 and 2.2.19 and I believe it to be free of serious bugs. It should compile (and work) on any 2.x series kernel but there are no guarantees.
  • The user space applications are all test code at the moment


Support for LinTrain

LinTrain comes with some limited documentation. When that isn't enough, you can find help in the following places:

This Site Hosted by

Webmaster

Last updated: May 24th 2005