ripred

DCC-EX Serial Commands and Microcontroller Libraries

Oct 7th, 2025
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 26.99 KB | None | 0 0
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4.   <meta charset="utf-8">
  5.   <title>DCC-EX Serial Commands (Native API) &amp; Arduino/ESP32 Library — Single File HTML</title>
  6.   <meta name="viewport" content="width=device-width, initial-scale=1">
  7.   <style>
  8.     :root {
  9.       --bg: #0b0b0c;
  10.       --fg: #e7e7e9;
  11.       --muted: #a6a6ad;
  12.       --code-bg: #111216;
  13.       --code-border: #22232a;
  14.       --link: #7aa2ff;
  15.       --accent: #c792ea;
  16.     }
  17.     @media (prefers-color-scheme: light) {
  18.       :root {
  19.         --bg: #fff;
  20.         --fg: #222;
  21.         --muted: #555;
  22.         --code-bg: #f6f8fa;
  23.         --code-border: #e1e4e8;
  24.         --link: #0a58ca;
  25.         --accent: #7b3fe4;
  26.       }
  27.     }
  28.     html, body {
  29.       background: var(--bg);
  30.       color: var(--fg);
  31.       margin: 0;
  32.       padding: 0;
  33.       font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  34.     }
  35.     .page { max-width: 1000px; margin: 2rem auto 5rem auto; padding: 0 1.2rem; }
  36.     h1, h2, h3, h4 { line-height: 1.25; margin: 1.6em 0 .6em; font-weight: 800; }
  37.     h1 { font-size: 2.0rem; border-bottom: 1px solid var(--code-border); padding-bottom: .3rem; }
  38.     h2 { font-size: 1.6rem; border-bottom: 1px solid var(--code-border); padding-bottom: .2rem; }
  39.     h3 { font-size: 1.3rem; }
  40.     h4 { font-size: 1.1rem; color: var(--muted); }
  41.     p { margin: 0.8rem 0; }
  42.     a { color: var(--link); text-decoration: none; }
  43.     a:hover { text-decoration: underline; }
  44.     code, pre, kbd {
  45.       font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  46.       font-size: .925em;
  47.     }
  48.     pre {
  49.       background: var(--code-bg);
  50.       border: 1px solid var(--code-border);
  51.       padding: 1rem;
  52.       overflow: auto;
  53.       border-radius: .6rem;
  54.     }
  55.     .note { color: var(--muted); }
  56.     table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.6rem 0; }
  57.     th, td { border: 1px solid var(--code-border); padding: .55rem .6rem; vertical-align: top; }
  58.     thead th { background: color-mix(in oklab, var(--accent) 12%, transparent); text-align: left; }
  59.     .cmd code { white-space: pre-wrap; }
  60.     ul { padding-left: 1.4rem; }
  61.     li + li { margin-top: .2rem; }
  62.     hr { border: 0; border-top: 1px solid var(--code-border); margin: 2rem 0; }
  63.     .small { font-size: .95rem; color: var(--muted); }
  64.   </style>
  65. </head>
  66. <body>
  67.   <div class="page">
  68.     <h1>DCC-EX Serial Commands (Native API) &amp; Arduino/ESP32 Library</h1>
  69.  
  70.     <h1>Guide</h1>
  71.     <h3>Quick Reference: Commands, Descriptions, and Resource Links</h3>
  72.     <p class="small"><strong>Compiled:</strong> October 07, 2025</p>
  73.  
  74.     <h2>Power management</h2>
  75.     <table>
  76.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  77.       <tbody>
  78.         <tr class="cmd"><td><code>&lt;0|1 [MAIN|PROG|JOIN]&gt;</code></td><td>Turn track power off/on; <code>JOIN</code> temporarily ties PROG to MAIN (MAIN signal mirrored to PROG).</td></tr>
  79.         <tr class="cmd"><td><code>&lt;D RESET&gt;</code></td><td>Reboot the Command Station.</td></tr>
  80.         <tr class="cmd"><td><code>&lt;J I&gt; / &lt;JI&gt;</code></td><td>Report live current (mA) per track channel.</td></tr>
  81.         <tr class="cmd"><td><code>&lt;J G&gt; / &lt;JG&gt;</code></td><td>Report configured max/overcurrent trip thresholds (mA) per track.</td></tr>
  82.       </tbody>
  83.     </table>
  84.  
  85.     <h2>Track Manager (A..H channels)</h2>
  86.     <table>
  87.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  88.       <tbody>
  89.         <tr class="cmd"><td><code>&lt;= track mode [cab]&gt;</code></td><td>Set channel A..H to <code>MAIN</code> | <code>MAIN_INV</code> | <code>MAIN_AUTO</code> | <code>PROG</code> | <code>DC</code> | <code>DC_INV/DCX</code> | <code>NONE</code> (cab required for DC/DCX).</td></tr>
  90.         <tr class="cmd"><td><code>&lt;=&gt;</code></td><td>Dump Track Manager config for all channels.</td></tr>
  91.         <tr class="cmd"><td><code>&lt;0|1 [A..H]&gt;</code></td><td>Turn power off/on for a specific Track Manager channel.</td></tr>
  92.       </tbody>
  93.     </table>
  94.     <p class="note"><strong>Note:</strong> In DC/DCX mode, set PWM frequency via F29/F30/F31 from a throttle; stop before changing.</p>
  95.  
  96.     <h2>Cab (loco) control</h2>
  97.     <table>
  98.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  99.       <tbody>
  100.         <tr class="cmd"><td><code>&lt;t cab&gt;</code></td><td>Request a broadcast of the cab’s current speed/functions (<code>&lt;l ...&gt;</code>).</td></tr>
  101.         <tr class="cmd"><td><code>&lt;t cab speed dir&gt;</code></td><td>Set speed (0–127, -1 = E-stop) and direction (1=forward, 0=reverse).</td></tr>
  102.         <tr class="cmd"><td><code>&lt;!&gt;</code></td><td>Emergency stop for all cabs currently in reminders.</td></tr>
  103.         <tr class="cmd"><td><code>&lt;F cab funct state&gt;</code></td><td>Set decoder function F0..F68 (state: 0|1).</td></tr>
  104.         <tr class="cmd"><td><code>&lt;- [cab]&gt;</code></td><td>Forget one cab or all cabs from reminders (clears repeating throttle messages).</td></tr>
  105.         <tr class="cmd"><td><code>&lt;D SPEEDSTEPS&gt;</code></td><td>Select SPEED28 or SPEED128 (console message).</td></tr>
  106.         <tr class="cmd"><td><code>(legacy) &lt;f ...&gt;, &lt;t reg ...&gt;</code></td><td>Deprecated legacy forms for functions/speed.</td></tr>
  107.       </tbody>
  108.     </table>
  109.  
  110.     <h2>Roster</h2>
  111.     <table>
  112.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  113.       <tbody>
  114.         <tr class="cmd"><td><code>&lt;J R&gt; / &lt;JR&gt;</code></td><td>List roster entry IDs.</td></tr>
  115.         <tr class="cmd"><td><code>&lt;J R id&gt; / &lt;JR id&gt;</code></td><td>Get roster details for an entry (description + function labels).</td></tr>
  116.       </tbody>
  117.     </table>
  118.  
  119.     <h2>Turnouts / Points — operate</h2>
  120.     <table>
  121.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  122.       <tbody>
  123.         <tr class="cmd"><td><code>&lt;T&gt;</code></td><td>List defined turnout IDs and states.</td></tr>
  124.         <tr class="cmd"><td><code>&lt;T id state&gt;</code></td><td>Control: 1/T=throw, 0/C=close, X=examine (returns device details).</td></tr>
  125.         <tr class="cmd"><td><code>&lt;J T&gt; / &lt;JT&gt;</code></td><td>List defined turnout IDs.</td></tr>
  126.         <tr class="cmd"><td><code>&lt;J T id&gt; / &lt;JT id&gt;</code></td><td>Get turnout state and optional description.</td></tr>
  127.       </tbody>
  128.     </table>
  129.  
  130.     <h2>Turntables / Traversers — operate</h2>
  131.     <table>
  132.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  133.       <tbody>
  134.         <tr class="cmd"><td><code>&lt;I&gt;</code></td><td>List defined turntable/traverser IDs and current positions.</td></tr>
  135.         <tr class="cmd"><td><code>&lt;I id&gt;</code></td><td>Query current position.</td></tr>
  136.         <tr class="cmd"><td><code>&lt;I id position&gt;</code></td><td>Rotate DCC turntable (no movement feedback; returns moving=0).</td></tr>
  137.         <tr class="cmd"><td><code>&lt;I id position activity&gt;</code></td><td>Rotate EX-Turntable (reports moving status).</td></tr>
  138.         <tr class="cmd"><td><code>&lt;J O&gt; / &lt;JO&gt;</code></td><td>List defined turntable/traverser IDs.</td></tr>
  139.         <tr class="cmd"><td><code>&lt;J O id&gt; / &lt;JO id&gt;</code></td><td>Get device type, current position, count, description.</td></tr>
  140.         <tr class="cmd"><td><code>&lt;J P id&gt; / &lt;JP id&gt;</code></td><td>List all defined positions for device id.</td></tr>
  141.       </tbody>
  142.     </table>
  143.  
  144.     <h2>Routes / Automations (EXRAIL objects)</h2>
  145.     <table>
  146.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  147.       <tbody>
  148.         <tr class="cmd"><td><code>&lt;J A&gt;</code></td><td>List available route/automation IDs.</td></tr>
  149.         <tr class="cmd"><td><code>&lt;J A id&gt; / &lt;JA id&gt;</code></td><td>Get type (R/A) and description for a route/automation.</td></tr>
  150.       </tbody>
  151.     </table>
  152.  
  153.     <h2>System information</h2>
  154.     <table>
  155.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  156.       <tbody>
  157.         <tr class="cmd"><td><code>&lt;c&gt;</code></td><td>Report current draw and limits (structured).</td></tr>
  158.         <tr class="cmd"><td><code>&lt;s&gt;</code></td><td>Report firmware/hardware and list defined turnouts.</td></tr>
  159.         <tr class="cmd"><td><code>&lt;#&gt;</code></td><td>Report maximum supported cab (loco) slots.</td></tr>
  160.       </tbody>
  161.     </table>
  162.  
  163.     <h2>DCC accessories</h2>
  164.     <table>
  165.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  166.       <tbody>
  167.         <tr class="cmd"><td><code>&lt;a addr subaddr activate&gt;</code></td><td>Operate accessory via (address 0–511, subaddress 0–3); 0=deactivate/close, 1=activate/throw.</td></tr>
  168.         <tr class="cmd"><td><code>&lt;a linear_addr activate&gt;</code></td><td>Operate accessory via linear address 1–2044; 0=deactivate/close, 1=activate/throw.</td></tr>
  169.         <tr class="cmd"><td><code>&lt;A address aspect&gt;</code></td><td>Send extended accessory packet (e.g., set signal aspect).</td></tr>
  170.       </tbody>
  171.     </table>
  172.  
  173.     <h2>Sensors &amp; Signals (query/control)</h2>
  174.     <table>
  175.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  176.       <tbody>
  177.         <tr class="cmd"><td><code>&lt;Q&gt;</code></td><td>Report active/inactive state for all defined sensors.</td></tr>
  178.         <tr class="cmd"><td><code>&lt;S&gt;</code></td><td>List defined sensors with vpin and pullup flag.</td></tr>
  179.         <tr class="cmd"><td><code>&lt;/ RED id&gt; / &lt;/ AMBER id&gt; / &lt;/ GREEN id&gt;</code></td><td>Set a 3‑aspect signal via its defined vpin.</td></tr>
  180.       </tbody>
  181.     </table>
  182.  
  183.     <h2>WiFi control &amp; passthrough</h2>
  184.     <table>
  185.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  186.       <tbody>
  187.         <tr class="cmd"><td><code>&lt;+X&gt;</code></td><td>Force “WiFi connected” mode in CS loop (useful with custom networking).</td></tr>
  188.         <tr class="cmd"><td><code>&lt;+command&gt;</code></td><td>Send <code>AT+command</code> to the WiFi module (ESP8266/ESP32 AT firmware).</td></tr>
  189.         <tr class="cmd"><td><code>&lt;+&gt;</code></td><td>Enter raw AT passthrough (exit with <code>!</code>).</td></tr>
  190.         <tr class="cmd"><td><code>&lt;C WIFI "ssid" "password"&gt;</code></td><td>ESP32 only: STA connect to an existing WiFi network.</td></tr>
  191.       </tbody>
  192.     </table>
  193.  
  194.     <h2>EXRAIL — interactive serial controls</h2>
  195.     <table>
  196.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  197.       <tbody>
  198.         <tr class="cmd"><td><code>&lt;D EXRAIL ON|OFF&gt;</code></td><td>Enable/disable EXRAIL logging to serial monitor.</td></tr>
  199.         <tr class="cmd"><td><code>&lt;/PAUSE&gt;</code></td><td>Pause all EXRAIL automation (also E‑stops locos).</td></tr>
  200.         <tr class="cmd"><td><code>&lt;/RESUME&gt;</code></td><td>Resume all EXRAIL automation (restores prior speeds).</td></tr>
  201.         <tr class="cmd"><td><code>&lt;/&gt;</code></td><td>Show EXRAIL running task info.</td></tr>
  202.         <tr class="cmd"><td><code>&lt;/ START [loco_addr] route_id&gt;</code></td><td>Start a route/automation (optionally specify loco).</td></tr>
  203.         <tr class="cmd"><td><code>&lt;/ KILL task_id&gt;</code></td><td>Terminate a running EXRAIL task (advanced use).</td></tr>
  204.         <tr class="cmd"><td><code>&lt;/ RESERVE block_id&gt; / &lt;/ FREE block_id&gt;</code></td><td>Manually reserve/free a virtual block (0–255).</td></tr>
  205.         <tr class="cmd"><td><code>&lt;/ LATCH vpin&gt; / &lt;/ UNLATCH vpin&gt;</code></td><td>Force a sensor latch ON / release it (0–255).</td></tr>
  206.       </tbody>
  207.     </table>
  208.  
  209.     <h2>EX‑FastClock</h2>
  210.     <table>
  211.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  212.       <tbody>
  213.         <tr class="cmd"><td><code>&lt;JC minutes speed&gt;</code></td><td>Start fast clock (minutes since midnight, with speed factor).</td></tr>
  214.         <tr class="cmd"><td><code>&lt;JC&gt;</code></td><td>Read fast clock time (minutes since midnight).</td></tr>
  215.       </tbody>
  216.     </table>
  217.  
  218.     <h2>CV programming — MAIN</h2>
  219.     <table>
  220.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  221.       <tbody>
  222.         <tr class="cmd"><td><code>&lt;b cab cv bit value&gt;</code></td><td>Write a single bit within a CV on the main track.</td></tr>
  223.         <tr class="cmd"><td><code>&lt;w cab cv value&gt;</code></td><td>Write a CV byte on the main track.</td></tr>
  224.       </tbody>
  225.     </table>
  226.  
  227.     <h2>CV programming — SERVICE (PROG track)</h2>
  228.     <table>
  229.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  230.       <tbody>
  231.         <tr class="cmd"><td><code>&lt;R cv&gt;</code></td><td>Read CV; response: <code>&lt;v cv value&gt;</code>.</td></tr>
  232.         <tr class="cmd"><td><code>&lt;R&gt;</code></td><td>Read decoder (cab) address.</td></tr>
  233.         <tr class="cmd"><td><code>&lt;V cv bit onOff&gt;</code></td><td>Verify/read one bit in a CV against expected value.</td></tr>
  234.         <tr class="cmd"><td><code>&lt;V cv value&gt;</code></td><td>Verify/read a full CV against expected value.</td></tr>
  235.         <tr class="cmd"><td><code>&lt;B cv bit onOff&gt;</code></td><td>Write a bit to a CV (legacy response format).</td></tr>
  236.         <tr class="cmd"><td><code>&lt;W cv value&gt;</code></td><td>Write a CV byte (echoes new value or -1).</td></tr>
  237.         <tr class="cmd"><td><code>&lt;W address&gt;</code></td><td>Program the locomotive address and verify.</td></tr>
  238.         <tr class="cmd"><td><code>&lt;P register hex1 [hex2..hex5]&gt;</code></td><td>Send raw DCC packet to PROG track.</td></tr>
  239.         <tr class="cmd"><td><code>(deprecated)</code></td><td><code>&lt;B cv bit value cb cb&gt;</code>, <code>&lt;W cv value cb cb&gt;</code>, <code>&lt;R cv cb cb&gt;</code> legacy callback forms.</td></tr>
  240.       </tbody>
  241.     </table>
  242.  
  243.     <h2>Direct packet — MAIN</h2>
  244.     <table>
  245.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  246.       <tbody>
  247.         <tr class="cmd"><td><code>&lt;M register hex1 [hex2..hex5]&gt;</code></td><td>Send raw DCC packet to MAIN (debug/testing).</td></tr>
  248.       </tbody>
  249.     </table>
  250.  
  251.     <h2>Programming track tuning</h2>
  252.     <table>
  253.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  254.       <tbody>
  255.         <tr class="cmd"><td><code>&lt;D ACK LIMIT mA&gt;</code></td><td>Override ACK current threshold (mA).</td></tr>
  256.         <tr class="cmd"><td><code>&lt;D ACK MIN uS&gt; / &lt;D ACK MAX uS&gt;</code></td><td>Override ACK pulse min/max duration (µs).</td></tr>
  257.         <tr class="cmd"><td><code>&lt;D ACK RETRY num&gt;</code></td><td>Set number of CV read/write retries.</td></tr>
  258.         <tr class="cmd"><td><code>&lt;D PROGBOOST&gt;</code></td><td>Temporarily lift PROG-track current limit while idle.</td></tr>
  259.       </tbody>
  260.     </table>
  261.  
  262.     <h2>Configure: Turnouts / Points</h2>
  263.     <table>
  264.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  265.       <tbody>
  266.         <tr class="cmd"><td><code>&lt;T id DCC addr subaddr&gt;</code></td><td>Define turnout via DCC accessory address/subaddress.</td></tr>
  267.         <tr class="cmd"><td><code>&lt;T id DCC linearAddr&gt;</code></td><td>Define turnout via DCC linear address.</td></tr>
  268.         <tr class="cmd"><td><code>&lt;T id VPIN vpin&gt;</code></td><td>Define turnout on a vpin/digital output.</td></tr>
  269.         <tr class="cmd"><td><code>&lt;T id SERVO vpin thrownPos closedPos profile&gt;</code></td><td>Define servo turnout on vpin; profile 0=instant..4=bounce.</td></tr>
  270.         <tr class="cmd"><td><code>&lt;T id&gt;</code></td><td>Delete a turnout definition by ID.</td></tr>
  271.         <tr class="cmd"><td><code>&lt;D SERVO vpin value [profile]&gt;</code></td><td>Directly move a servo; profile 0..4.</td></tr>
  272.       </tbody>
  273.     </table>
  274.  
  275.     <h2>Configure: Turntables / Traversers</h2>
  276.     <table>
  277.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  278.       <tbody>
  279.         <tr class="cmd"><td><code>&lt;I id DCC home&gt;</code></td><td>Define a DCC turntable/traverser with home angle.</td></tr>
  280.         <tr class="cmd"><td><code>&lt;I id EXTT vpin home&gt;</code></td><td>Define an EX‑Turntable device at vpin with home angle.</td></tr>
  281.         <tr class="cmd"><td><code>&lt;I id ADD position value angle&gt;</code></td><td>Add a position (value=EX‑Turntable steps or DCC linear addr).</td></tr>
  282.       </tbody>
  283.     </table>
  284.  
  285.     <h2>Configure: Sensors</h2>
  286.     <table>
  287.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  288.       <tbody>
  289.         <tr class="cmd"><td><code>&lt;S id vpin pullup&gt;</code></td><td>Create/update a sensor (pullup: 1=use pull‑up=ACTIVE‑LOW, 0=no pull‑up=ACTIVE‑HIGH).</td></tr>
  290.         <tr class="cmd"><td><code>&lt;S id&gt;</code></td><td>Delete a sensor.</td></tr>
  291.         <tr class="cmd"><td><code>&lt;/ LATCH vpin&gt; / &lt;/ UNLATCH vpin&gt;</code></td><td>Force sensor latched ON / release (IDs 0–255).</td></tr>
  292.       </tbody>
  293.     </table>
  294.  
  295.     <h2>Configure: Outputs (vpins)</h2>
  296.     <table>
  297.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  298.       <tbody>
  299.         <tr class="cmd"><td><code>&lt;z vpin&gt; or &lt;z -vpin&gt;</code></td><td>Quick set output ACTIVE/HIGH or INACTIVE/LOW (no predef).</td></tr>
  300.         <tr class="cmd"><td><code>&lt;Z id vpin iflag&gt;</code></td><td>Create/update an output with flags (invert, restore/force at boot).</td></tr>
  301.         <tr class="cmd"><td><code>&lt;Z id&gt;</code></td><td>Delete an output.</td></tr>
  302.         <tr class="cmd"><td><code>&lt;Z&gt;</code></td><td>List outputs (<code>&lt;Y id vpin iflag state&gt;</code>).</td></tr>
  303.         <tr class="cmd"><td><code>&lt;Z id state&gt;</code></td><td>Set output ACTIVE/INACTIVE.</td></tr>
  304.       </tbody>
  305.     </table>
  306.  
  307.     <h2>EEPROM management</h2>
  308.     <table>
  309.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  310.       <tbody>
  311.         <tr class="cmd"><td><code>&lt;D EEPROM&gt;</code></td><td>Dump stored definitions (diagnostic).</td></tr>
  312.         <tr class="cmd"><td><code>&lt;E&gt;</code></td><td>Store definitions (turnouts, sensors, outputs) to EEPROM.</td></tr>
  313.         <tr class="cmd"><td><code>&lt;e&gt;</code></td><td>Erase all stored turnouts, sensors, outputs from EEPROM.</td></tr>
  314.       </tbody>
  315.     </table>
  316.  
  317.     <h2>Diagnostics (general/HAL/network)</h2>
  318.     <table>
  319.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  320.       <tbody>
  321.         <tr class="cmd"><td><code>&lt;D ACK ON|OFF&gt;</code></td><td>Toggle programming ACK diagnostics.</td></tr>
  322.         <tr class="cmd"><td><code>&lt;D CMD ON|OFF&gt;</code></td><td>Toggle serial command parser diagnostics.</td></tr>
  323.         <tr class="cmd"><td><code>&lt;D ETHERNET ON|OFF&gt; / &lt;D WIFI ON|OFF&gt; / &lt;D WIT ON|OFF&gt;</code></td><td>Toggle respective diagnostics.</td></tr>
  324.         <tr class="cmd"><td><code>&lt;D LCN ON|OFF&gt;</code></td><td>Toggle LCN interface diagnostics.</td></tr>
  325.         <tr class="cmd"><td><code>&lt;D CABS&gt;</code></td><td>Show cab slots used/max (console).</td></tr>
  326.         <tr class="cmd"><td><code>&lt;D HAL SHOW&gt;</code></td><td>Show HAL devices (servo/GPIO expanders) and assigned vpins.</td></tr>
  327.         <tr class="cmd"><td><code>&lt;D RAM&gt;</code></td><td>Show free RAM (console).</td></tr>
  328.         <tr class="cmd"><td><code>&lt;D ANIN vpin&gt;</code></td><td>Read analogue value from a vpin.</td></tr>
  329.         <tr class="cmd"><td><code>&lt;D ANOUT vpin value [param2]&gt;</code></td><td>Write analogue value to vpin (driver‑specific <code>param2</code>).</td></tr>
  330.       </tbody>
  331.     </table>
  332.  
  333.     <h2>Other</h2>
  334.     <table>
  335.       <thead><tr><th style="width:38%">Command</th><th>Description</th></tr></thead>
  336.       <tbody>
  337.         <tr class="cmd"><td><code>&lt;U cmd&gt;</code></td><td>Reserved user command (passes through user filter).</td></tr>
  338.       </tbody>
  339.     </table>
  340.  
  341.     <h2>Device‑specific consoles (add‑ons)</h2>
  342.     <h3>EX‑Turntable</h3>
  343.     <p><code>&lt;C&gt;</code>, <code>&lt;D&gt;</code>, <code>&lt;E&gt;</code>, <code>&lt;H&gt;</code>, <code>&lt;M steps activity&gt;</code>, <code>&lt;R&gt;</code></p>
  344.     <p class="note">On‑device interactive serial: calibrate, debug, erase EEPROM, home, move to steps, reboot.</p>
  345.  
  346.     <h3>EX‑IOExpander</h3>
  347.     <p><code>&lt;D&gt; [delay]</code>, <code>&lt;T A|I|O|P&gt;</code>, <code>&lt;T S vpin value profile&gt;</code>, <code>&lt;T&gt;</code></p>
  348.     <p class="note">On‑device diagnostics &amp; pin test modes; toggles periodic dumps and simple I/O/servo tests.</p>
  349.  
  350.     <h2>Arduino/ESP32 Libraries for DCC / DCC‑EX</h2>
  351.     <table>
  352.       <thead><tr><th style="width:22%">Library</th><th style="width:38%">URL(s)</th><th>Summary</th></tr></thead>
  353.       <tbody>
  354.         <tr>
  355.           <td>DCCEXProtocol</td>
  356.           <td>
  357.             <a href="https://github.com/DCC-EX/DCCEXProtocol">github.com/DCC-EX/DCCEXProtocol</a><br>
  358.             <a href="https://dcc-ex.com/DCCEXProtocol/index.html">dcc-ex.com/DCCEXProtocol</a><br>
  359.             <a href="https://docs.arduino.cc/libraries/dccexprotocol/">docs.arduino.cc/libraries/dccexprotocol</a>
  360.           </td>
  361.           <td>Non‑blocking C++ client for the DCC‑EX native protocol (serial/TCP). Ideal for hardware throttles on ESP32/Arduino; supports CV R/W and EXRAIL hand‑off.</td>
  362.         </tr>
  363.         <tr>
  364.           <td>NmraDcc</td>
  365.           <td>
  366.             <a href="https://github.com/mrrwa/NmraDcc">github.com/mrrwa/NmraDcc</a><br>
  367.             <a href="https://docs.arduino.cc/libraries/nmradcc/">docs.arduino.cc/libraries/nmradcc</a>
  368.           </td>
  369.           <td>Widely‑used Arduino library for NMRA DCC decoder implementations (mobile/accessory). Receives/decodes DCC from track; supports many AVR and some 32‑bit cores.</td>
  370.         </tr>
  371.         <tr>
  372.           <td>AP_DCC_Library</td>
  373.           <td>
  374.             <a href="https://github.com/aikopras/AP_DCC_library">github.com/aikopras/AP_DCC_library</a><br>
  375.             <a href="https://docs.arduino.cc/libraries/ap_dcc_library/">docs.arduino.cc/libraries/ap_dcc_library</a>
  376.           </td>
  377.           <td>Modular NMRA/RCN DCC decoder library; aims for cleaner structure vs NmraDcc and portability across MCUs.</td>
  378.         </tr>
  379.         <tr>
  380.           <td>CmdrArduino</td>
  381.           <td><a href="https://github.com/Railstars/CmdrArduino">github.com/Railstars/CmdrArduino</a></td>
  382.           <td>C++ framework for building an NMRA‑compliant DCC command station on Arduino‑class MCUs.</td>
  383.         </tr>
  384.         <tr>
  385.           <td>MynaBay DCC_Decoder</td>
  386.           <td><a href="https://github.com/MynaBay/DCC_Decoder">github.com/MynaBay/DCC_Decoder</a></td>
  387.           <td>Arduino DCC decoder library (classic implementation for simple decoders and experiments).</td>
  388.         </tr>
  389.         <tr>
  390.           <td>OpenMRNLite (LCC/OpenLCB)</td>
  391.           <td>
  392.             <a href="https://github.com/openmrn/OpenMRNLite">github.com/openmrn/OpenMRNLite</a><br>
  393.             <a href="https://docs.arduino.cc/libraries/openmrnlite/">docs.arduino.cc/libraries/openmrnlite</a>
  394.           </td>
  395.           <td>Arduino/ESP32 library for NMRA LCC (OpenLCB) layout control networking; complementary to DCC for signals, sensors, nodes.</td>
  396.         </tr>
  397.         <tr>
  398.           <td>ESP32 hardware notes (RMT for DCC)</td>
  399.           <td><a href="https://dcc-ex.com/reference/hardware/microcontrollers/esp32.html">dcc-ex.com/reference/hardware/microcontrollers/esp32.html</a></td>
  400.           <td>DCC‑EX guidance on generating clean DCC with ESP32’s RMT peripheral and supported boards.</td>
  401.         </tr>
  402.         <tr>
  403.           <td>DCC++ESP (third‑party command station)</td>
  404.           <td><a href="https://github.com/WolfgangGitHub/DCCppESP32">github.com/WolfgangGitHub/DCCppESP32</a></td>
  405.           <td>ESP32‑based DCC++‑compatible command station with web/JMRI support; useful as an alternative platform or reference.</td>
  406.         </tr>
  407.       </tbody>
  408.     </table>
  409.  
  410.     <h2>Notes</h2>
  411.     <ul>
  412.       <li>All commands are wrapped in angle brackets, e.g., <code>&lt;t cab&gt;</code>. Opcodes (the first token) are case‑sensitive; keyword parameters are not.</li>
  413.       <li>The Command Station broadcasts some responses (e.g., <code>&lt;l ...&gt;</code> after throttle ops); don’t expect a direct reply to every command.</li>
  414.       <li>EXRAIL is a DSL authored in <code>myAutomation.h</code> for automations; the serial commands above under “EXRAIL — interactive” are for runtime diagnostics/control, not for defining routes/sequences.</li>
  415.     </ul>
  416.  
  417.     <h2>References</h2>
  418.     <ol>
  419.       <li><a href="https://dcc-ex.com/reference/software/command-summary-consolidated.html">dcc-ex.com/reference/software/command-summary-consolidated.html</a></li>
  420.       <li><a href="https://dcc-ex.com/exrail/exrail-command-reference.html">dcc-ex.com/exrail/exrail-command-reference.html</a></li>
  421.       <li><a href="https://dcc-ex.com/ex-turntable/test-and-tune.html">dcc-ex.com/ex-turntable/test-and-tune.html</a></li>
  422.       <li><a href="https://dcc-ex.com/ex-ioexpander/testing.html">dcc-ex.com/ex-ioexpander/testing.html</a></li>
  423.       <li><a href="https://dcc-ex.com/reference/tools/serial-monitor.html">dcc-ex.com/reference/tools/serial-monitor.html</a></li>
  424.       <li><a href="https://dcc-ex.com/ex-commandstation/advanced-setup/supported-wifi/wifi-config.html">dcc-ex.com/ex-commandstation/advanced-setup/supported-wifi/wifi-config.html</a></li>
  425.       <li><a href="https://dcc-ex.com/DCCEXProtocol/index.html">dcc-ex.com/DCCEXProtocol/index.html</a></li>
  426.       <li><a href="https://github.com/DCC-EX/DCCEXProtocol">github.com/DCC-EX/DCCEXProtocol</a></li>
  427.       <li><a href="https://docs.arduino.cc/libraries/dccexprotocol/">docs.arduino.cc/libraries/dccexprotocol</a></li>
  428.       <li><a href="https://github.com/mrrwa/NmraDcc">github.com/mrrwa/NmraDcc</a></li>
  429.       <li><a href="https://docs.arduino.cc/libraries/nmradcc/">docs.arduino.cc/libraries/nmradcc</a></li>
  430.       <li><a href="https://github.com/aikopras/AP_DCC_library">github.com/aikopras/AP_DCC_library</a></li>
  431.       <li><a href="https://docs.arduino.cc/libraries/ap_dcc_library/">docs.arduino.cc/libraries/ap_dcc_library</a></li>
  432.       <li><a href="https://github.com/Railstars/CmdrArduino">github.com/Railstars/CmdrArduino</a></li>
  433.       <li><a href="https://github.com/MynaBay/DCC_Decoder">github.com/MynaBay/DCC_Decoder</a></li>
  434.       <li><a href="https://github.com/openmrn/OpenMRNLite">github.com/openmrn/OpenMRNLite</a></li>
  435.       <li><a href="https://docs.arduino.cc/libraries/openmrnlite/">docs.arduino.cc/libraries/openmrnlite</a></li>
  436.       <li><a href="https://dcc-ex.com/reference/hardware/microcontrollers/esp32.html">dcc-ex.com/reference/hardware/microcontrollers/esp32.html</a></li>
  437.     </ol>
  438.  
  439.     <hr>
  440.       </div>
  441. </body>
  442. </html>
Add Comment
Please, Sign In to add comment