Skip to main content

I have pushed PyTrain up to PyPi, the Python package publication site. Clicking this link will bring you to the page and give you information on how to install and use the software. This should be considered an alpha-quality release, as I have been the system's only user and have only run the system on 2 layouts; my actual layout in New Hampshire and our apartment in Boston where I have a Base 3 and 4' of track . That said, if you are comfortable with Python and Linux, and know that a Raspberry Pi isn't a dessert treat, it's ready for folks to have a look

Without duplicating the information on PyPi, PyTrain does many things. I wrote it to let me build physical control panels to run my layout. My first prototype is shown here. The development thread I started in August, 2024 describes the development ad feature additions.

PyTrain is designed for layouts that use Lionel TMCC and/or Legacy engines and components, and that have a Base 3 (or possibly an LCS W-Fi module) and an LCS Ser2 module. Although you can use PyTrain without a Ser2, you won't have full visibility into your layout without it (until such time that the Base 3 broadcasts all TMCC and PDI activity to attached devices). It is fluent in the entire Legacy Command Protocol, and can send all published commands to TMCC and Legacy hardware. It is currently limited to 2-digit TMCC ID/addresses, but I've begun work on the new 4-digit capability as well.

What are some things you can do with PyTrain out of the box?

  • build control panels to operate your layout and display real-time state, regardless of where the state change originated (Cab2, Cab3, other software, PyTrain, etc.)
  • control Sensor tracks and cause your engines to actually go to "normal" or "slow" speed when an IR-equipped engine travels over them
  • control all aspects of your layout from a terminal window via the PyTrain CLI
  • maintain real-time layout state across a network of Raspberry Pi computers (idea is each control panel will have it's own Pi)
  • download and get real time information on your train/engine/switch/accessory roster, including engine speed, direction, rpm, labor, momentum, brake, switch state, accessory state, etc.
  • echo and decode TMCC and PDI commands in real time
  • build custom software that respond to real-time changes on your layout
  • build custom software that introduces elements of randomness (horns, dialogs, actions, etc)
  • and much more!

PyTrain is being released as "open source" software and is free to download and use as you please. The software is being released under the GNU Lesser General Public License, V3.0. You can not use this software to build a commercial product!

I am not in a position to provide extensive user support, as I am simply a guy in his train room. That said, I will try to use this thread to help as I can. For example, I won't have the time to explain how to provision the SD card you need to boot up a Raspberry Pi, or how to open a terminal window on Macs or a cmd windows on PCs, and, if you don't know what these terms even mean, this software isn't ready for you yet (and that's ok!!)

I have a lot more documentation to write, especially for developers that want to extend PyTrain to other uses. I also need to do more testing on the helper classes I've built to control Lionel's operating accessories. My support for 2-axis joysticks also needs more testing, and there is a new version of a Rotary Encoder drover I have to put in place. I also need to document how to connect I2C LCDs, Matrix Keypads, A2D boards, and GPIO port expanders. I intend to do some of this when I build my first round of physical control panels; one to control a Legacy gantry crane and the yard it's in, and another that lets you key in an engine or train and control it like you can on a Cab 2 or Cab 3. That software has been developed and even tested, but there is no documentation at all for it.

So with that, good night, good luck, and enjoy!

  -- Dave

Last edited by cdswindell
Original Post

Add Reply

Post
×
×
×
×
Link copied to your clipboard.
×
×