Traintap, an EOT freight train parser/monitor

Living 100m down the street from a freight line means you (and the kids you raise) automatically become train enthusiasts. As my 7 years of living in this house comes to an end, I have had many daydreams of various nerdy “there’s a train going by” sensor schemes: A/V machine learning, accelerometers to detect the vibrations, but the only one I’ve actually gotten around to dabbling with is radio: EOT train signals.

A few years back I did a multi-week study with a couple of SDRs monitoring the trains passing by, using SoftEOT, a Windows app. The data isn’t much to look at but I learned a lot. The setup was half the trick; you have to join and get approved for a private groups.io group, set up your SDR receiver filter, set up a virtual audio device, realize you aren’t running Windows, figure out Windows, get the software to run, and only then can you play with the data.

Train Signals

Union Pacific trains by me use End Of Train devices which basically replace the need for a caboose – a primary need of which is to regularly tell the locomotive “hey I’m still here, we haven’t disconnected.”

One big caveat with this: not all railroads use these devices anymore, and I’ve also found that my commuter Metra trains do not use them. I’ve yet to find any reliable radio source to detect a Metra train pass!

Tapping into the signal

I wanted an easy way, using an RTL-SDR, start capturing packets and see what you can see. My real goal is just to figure out how many trains are going by. Enter traintap, my AI-coded simple app just for this: plug an SDR into a Linux computer, attach a 70cm antenna, and start the app. Assuming you capture some data, you’ll get a nice dashboard showing you the overview of what you capture:

traintap runs a simple, read-only web interface which gives you about all of the stats you can get out of these packets.

It is open source, GPL3 licensed to maintain compatibility with other projects from which Claude Code learned from.

As long as I’m living here, you can view my live dashboard at: https://traintap.yellow.v9n.us/

Starting prompt

It started as a pretty simple prompt to Claude Code. I plugged a spare SDR into my dev box and said:

Check out this RF signal; https://www.sigidwiki.com/wiki/End_of_Train_Device_(EOTD)

I have trains which go by my house and emit EOT and HOT signals. I have an RTL-SDR I can dedicate to the task. Can we write some kind of simple CLI process for Linux, perhaps based on PyEOT, which captures and decodes these signals? There’s a question of architecture – should we use an RTL I/Q stream natively, or perhaps use KA9Q-radio? Is it possible to “scan” between the HOT and EOT frequencies to try and get packets on both?

The rest followed pretty naturally and my biggest challenge was my own assumption that I was so close that antenna placement didn’t matter (it did!)

Summary

I will only be living near this train line for another month or so, so odds are I won’t maintain this forever – but pull requests and forks are very welcome. I’m always happy to talk trains!

EOT packets don’t tell you much about the train that is going by. I wish it would tell me fun things like the number of cars, the destination, etc but that’s not what it’s for.

It would be a cool project to get a handful of sensors along a line to predict when different level crossings will be closed. If anyone ever tries this, let me know!

This entry was posted in Uncategorized. Bookmark the permalink.