Using third-party accessory decoders
Most layouts already own a few DCC accessory decoders -- a Digitrax DS64, an NCE Switch-It, an ESU SwitchPilot. DEJA can drive them through your DCC-EX command station, so their turnouts and signals sit next to everything else on the Turnouts and Signals screens.
In practice it is three steps: add the decoder as a device, bind turnouts and signals to its outputs, and if everything works but is four addresses off, set the offset. The rest of this page is the detail behind each step. To build a decoder instead of buying one, see Build the DEJA accessory decoder.
How accessory decoders work
A DCC accessory decoder listens to the track. The command station sends it "address 5, output 1, thrown" and the decoder moves the points. The decoder never answers: DCC accessory commands are one-way.
That has one big consequence in DEJA: a decoder turnout's state is commanded, not confirmed. DEJA knows what it asked for, not what the points did. Add a feedback sensor if you want proof (see Commanded vs confirmed).
Add a decoder
On the Devices page, choose Add device and pick the DCC Accessory Decoder type. Then:
| Field | What to enter |
|---|---|
| Command station | The DCC-EX command station that will send the commands. |
| Decoder | A profile: Digitrax DS64, Digitrax SE8C, NCE Switch-It, NCE Light-It, ESU SwitchPilot, TCS WS-4, DCC Concepts Cobalt, the DEJA ESP32/Arduino decoders, or Generic accessory decoder. The profile fills in the number of outputs. |
| Base address | The address of output 1, as a linear number or as addr/sub (see below). |
| Address offset | -4, 0 or +4. See the ±4 offset. |
| Outputs | How many outputs the decoder has. Pre-filled from the profile; change it for a generic decoder. |
A decoder is not a device that "connects": it has no link of its own. Everywhere it appears (lists, sheets, tables) its health is its command station's health, labelled via <station>.
Addressing
DCC accessory addresses are written two ways, and manuals disagree about which to use. DEJA accepts either and shows you the other.
- Linear -- one number, 1 to 2044.
- Addr / sub -- a board address (1 to 511) and one of four outputs on it (0 to 3).
They are the same thing: linear = (addr - 1) * 4 + sub + 1.
| Linear | Addr / sub |
|---|---|
| 1 | 1 / 0 |
| 4 | 1 / 3 |
| 5 | 2 / 0 |
| 2044 | 511 / 3 |
Switch between the two with the toggle on the address field; the other form is shown underneath.
The ±4 offset
Some manufacturers number addresses starting one board earlier than the NMRA and DCC-EX convention, so the same decoder is "address 1" in its manual and "address 5" on the wire (or the reverse). The tell: every turnout works but is four addresses off, so throwing turnout 5 moves turnout 1.
If that happens, set the decoder's Address offset to +4 (or -4) rather than renumbering anything. Leave it at 0 until you see the symptom.
Turnouts
On the turnout form, set Type to DCC accessory decoder and pick the decoder as the Device. You then bind the turnout in one of two ways:
- Decoder output -- pick "Output 3", for example. DEJA works out the address from the decoder's base address and offset, and shows it next to each output. Outputs already used by another turnout are greyed out.
- Raw address -- if you choose your command station itself as the device, type an accessory address directly. Use this for a decoder you don't want to register.
DCC-EX turnout ids
DCC-EX tracks turnouts by an id, separate from the address. DEJA defines each decoder turnout on the command station for you (<T id DCC addr sub>, then saves with <E>). The DCC-EX turnout id field is pre-filled, and new decoder turnouts start at 1000 so they stay clear of servo and pin turnouts you defined by hand.
Things worth knowing:
- DEJA only writes definitions after it has read the station's
<T>list. It never overwrites an id that was defined by something other than DEJA. - After you add or renumber a decoder turnout, give it about two seconds before throwing: DEJA lists the station's turnouts first.
- If the station is disconnected when you renumber or rebind a turnout, the old id stays in the station's EEPROM and DEJA won't overwrite it later. Delete it by hand with
<T id>then<E>, or just keep using a fresh id.
Sync errors
If the turnout's id is already used on the station by a definition DEJA didn't create, the turnout shows a sync error in its edit form instead of being overwritten. Pick another id -- the next free one from 1000 is a good choice -- and save. The error clears on the next successful sync.
Invert
If a turnout moves the wrong way, switch on Invert on its form. Invert flips only what is sent to the hardware. In DEJA, state: true always means thrown, and the screens, automations and routes keep saying thrown/straight exactly as before. See Turnouts.
RCN-213 polarity
DCC-EX and the NMRA treat "thrown" and "closed" (straight) one way round; the European RCN-213 standard treats them the other. RCN-213 polarity is a per-command-station setting with no screen yet. If every decoder turnout on a station is backwards and your DCC-EX was built with DCC_TURNOUTS_RCN_213, switch on Invert for each of those turnouts -- that is the workaround until the setting has a screen. For hands-on help, book a session with Track & Trestle.
Signals
Set a signal's device to a DCC Accessory Decoder and the form swaps its pin fields for a DCC mapping. Pick the decoder output the head is wired to (signal-type outputs are listed first; outputs already in use are greyed out) -- the mapping's address starts from that output. Store the address as the decoder numbers it: DEJA adds the decoder's ±4 offset when it sends, so fixing the offset later fixes its signals too.
On your command station itself, choose Driven by: DCC to use a DCC mapping instead of the station's pins (Pins is the default, and existing pin signals keep working unchanged).
A DCC mapping uses one of two modes.
Extended (<A>)
One address per signal head; each aspect is a number from 0 to 31 sent with <A addr n>. Typical for modern signal decoders, including the DEJA ESP32 and Arduino decoders. Needs DCC-EX 5.2.34 or newer on the command station: on an older version the signal shows an error and sends nothing.
Basic (<a> pairs)
For decoders like the Digitrax SE8C and NCE Light-It, which treat each lamp as an accessory output. Each aspect is a list of pairs -- a linear address and closed/thrown -- that are all sent when the aspect is chosen. Pairs go out 50 ms apart.
Presets and Test
Three presets fill in sensible values: 2-aspect (red / green), 3-aspect (red / yellow / green) and Searchlight. They copy values in, and everything stays editable.
The Test button beside each aspect sends it for real, which is useful with the track side of the decoder in view. It tests the saved mapping, so save first if you've changed something. See also Signals.
Commanded vs confirmed
Decoder turnouts show a small dot next to their name:
| Dot | Meaning |
|---|---|
| Hollow | Commanded -- DEJA sent the command; nothing has confirmed it. |
| Solid | Confirmed -- a feedback sensor agrees. |
| Amber | Mismatch -- the sensor has disagreed for more than 3 seconds. |
Servo, Kato and pin turnouts show no dot unless a feedback sensor is bound. They aren't one-way.
Feedback sensors. On the turnout form, pick a sensor and say whether it is active when the turnout is thrown or closed. That upgrades the dot from hollow to solid when the track agrees.
Other throttles. DCC-EX announces turnout changes with <H> broadcasts. DEJA applies them to the stored state of any turnout with a matching DCC-EX id on that station -- including turnouts you defined by hand, such as servo turnouts on the EX-CommandStation -- so a throw from JMRI or WiThrottle shows up in DEJA. Those turnouts show no dot: a command-station echo isn't confirmation.
Want to build your own?
If you would rather make your own decoder than buy one, DEJA has firmware for an ESP32 or an Arduino Nano. See Build the DEJA accessory decoder.
Programming the address
A new decoder rarely answers to the address you want. There are two ways to set it.
Learn address. Many decoders have a "learn address" button: put the decoder in learn mode, then throw the first address from DEJA. The decoder takes the address it hears.
The Set decoder address helper. On the decoder's device page, a card named "Set decoder address" writes the decoder's board addressing (CV1 and CV9, plus CV29 bit 6) from its base address. Put the decoder alone on the programming track first. It is a development-stage feature behind the dccDecoderProgramming flag, so you may not see it yet. It never writes <W address>, which would change a locomotive's address instead.
Troubleshooting
Nothing moves.
- Is the decoder's command station connected? Its health shows "via <station>".
- Is the address right? Check the linear and addr/sub readouts against the decoder's setup.
- Is it four addresses off? Try the ±4 offset.
- Is there a sync error on the turnout? Pick a different id.
- Did you just add or renumber it? Wait two seconds.
It moves the wrong way. Turn on Invert for that turnout. If every turnout is backwards, check the command station's RCN-213 polarity.
A throw from another throttle doesn't show up. The id on the other throttle must match the turnout's DCC-EX id on the same station.
A signal is dark.
- Extended mode needs DCC-EX 5.2.34 or newer.
- Check that the aspect you chose has a number (extended) or at least one pair (basic).
- Use Test to send the saved mapping; if the Test works but automations don't, check the signal's device.