Solved Elite CV read and write proble, help wanted

Postby ron&bram » 30.06.2008, 19:24

Hi Jean-Michel,

Thanks for the hints, I will get cracking again. At the moment I am still trying to figure out why rocrail cannot read cv's from the elite and decoderpro can.
At this point, I think that, taking into account that I see on the serial port the command for reading cv 1 passing by 6 times, somehow the elite is seen as busy.

I will start the procedure for installing and compiling the sources tonight. My first attempt failed, following the 10 step plan in Dutch, because there a link is mentioned to the compiled wx libraries that should be in the snapshot index (but alas they are not there). So I'll have a go at the English version and build the wxwidgets library also.

And for crying for a computer
But the code is fragile, don't cry if something is not working
once in my life I almost cried with regard to a computer program (during my study I had programmed quite a program in pascal on punch cards (yes I am that old) and dropped the box.

Report(s) will follow, when you have a comment on my idea about the busy problem please let me know.

Best regards
Ronald
Best regards, Viele Grüsse, vriendelijke groeten, Ronald :rr_cap:
GCA85/50/93/145/146/153 Loconet, Twincenter+booster for locs, seperate booster for accessory decoders, dedicated laptop with XP and Ubuntu for Rocrail, AndRoc, LGB indoor OTF layout
ron&bram
 

I am getting a bit dizzy, but am getting somewhere

Postby ron&bram » 30.06.2008, 22:10

Progress report on investigation why Elite will not read cv values.

First, I hope Jean-Michel is not becoming bored with me.


After a night studying the lenz.c source, the jmri java source and the xpressnet protocol specification I came to the follwing conclusions:

both rocrail and jmri send the same command to the command station:

0x22 0x15 (direct mode cv read request) cv-number xor-byte.

Upon receipt of this command the Elite switches into service mode (relay clicks), BUT the Elite does not send a broadcast message that is has gone into service mode (message 0x61 0x02 xor=0x63).

In the java code, the programs just continues and issues a request for service mode results (0x21 0x10 xor=0x31).

The first reply from the Elite is the message it should have broadcasted (0x61 0x02 0x63).

A second request for service mode results is then issued (0x21 0x10 0x31).

The reply from the Elite when all works well, no short circuits or whatever is the proper reply 0x63 0x14 cv-number cv-content xor-byte. Other replies could be what can be expected 0x61 0x12 for short circuit, 0x61 0x13 for cv not found and so on.
Finally a resume normal operation message (0x21 0x81 0xA0) is send.

So the way to get rocrail to read cv's (on the pt only?) is, in my humble opinion:
send direct mode cv read request 0x22 0x15 cv-number xor-byte
send request for service mode result 0x21 0x10 0x31
check if response is service mode state 0x51 0x02 0x63
send request for service mode result
interpret response (0x61 0x?? sorry problem or 0x63 0x14 cv-number cv-value).
send resume normal operation (0x21 0x81 0xA0).

And then I look into lenz.c and lights go out, I have no (maybe not yet) any idea on how to implement this.

Are there people out there that are willing to help on this, other then the, by now buried under my thanks, expert (may I call you this?) Jean-Michel (perhaps Spanish people with a reference to Sergio's post on the football finale)?

Best regards,
Ronald
Best regards, Viele Grüsse, vriendelijke groeten, Ronald :rr_cap:
GCA85/50/93/145/146/153 Loconet, Twincenter+booster for locs, seperate booster for accessory decoders, dedicated laptop with XP and Ubuntu for Rocrail, AndRoc, LGB indoor OTF layout
ron&bram
 

Postby jeanmichel » 30.06.2008, 22:30

Hi Ronald,

I'm not bored ... ;)

> send direct mode cv read request 0x22 0x15 cv-number xor-byte
this is done
>send request for service mode result 0x21 0x10 0x31
afterwards this one ...

-> so here might be the problem?

If I understand it right on the 0x22 0x15 ... there is no response from the elite?

>check if response is service mode state 0x51 0x02 0x63
>send request for service mode result

this I don't understand ...

interpret response (0x61 0x?? sorry problem or 0x63 0x14 cv-number cv-value).
> this in done?

>send resume normal operation (0x21 0x81 0xA0).
this as well ... ?

Regards
Jean-Michel
jeanmichel
 

Postby jeanmichel » 05.07.2008, 22:56

This problems are fixed.
jeanmichel
 

Previous

Return to Hornby Elite