DCC control, written down properly
Notes from running a model railway on DCC-EX and Rocrail — command station hardware, decoder CVs, network faults and 3D-printed layout bits. Written up as the problems were solved, so the dead ends are in here too.
The six topics
Getting started
What DCC-EX actually is, what you need to buy, and how it stacks up against commercial systems.
Command station hardware
Motor shields, microcontrollers and power supplies — what works, what burns out, and why.
Rocrail integration
Wiring Rocrail to DCC-EX over TCP, running it as a service, and reaching it from anywhere.
Decoder programming
CV tables, speed steps, and the settings that catch people out.
Network troubleshooting
Finding a command station that has moved, and keeping it findable.
Points and accessories
Servo-driven turnouts, and the accessory hardware that hangs off a command station.
3D-printed accessories
Mounts, enclosures and layout hardware printed on a Bambu P1P.
Recent write-ups
All guides →128 vs 28 speed steps (and why it's really 126)
Jerky throttle response and flickering lights mean the decoder and command station disagree about speed steps. Here's the fix.
EX-MotorShield8874 vs the L298N motor shield
Why the classic L298N motor shield struggles with DCC, and what changes when you move to a purpose-built DRV8874-based board.
Finding your DCC-EX command station's IP with avahi-browse
Your command station changed address after a DHCP lease change. Here's how to find it in about ten seconds using mDNS discovery.
Running Rocrail as a systemd service
A systemd unit that starts the Rocrail server at boot, restarts it if it dies, and runs it as an unprivileged user.
Reaching Rocweb from anywhere with Tailscale Serve
Put Rocrail's web client behind proper HTTPS on your own private network, without opening a single port to the internet.