Skip to main content

DCC-EX Console

The DCC-EX Console provides direct access to your DCC-EX CommandStation. You can send raw commands, toggle power, check status, and monitor all command traffic in real time. This is the low-level interface for operators who need to debug, test, or perform operations not covered by the higher-level Roster, Turnouts, or Effects screens.

The console is available at /dccex and requires both authentication and an active DCC-EX device in your layout configuration.

DCC-EX Console

Preset Command Buttons

The top of the console displays a row of preset command buttons, each mapped to a common DCC-EX operation:

ButtonTypeDCC CommandDescription
PowerToggle switch<1> / <0>Turn track power on or off. The toggle state reflects whether power is currently enabled.
Power MAINToggle switch<1 MAIN> / <0 MAIN>Toggle power specifically on the main track output.
ResetButton<D RESET>Send a hardware reset command to the CommandStation.
StatusButton<=>Query the CommandStation for its current status. The response is displayed in the log.
SaveButton<E>Write the current configuration to the CommandStation's EEPROM so it persists across power cycles.
List OutputsButton<Z>Query and display all configured output pins on the CommandStation.

Toggle Commands

The Power and Power MAIN controls render as toggle switches. The first click enables the feature (sending the "on" command), and the second click disables it (sending the "off" command). The toggle state is tracked locally in the component.

Button Commands

Reset, Status, Save, and List Outputs render as standard buttons. Click once to send the command.

Custom Command Input

The last entry in the preset row is a text input field labeled "DCC Command". Type any valid DCC-EX command string (without the angle brackets) and press Enter or click the send icon to transmit it. The angle bracket wrapping and newline termination are handled automatically by the server.

Examples of custom commands you might send:

CommandWhat It Does
t 3 50 1Set locomotive address 3 to speed 50, forward
F 3 0 1Activate function F0 (headlight) on address 3
T 1 1Throw turnout index 1
Z 13 1Set output pin 13 HIGH
sQuery all decoder slots

After sending, the text field is cleared and ready for the next command.

Command Log

Below the preset buttons, the DCC Log section provides a real-time feed of all DCC commands sent and received through the WebSocket connection.

Enabling the Log

The log connects to the DEJA.js server via WebSocket. To enable it:

  1. Toggle the Enabled switch to on.
  2. Verify or update the WebSocket host field (default: 192.168.86.34:8082). This should match the IP address and port of your running DEJA.js server.

The WebSocket host setting is persisted in local storage (@DEJA/pref/ws-host) so you only need to configure it once.

Log Display

The log shows entries in reverse chronological order (newest at the top). Each entry includes:

  • Action -- The command action type (e.g., dcc, throttle, function, portList).
  • Payload -- The command payload data.
  • Timestamp -- When the command was sent or received.

LCD-Style Debug Panels

Below the log list, three LCD-style display panels provide at-a-glance monitoring:

PanelColorShows
DCC LOGGreenRecent command entries formatted as action: payload
STATUSBlueThe current WebSocket connection status
DATAAmberThe most recent raw data message received

These panels use the LCD display component, which renders text in a retro terminal style for quick visual scanning.

DCC-EX command log with LCD panels

How Commands Flow

When you send a command from the console:

  1. The sendDccCommand function from useDcc() writes the command to Firebase Realtime Database at dccCommands/{layoutId}.
  2. The server's RTDB listener in dejaCloud.ts picks up the new entry.
  3. The server's DCC handler in lib/dcc.ts wraps the command in angle brackets and sends it over USB serial: <command>\n.
  4. The CommandStation processes the command and sends any response back over serial.
  5. The server broadcasts the response to all connected WebSocket clients.
  6. The DCC Log displays the response in the console.

Common Use Cases

Debugging Decoder Issues

Send status queries and function commands directly to isolate whether a problem is in the decoder, the command flow, or the UI layer:

=          # Get CommandStation status
t 3 0 1    # Stop locomotive 3 (speed 0, forward)
F 3 0 1    # Turn on headlight for address 3
F 3 0 0    # Turn off headlight for address 3

Testing Turnout Wiring

Send turnout commands directly to verify that your turnout index and pin mapping are correct:

T 1 1      # Throw turnout index 1
T 1 0      # Close turnout index 1

Checking Output Pins

Verify that a specific Arduino pin is toggling correctly:

Z 13 1     # Set pin 13 HIGH
Z 13 0     # Set pin 13 LOW

Saving Configuration

After making changes through the CommandStation's configuration commands, save to EEPROM so they persist:

E          # Save to EEPROM

Related Pages