Interfacing with external hardware is challenging. The challenge is even more difficult when interfacing with third party hardware. Software engineers are to expect the unexpected.

Backstory

Here’s the backstory behind the SensorTrack™ “filter”.

It’s 2015, High Rail 1.0 was just getting ready to ship. I was doing some final testing one evening and noticed that the SensorTrack™ was unexpectedly transitioning from the “recording armed” state back to the “idle” state.

Basic steps to reproduce with High Rail

  • tap the High Rail app SensorTrack™ “record” button.
  • observe the SensorTrack™ hardware red LED blinking
    • this is the “recording armed” state.
  • start sending commands through the LCS system using High Rail
    • control an engine.
    • read Legacy base.
    • just do stuff that sends commands through to Lionel LCS hardware.
  • observe the SensorTrack™ hardware red LED is off
    • this is the “idle” state.
    • this is unexpected.

My initial thoughts

  • bad cable (could be, but probably not).
  • High Rail is sending a “stop recording” command (very unlikely).
  • there’s a hardware problem (most likely).

I pulled on the “there’s a hardware problem” thread. My goal was to reproduce the issue using nothing but Lionel’s hardware (i.e. the CAB2 remote).

Steps to reproduce using the CAB2 remote

  • push the SensorTrack™ record push button.
  • observe the SensorTrack™ hardware red LED blinking
    • this is the “recording armed” state.
  • start sending commands through the LCS system using the CAB2 remote
    • send “boost” and “brake” commands by rocking the boost/ brake “rocker button”.
    • important: not all commands generate the needed “noise” to cause the issue.
  • observe the SensorTrack™ hardware red LED is off
    • this is the “idle” state.
    • this is unexpected (and has nothing to do with High Rail).

I was correct. The issue was in the SensorTrack™ firmware, and had nothing to do with High Rail.

All I wanted to do was ship High Rail 1.0. However, this particular issue was completely out of my control.

Solution

Next I contacted Rudy at Lionel. Rudy is great. We spent quite a bit of time on the phone going through various scenarios trying to come up with an answer. It was frustrating because some hardware configurations worked flawlessly, while other hardware configurations experienced the issue. Fortunately, Rudy and his team discovered the issue (it was probably a few weeks later).

There’s good news and and more good news.

The good news is that a SensorTrack™ firmware fix will address the issue for all future product runs.

The other good news is that Lionel ended up creating an inexpensive hardware solution for existing SensorTrack™ customers. The solution is a PDI noise filter that attaches to the last hardware component in the LCS PDI module chain.

The “filter” is a capacitor acting as a signal filter on the SensorTrack™ “busy” line. Signal noise from other serial line activity (viz. sending commands through the LCS system) forced the SensorTrack™ to transition from “recording armed” back to “idle”.

Here’s a few photos of the “filter”.

How To Get A SensorTrack™ Filter

You only need one “filter”. Contact Lionel Customer support.

Lionel also published a support document with additional details.

Summary

Expect the unexpected when interfacing with external hardware. Write lots of automated tests; then write more. Find as many external testers willing to help you verify the app. Of course, Apple’s TestFlight is a great way to involve external testers.

I am always looking for new beta testers. Contact me for details.