Skip to main content
DEJA IO

Beyond the Throttle

DEJA.js isn't just a throttle — it's a full layout automation platform. IO devices let you control turnouts, signals, lighting, sound, and sensors from the same apps you already use to run trains.

Connect an Arduino over USB for wired reliability, or a Pico W over WiFi for wireless flexibility. Configure everything in the Cloud app, then control it all from the Throttle — no code required.

Video walkthrough coming soon

Make sure you've completed the Getting Started guide — your server should be running and your EX-CommandStation connected.

How It Works

DEJA.js connects your browser to your layout hardware through three communication protocols — each optimized for different setups. This is the same diagram engine used in the Architecture Guidedocs, so it always matches the platform's real topology.

DEJA.JSDEJA IOThrottleCloudMonitorDEJA ServerDCC-EXEX-CommandStationArduinoESP32Pico WWLEDLightRelayServoSignalSensorSoundPowerLEDLightLED StripTrackDEJA.js platformDEJA IO devicesDCC-EX (3rd party)Connected peripherals

Choose Your Protocol

🔌

Serial USB

Direct & reliable

DeviceArduino
LinkUSB cable to server
SpeedLowest latency

📡

MQTT over WiFi

Wireless & scalable

DevicePico W
LinkWiFi to MQTT broker
SpeedLow latency

🌐

WebSocket

Real-time & flexible

DeviceAny networked device
LinkTCP port 8082
SpeedPersistent connection
Supported Hardware

Ready-Made Devices

🔌

Arduino

Serial USB · Wired

🔧PCA9685 servo control for turnouts & signals
💡Digital outputs for LEDs & accessories
🚦Multi-aspect signal heads
📟Sensor inputs for block detection
🧠

ESP32

Serial USB or WiFi MQTT

🔀USB serial mode — same wiring and sketch as Arduino
📶WiFi/MQTT mode — wireless placement anywhere on the layout
🔧PCA9685 servo control for turnouts & signals
💡Digital outputs for LEDs & accessories
📡

Pico W

MQTT WiFi · Wireless

📶WiFi connectivity — no wires to the server
🔧PCA9685 servo control over I2C
💡Digital pin outputs for LEDs & relays
⚙️Runtime configuration via MQTT commands
🌈

WLED

Addressable LED strips

Flash any ESP board with WLED firmware, connect it to a strip, and register it as a device in Cloud. Save scenes — brightness, effect, palette, and colors — then activate them from Cloud or the Throttle app's WLED tab.

WLED Scenesdocs
🛠️

Build Your Own

DEJA.js uses open protocols — any device that speaks Serial, MQTT, or WebSocket can join your layout. Send JSON commands and you're in.

Custom Device Guidedocs
🔊

Sound effects don't need a board at all — upload files to the sound library in Cloud and they play back through your DEJA Server's own speakers, triggered instantly from any Throttle. See Soundsdocs.

Walkthrough

Register a Device, Then Wire It Up

Everything below happens in the Cloud app. Register the device once, then assign as many turnouts, effects, and sensors to it as it has pins for.

01

Add the Device

Open Devicesdocs and click Add. Give it a Device ID (e.g. yard-board-1), then pick its Device Typedeja-arduino or deja-esp32 for USB, or deja-esp32-wifi/deja-mqtt for wireless. Connection (USB or WiFi/MQTT) is auto-filled from the type; for wireless devices, add the WiFi SSID/password and MQTT broker — they get baked into the firmware when you deploy.

02

Add an Effect

Open Effectsdocs and click Add. Pick the device you just registered, then pick an effect type (Light, LED, Relay, etc.). Set a Name and the output Pin on that device — a color and tags are optional.

03

Add a Sensor

Open Sensorsdocs and click Add. Set a Name, Index, and input Pin, then pick the same device and its Sensor Type (Digital/Analog) and Input Type (Infrared, reed, etc.). Optionally link it directly to the effect from step 2 — the effect fires automatically whenever the sensor activates.

04

Add a Turnout

Open Turnoutsdocs and click Add. Set a Name and its DCC Index, then the Straight and Divergent position values (servo angle or pin state). Pick the Type (Kato or Servo) and the same device — the turnout now shows up on that device's details page alongside the effect and sensor.

Everything you just added is what deja deploy reads to generate the device's firmware config — see Device Detailsdocs to view them all in one place, or jump straight to the deploy flow below.

Deploy Flow

Configure once, deploy to any device

🚀

Plug in a new device and it's auto-detected by the server. Configure pins, servos, and outputs in the Cloud app, then deploy with a single command — no re-flashing, no code changes.

Device details page in DEJA Cloud showing pinout, assigned turnouts, effects, and signals for a registered device

Every registered device gets a details page — pinout, assigned turnouts, effects, signals, and sensors, plus the exact deploy command for that device.

From your terminal, one command reads a device's live configuration from Cloud, generates the right firmware config, and flashes the board:

bash
$deja deploy
  1. Pick the layout from your DEJA Cloud account
  2. Pick a registered device (auto-filtered to flashable types)
  3. Enter WiFi/MQTT credentials — only for wireless devices
  4. Config is generated from that device's turnouts, effects, sensors, and signals
  5. The board is compiled (or copied, for Pico W) and flashed

Dive Into the Docs