Help with nmradcc library and accessories decoders DCC packets

Hi,

I am trying to build a DCC Accessory decoder using the nmradcc library and I don't really understand some messages I receive from the Ecos.

I am using Arduino UNO with a DCC shield, IDE V 2.0 and... an Ecos 2.1

First, I create a light on/off accessory on the Ecos assign CV1= (4) and test it.

In Output mode I get from notyfyDccAccTurnoutOutput:

CV1=4, direction = 1 for active, 0 for inactive => this is OK

Then I add a two way signal and assign CV1 to (5) and test, I get on the decoder side:

CV1=5, direction is 1 for go 0 for stop => this is OK

BUT I don't understand why the Ecos isn't sending a signal message ??? notifyDccSigOutputState isn't called... I am new to this but I don't understand why it is still a turnout DCC packet when I am configuring a two way signal in the Ecos....

Then I add a three way signal, assign CV1 to (6) and test, I get on the decoder side:

CV1=6, direction is 1 for green, 0 for orange... => this is fine

When I try the third option, I get CV1=7... direction is 1... so it accepts only a two way option and goes to the next CV to process the third signal option... OK, maybe... I have to find out how I can listen with one only decoder to two different CVs, normal in dcc.init I select one address I want to listen to, not two (or more)... But when I select the first signal pattern, I still get CV=6 and direction = 1... decoder address CV1=7 has not changed back to direction=0... how can I know I am back to option one ? Because if I select signal type one, and immediately after signal type=three, the address CV1=6 still has option one set... How do I know the exact signal output ??? CV1=6 tells me something and CV1=7 tells me something else.. Which one should I select ??? OK, you can tell me to base myself on the last message received... but.. I find this strange

And still, I get a turnout packet and not a signal packet... At least with a signal packet the state of the signal is sent to one decoder address only... no ?

Then I created a four way signal.. assigned the address 10 and test

I get CV1=10, correct address, direction is one... ok
option 2, still received on address 10, this is ok, direction is 0, also OK.
option 3, for decoder address 11... direction is one..
option 4 for decoder address 11, direction is zero

All this is sort of consistent... but I still get turnout packets and not signal packets...

How does the decoder know the correct signal output if I select option one and option 3... data will come from the Ecos for two different decoder addresses, what signal option should I choose for this signal ???

ALL THIS was received using the decoder init with turnout output mode... Now I check exactly the same accessories configured in the Ecos with my decoder in board addressing mode:

Test one, light on/off.

light ON: Board Address is one, output pair is 3 direction is one
light off: Board address is one, output pair is 3, direction is zero

I could be happy with this if I understood why the Ecos is sending outputpair=3... I would be happier with a one... what is the logic ?

test two, two way signal

signal green: board address is two, output pair is zero, direction is one
signal red; board address is two, output pair is still zero, direction is zero

This could be OK BUT I don't understand why this time output pair is equal to zero, where is the logic... There must be one, but I have not found it yet (this is why I ask for some help)

test 3, three way signal

signal green: BANG board address is two again, output pair is one this time and direction is one

HOW do I know which signal to change if I get for two different physical signals the same board address ??

signal orange: board is two again, output pair is one still and direction is zero

(I am lost)

signal green/orange board is two again, output pair is two, direction is one...

for the third signal, there is some logic with the output pair numbering but why board is the same as test 2 ?? (different accessory on the Ecos)

And the fourth test: for way signal

(1) board is three, output pair is one, direction is one
(2) board is three, output pair is one, direction is zero
(3) board is three, output pair is two, direction is one
(4) board is three, output pair is two, direction is zero

At least with the fourth test I feel there is some logic !!!

Can somebody point me to some documentation, explanations, messages which could help me understand the messaging structure below the dcc packets which are sent from the Ecos in order for me to build a working decoder ???

Thank you very much in advance.

Charles

Well, I don't know the ECoS central station, but I know something about DCC and the nmraDcc library :wink:

The 'classical' way to control signals is the same as to control turnouts. When DCC was initially defined, signals had the same dual coil actuator as turnouts. 'Signal packets' had been added later, and I think you must specifically activate that in your ECoS.
Three way signals had an additional coil, and they were controlled by two consecutive accessory addresses. To control those signals with NmraDcc in output mode you must not set the 'FLAGS_MY_ADDRESS_ONLY' flag when initialising.
Difference between board addressing and output addressing:
Board addressing is a address type for the old 4 turnout decoders. These decoders can control 4 turnouts/signals. The lower 2 bits of the address within the packet is interpretet as the output of the decoder ( 0..3 ). The upper bits are interpreted as the decoder address. At least the packet is the same as with output addressing, it is only interpreted differently.

You can find all the DCC standards here.

Hopefully not to muddy the waters, but LCC is better suited to layout signalling than DCC, if there are a lot of signals and complex block interactions.

Thanks, your message helped !! Now I need to read further and make sure I learn more :slight_smile:

I was under the impression initially that one accessory decoder answering to one dcc address only (so dcc.init() with FLAGS_MY_ADDRESS_ONLY) could change (on/off) four accessories/ turnouts/lights... Only four bits are required for this ! We have 8 bits for "direction" why is it only 0/1 ? And what is output power ????? Each time I change the light for example, the direction byte is 0 or 1 and I get four packets with output power set to 1 and four others with output power set to 0...

I need to read again obviously :slight_smile: there must be a reason.... and more difficult: I need to try to understand !!!

I'll checked on the Ecos if there was a parameter to use signal dcc packets.... or use extended packets.... but found nothing....

If I read you well the nmra norm has improved over time but to retain compatibility with earlier systems nobody uses the "improved" dcc packets ??

I looked for a way to request cv changes for accessory decoders from the Ecos this morning and I could not find it... I was certain I could do it with my very old twin center.. I need to re-check this also...

Regards,

Charles

Yes, that's true for the first decoders there were ( you can still buy such decoders :wink: ). If you want to create such a decoder with the NmraDcc library, you must use board adressing ( don't set FLAGS_OUTPUT_ADDRESS_MODE ). In this case you can use the FLAGS_MY_ADDRESS_ONLY, because you have only one (decoder) address to control 4 turnouts. Again you must remember, that these decoders are designed to control turnouts/signals with a double coil motor. So you need two outputs ( 'output power' ) for each turnout. And to control these turnouts, the central station switches the output on and after a short time off again ( the coils will burn if they are enganged too long ). The central station repeats the accessory packets in case one gets lost.

If you use output addressing, there is no such grouping of 4 turnouts. Each turnout has it's own address, and you can control more then 4 turnouts with one decoder. But you must not use the FLAGS_MY_ADDRESS_ONLY flag. You have to check for the correct address in your sketch.
For example, if you want to control 6 turnouts with your decoder, usually the first turnout address is the one configured in CV, and the rest of the turnouts use the following addresses. But that's part of your sketch programming.

Hello Franz-Peter, thank you very much for your replies. It is greatly appreciated to have clear and precise answers... It isn't always the case in discussion forums... More often you have replies from people who think they know somebody who knows :joy: :joy:

Thanks to you I understand now the reason behind the values 0/1 in output power, it is clear now !!! It wasn't clear at all before..

I already guessed that the repeat of packets was in case messages got lost or corrupted, you confirmed that. Thanks again...

Have a nice day !

Charles

You're welcome.

What I forgot to mention - but I think you understood already - the Direction parameter determines which of the two coils/outputs should be set HIGH/LOW according to the value of 'OutputPower'

Franz-Peter