Wednesday, August 16, 2017

A construction update

I've spent most of 2017 adding benchwork to the southeast wall of the section house. It's been a slow grind. Other other things have sucked up my hobby time. Also, because much of the time I'm working on the layout by myself, there's a limited amount that I can do a few hours a week. Anyway, I thought I'd share some progress photos.

So in March I went to Tulsa for the LDSIG/OPSIG weekend where I was asked to present. Of course, I took the opportunity to operate too, including on one of my favorite layouts, Jim Senese's Kansas City Terminal.

Bernie Kempinski was the featured speaker and I was able to get him in a selfie while he was selling some of his great books.

I also operated on Steve Davis' KCS which I first saw when it was in about the same stage my layout is now.

Tom Fausser has a new layout based on a waterfront warehouse district in New Jersey.

By the end of April I had brackets up and the beginnings of an upper shelf.

I needed to remove the track from the section of spline the was completed because the latex caulk didn't work well. You can see the track has come unglued here.

I had a few folks over for a work session including Matt Latham here with Eric Mumper behind him. Did I mention that you can never have too many clamps?

Things were starting to get messy as I added spline.

After the work session I stuck this piece of curved Masonite backdrop in to help give the illusion of a backdrop. This piece was from my old Camas Prairie layout and it's been held together as a curve for the last 14 years or so.

Sometimes you forget to read the fine print in eBay auctions.

With the track in, by the end of July it was time to add some paint to the valence and backdrop.

 I told TJ about how much fun painting was and he couldn't wait to help.

One of the dangers of painting track above your head.

 My resistance soldering iron is my absolute favorite tool for adding drops.

 In August, I started adding foam base scenery.

Unlike most of the US, 2" foam isn't easy to find in North Texas. This came from a company in Lewisville that makes walk in refrigerators. Foam goobers were everywhere.

It does make a very nice flat surface and is super easy to work with a hot wire cutter of a saw. This section is between Lodge Grass and Parkman and will be rolling hills covered in cheatgrass with the north end of the Bighorns in the distance. Below is the Billings yard.

At the end of the peninsula is Lodge Grass. The buildings below are just being stored, but the Billings freight house and TOFC will be at this end of the yard.

I used small pieces of thin Luan plywood as a screw base for the Tortoises and then hot glued the base to the Masonite spline.

As of August 15, this is the state of the expansion. I spent a couple evenings vacuuming up all the drywall dust and foam goobers before I start removing more drywall to support the lower deck.

I need to build a swing out bridge at the door for emergency egress. The upper deck is wired to the west end of Parkman, which is above the turntable. I still need to add two more Tortoises and more foam scenery to give the area a hilly feel. I also need to figure out how to create some photo backdrops of the distant hills and mountains. I'd like to get back to operating, but I want to have track in along the wall on the right so the trains have some place to go past Billings.

Drop me a line if you are interested in visiting. I work on the layout most Saturdays and Sundays in the afternoon and evening.

Thursday, May 25, 2017

Low Cost Wireless JMRI Signal boards with the ESP8266 and MQTT

I want to use this space to present some work I have been doing, along with Gert "Speed" Muller, on using low cost ESP8266 WiFi microcontrollers to control signaling.



In February on the Arduini Yahoo group I got a little carried away when someone suggested that the European MERG boards were the best solution for CAN based signaling. My experience with MERG 15+ years ago was not great and after seeing a couple consecutive posts where buying boards from MERG was the solution given, I challenged the well meant suggestions in a less than tactful manner. I only mention this because that flame-war was the starting point of this project.

John Plocher mentioned using MQTT with a WeMos D2 Mini R2 board to control signals over WiFi using tried and true TCP protocols. While I had heard of affordable WiFi chips becoming popular recently, I never considered using MQTT to control signals, so there was a big learning curve.

MQTT is an Internet of Things (IoT) connectivity protocol. The IoT buzzword is super hot right now and there is a lot of interest in anything that has to do with connecting things to the Internet. Any time there is a lot of excitement around some technology, there is usually some way to apply it to model railroading.

This isn't meant to be an introduction to MQTT, there are thousands of resources where you can get up to speed on that. I suggest going to Youtube and searching for MQTT Tutorial.

The first thing I had to do was determine if JMRI can be made to understand the MQTT protocol. I knew JMRI has the ability to run scripts and a number of examples are included in every version. Because JMRI is written in Java, the creators cleverly decided to include the Jython interpreter with JMRI. Jython allows Python scripts to be run natively in the Java environment and use the JMRI libraries written in Java. This is amazingly powerful and useful in a way that is probably not obvious at first glance. Some basics of Python scripting in JMRI can be found at JMRI: The Python/Jython language.

The MQTT library for Python is called Paho and is from Eclipse. I set an initial goal of getting the library to load without errors, which turned out to be harder than I expected. Here are the steps I had to take to get there.

Many of these steps involve the command line and editing files. I will add a prompt before the command and use a Courier font. $ for MacOS, > for Windows and % for Linux. If text is added or edited, I will use blue.

Starting with MacOS.
  1. Download latest jython installer from http://www.jython.org/downloads.html
  2. $ java -jar jython-installer-2.7.0.jar to install jython in ~/jython2.7.0
  3. $ ~/jython2.7.0/bin/pip install paho-mqtt
  4. Copy /Volumes/Macintosh\HD/Applications/JMRI/python.properties to ~/Library/Preferences/JMRI
  5. Add the following to ~/Library/Preferences/JMRI/python.properties python.path=~/jython2.7.0/Lib/site-packages                                                            python.startup =
  6. Change lines in ~/jython2.7.0/Lib/site-packages/paho/mqtt/client.py file from listensock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_IP) to listensock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) as discussed here.
  7. Add import paho.mqtt.client as mqtt to the top of a generic python script
  8. Run script and look for errors in console
  9. After script runs, check that the python.path is correct under Help -> Context...
In Windows.


  1. Download latest jython installer from http://www.jython.org/downloads.html
  2. > java -jar jython-installer-2.7.0.jar to install jython in C:\jython2.7.0
  3. > C:\jython2.7.0/bin/pip.exe install paho-mqtt
  4. Copy C:\Program Files (X86)\JMRI\python.properties to C:\Users\username\JMRI\
  5. Add the following to C:\Users\username\JMRI\python.properties (had to escape out backslashes and dash with JMRI version 4.7.2 )
  6. Change lines in C:\jython2.7.0\Lib\site-packages\paho\mqtt\client.py file from listensock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_IP) to listensock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) as discussed here.
  7. Add import paho.mqtt.client as mqtt to the top of a generic python script
  8. Run script and look for errors in console
  9. After script runs, check that the python.path is correct under Help -> Context...
In Ubuntu 16.04.
  1. Download jython-installer-2.7.0.jar
  2. % java -jar jython-installer-2.7.0.jar and install jython in ~/jython2.7.0
  3. % ~/jython2.7.0/bin/pip install paho-mqtt
  4. Copy <JMRI_FOLDER>/python.properties to ~/.jmri/
  5. Add the following to ~/.jmri/python.properties python.path=~/jython2.7.0/Lib/site-packages                                                            python.startup =
  6. Add import paho.mqtt.client as mqtt to the top of a generic python script
  7. Run script and look for errors in console
  8. After script runs, check that the python.path is correct under Help -> Context...
So, the key to these instructions is that you have to install Jython. then you have to install Paho so Jython can find it. The reason for editing the python.properties is described here, at first it wasn't right, but I posted a note to the JMRI Yahoo group and it was updated. Thank you to the editor. Basically, you have to install the full version of Jython that can have libraries added to it. The standalone version that is shipped with JMRI can't be extended like this.

I found a bug pop up in the paho library, luckily some Google foo found a solution as noted above. We'll get more into the Python code for handlers, etc., later but any of the examples in the Python Examples directory can be used to test that you have installed everything correctly.

Next time we'll talk about the ESP8266.

Wednesday, March 1, 2017

A New Year, a New Post

It seems like most of my model railroad projects haven't really been out in the section house. After the Plano train show in January, I traded some unsold locomotives and freight cars for some Walthers, Rapido and Balboa passenger cars. I am starting to build a pretty decent North Coast Limited and Mainstreeter, but I need dome cars for the NCL and more baggage car or mail storage cars for the Mainstreeter.


My next big project is to add benchwork along the southeast wall. This will allow me to have train continue past Billings and add the Sugar Factory on the lower deck and add Parkman, the top of the grade, on the upper deck. This is what it looked like at the beginning of February.


The blue backdrop is all that remained of Shane's layout, I took it down and salvaged what I could.


You might remember the trouble I had finding studs with the stud finder. At some point over the winter I removed a chunk of drywall and discovered the reason is because the 5/8" sheetrock is offset from the studs by 1x4 material, adding 3/4" of air in most places. My solution was to buy some 5/8" plywood, screw it to the studs with more 1x4s and attach brackets to the plywood where needed. Removing the 9" wide strip of drywall with a circular saw was a horrible, messy ordeal, but it made for nice clean edges. Oh, and did I mention the mud daubers in the wall? Luckily it was winter, but not a very cold one.


With the first strip of plywood up, I was ready to add brackets and fascia.


I started by adding heavy duty shelf brackets upside down and attaching pieces of 1/2" plywood underneath with short screws that still poke through, but they can be ground off.


By the end of February I had the fascia extended around the new section and the bottom painted white. I could finally stack some junk on top of it and get it up off the floor.




Saturday, December 31, 2016

Holiday update

I took a couple weeks off after the DFW Interchange but one thing that was nagging at me was the lack of staging. I remember reading that my SP&S buddy Bob Willer in Kansas City had written a short article in Model Railroad Planning a while back describing his battleship staging yard. This is portable staging yard that can be moved around as needed. I decided something similar was in order.



Starting with the 4 dominoes from the switching layout that Matt Latham and I built for the 2013 LSR convention in Irving, I started working on a staging yard ladder that takes off from the end of the layout near the Yellowstone River bridge. The staging yard track is also salvaged. I used Altas #6 switches from the old layout and Micro Engineering code 83 flex track. The old switching layout had 1/2" Homasote covering it.



A couple weeks later, another domino and more track. I wasn't working on the layout ever night like I was leading up to the DFW Interchange.


By the second week of December I had use all four dominoes and all the track from the switching layout, but a test showed is wasn't quite long enough. Oh, and I had wired the lead so that trains didn't stall out.


By Christmas, I was able to show my mom my layout progress. A lot of changes since she had seen it.


By the end of December I had added a 5th domino and had all the track in, making the staging yard 20 feet long. It will be interesting to see how I move it.

Monday, October 31, 2016

October fun

In October I had all the switch machine controllers installed and was ready to put fascia on the lower lever. This is necessary mainly to keep things from falling on the floor. I had already lost a brand new sound-equipped Rivarossi U25C, which wasn't pretty.


I cut slots in the masonite in where gaps between the buildings will be. I will eventually add brick to the track side to represent buildings. These will really only be seen if you look over the fascia, but it will give the effect of looking thru a canyon of buildings that you get when you are in Billings.


A little paint gives the facia a clean look and ties the fascia together with the valance.




We cut some vinyl signs on the Cricut.


The first operators on the layout were Peter Bryant from Houston and John Emerson from Amarillo. They were two of the 35 or so out of town guests to come up for the 2016 DFW Interchange operating weekend. Speed Muller is on the other side of the peninsula, but he didn't count since he was a local. Actually, Speed was a big help getting the switches plugged into JMRI.


The next day David Perkins and his girlfriend Pheriche from Baton Rouge operated the last session of the DFW Interchange. The night before, the third operator decided he couldn't read HO scale car numbers and went home. Pheriche has a Kindle Fire tablet in her hand throwing the switches. The tablets will eventually be mounted on the fascia at eye level.

Saturday, October 1, 2016

September Update

In September I was still preparing for the DFW Interchange, but that didn't keep me from taking a trip to Washington, Idaho, Utah, Wyoming and Montana.


I started by flying into Spokane and picking up a Wyoming economy car. So much for a Toyota. At least it had Oregon plates... the only Northwestern state I wasn't driving thru.



First stop out of Spokane was Salt Lake City, UT for Great Basin Getaway. Yes, there is a plan to my madness. I knew it was going to be a good weekend as I was following the Northern Pacific and Milwaukee Road Mainlines thru Montana and these double rainbows ended on the double tunnels at Revenna.

I've attended 5 Great Basin Getaways over the lasts 14 years and each time I have operated on Ted York's Cajon Pass and Gary Peterson's Great Salt Lake.


All 5 times on Ted's layout I have been in the yard, although I've never had the yardmaster's job.


I worked this town on Gary Peterson's layout. This didn't even exist the first couple times I operated with him He did a massive reconstruction 10 years or so ago and this area is all new.



This is the first Great Basin Getaway that I didn't get to operate on Lee Nicholas's fantastic Utah Colorado Western, but we did go out and see Lee's expanded layout where he moved his mole operation and added this scene. I fell in love with his sugar factory.


The reason I didn't get to operate on Lee's layout is that I had requested to operate on rob Spangler's Western Pacific and it didn't disappoint.



Next day, on to Wyoming. I didn't see one damn train thru the canyon while in Utah, but once I crossed into Wyoming I did catch some traffic. Here we see the east main above the west main. I thought about stopping here to pick up a used car but I had a schedule to keep, I was headed for Sheridan.


They have done a great job turning the roundhouse in Evanston into an event center.



Every since operating on Michael Borkon's in Kanas City I've been excited to get back to Green River. It is an amazing place to rail fan. Too mad I'm only about 70 years too late for the big steam.

I planned on spending a whole day photographing around Sheridan and Gillette and another day between Sheridan and Billings. Of course, not only was the weather crappy, but trains weren't running.



The yard at Donkey Creek near Gillette had hundreds of locomotives stored because of the slow down in coal. I couldn't get an angle that showed them all at once, but here is a bunch next to the highway.



What would a trip to Wyoming or Montana be without catching some 737s heading to Seattle. These were sitting outside Laurel waiting to get into the yard.



I got up early the next day to see what was going on before heading to Wallace, ID for the Northern pacific Historical Association's annual convention. The weather still sucked and it was raining, but I did see more 737s, this time in Billings next to the old coach yard.



The sun started shining some by the time I made it to Garrison, MT where the BNSF still operates from here to Butte while Montana Rail Link has a lease on the NP main from Billings into nearly Sandpoint, ID.



The Wallace convention was a lot of fun and I really enjoyed the week in Northern Idaho. A couple highlights were a trip up the canyon to Burke, which is just a shadow of its former glory.


We also had a guided tour over Lookout pass between Idaho and Montana including this spot where famous S bridge trestle was located. The trestle was famously taken out by a slide with a train on it, which was well documented in photographs.