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