Track and Trestle Technology

Track and Trestle Technology

This suite of applications is designed and developed to support a model railroad using a DCC-EX EX-CommandStation and additional Arduinos, Raspberry Pis or other devices that support the required protocols. The applications communicate using MQTT πŸ“‘. The client apps (🎚️ Throttle App, πŸš† Dispatcher App, πŸŽ›οΈ Dashboard App) publish commands like throttle speed and direction, turnouts, or effects like lights, sounds and signals. The servers (πŸ›°οΈ Deja.js for DCC commands, πŸ”± TTT App for REST API access, and 🧠Action Api for Arduinos and other supported interfaces) subscibe to those commands, process them, and then send them to the appropriate interface. πŸ›°οΈ Deja.js sends DCC-EX Native Commands via Serial over USB to the DCC-EX CommandStation, while the ActionAPI sends serial commands to usb-connected Arduinos.

✨ Features

  • πŸ’„ Beautiful DCC locomotive throttles designed for ease of use
  • πŸ’» Connect to PC/Mac/Linux/Pi via USB
  • πŸŽ›οΈ Control turnouts - servos or momentary relays (Kato switches!)
  • πŸ’‘ Toggle lights, πŸͺ© IALEDs and 🚦 Signals
  • 🎼 Play sounds
  • πŸ›€οΈ Toggle routes
  • ✨ Toggle relays, control motor drivers, juice frogs, control LCDs
  • πŸ‘‘ Rule over your tiny world

🧩 Usage

Prerequisites for all configurations

  1. πŸ“¦ Install & Configure DCC-EX EX-CommandStation via USB to Mac/PC/Linux/Raspberry Pi
  2. πŸ“¦ Install NodeJS 21+ on Mac/PC/Linux/Raspberry Pi
  • Install NVM, Node 21 [Recommended]

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

    $ nvm install 21
    
  1. πŸ“¦ Install Lerna
$ pnpm install -g lerna
  1. πŸ“ Configure Environments

See package README files for configuration instructions.

Run all packages Locally

$ lerna run start

  1. πŸ“¦ Install πŸ›°οΈ Deja.js
  2. πŸš€ Launch 🎚️ Throttle App

Basic Architecture Diagram


  1. πŸ“¦ Install πŸ›°οΈ Deja.js
  2. πŸ“¦ Install 🧠Action Api
  3. πŸ“ Configure πŸ”± TTT App
  4. πŸš€ Launch πŸš† Dispatcher App

Basic Architecture Diagram

  1. πŸ“¦ Install πŸ›°οΈ Deja.js
  2. πŸ“¦ Install 🧠Action Api
  3. πŸ“ Configure πŸ”± TTT App (currently a manual step)
  4. πŸš€ Launch πŸŽ›οΈ Dashboard App
  5. πŸš€ Launch 🎚️ Throttle App
  6. πŸš€ Launch πŸš† Dispatcher App

Basic Architecture Diagram

πŸ“¦ Packages

The Action API listens to commands sent from the 🎚️ Throttle App, πŸš† Dispatcher App or πŸŽ›οΈ Dashboard App and sends or executes those commands on the target interface. Supported interfaces include:

  • Arduino via USB
  • Raspberry Pi Pico W (via MQTT)
  • Audio output

πŸ“œ Read More


React App that handles all layout operations including throttles, turnouts and effects.

Size Limit CLI

Size Limit CLI

πŸ“œ Read More


VueJS app for simple throttle operations.

Size Limit CLI Size Limit CLI Size Limit CLI

πŸ“œ Read More


NextJS app hosted on Vercel. The main purpose of this package is to provide secure REST API access to MongoDB. 🚧 Future enhancements will include landing pages, documentation, demos, and the πŸŽ›οΈ Dashboard App App.

πŸ“œ Read More


Preact app that displays layout information about the DCC-EX EX-CommandStation.

  • πŸͺ΅ DCC Command Log
  • πŸ’₯ DCC-EX EX-CommandStation Status and Stats
  • πŸ“ˆ Current Usage in Miliamps
  • πŸš„ Active Locomotive Speeds

πŸ“œ Read More


🧬 IO

This package contains source code for the devices found in Tamarack Junction - the author's model railroad. These scripts are specific for each device and the connections to those devices. 🚧 Future improvements to these scripts will allow each device to run a single source package and configured using config.h files.

πŸ› οΈ Built With

  • React
  • Node
  • Next
  • Vue
  • Preact
  • MQTT
  • Lerna
  • MongoDB
  • TypeScript
  • Sass
  • Tailwind
  • MUI
  • DaisyUI
  • Arduino
  • Raspberry Pi
  • MicroPython
  • Chart.js
  • Immer
  • Vite
  • pnpm
  • ESLint
  • Prettier
  • Autoprefixer
  • .ENV
  • Webpack