Solved Elite CV read and write proble, help wanted

Robbie dead XP

Postby ron&bram » 13.06.2008, 21:11

Hello Rob,

From what I have experienced (developers, correct if I am wrong), rocrail does not install any funny .dll in the windows system dirs like most programs do. I have a program that reports all programs starting at startup (autoruns.exe, I can send it to you when needed) and that list did not change after installing rocrail.

Let's take it step by step. Please note that I am Dutch, so I have a Dutch XP sp2 version and am translating the windows texts to English, so it may literally appear on your screen what I write (but I should be close).

From what I read, your laptop frooze on you and would not reboot properly. When booting with the last known good configuration you can boot up and the desktop appears, but if you start any program except rocrail server your laptop freezes again. Am I right?

Can you start up in safe mode and operate your laptop then? If yes, write your .xml file where your project is stored (default plan.xml) to a memory stick or whatever.
Then you could try to uninstall rocrail (all files not original in the rcrail package will not be deleted) and re-install rocrail.
You should also check your disk for corruption. From explorer, right click your disk, select properties, extra, check volume for errors. Make sure that the tick box for automatically repair errors is UNchecked. At my work a guy was making a backup of a PC controlling some semi-critical production equipment when soemthing went wrong. He did a check with that box checked. Because the root directory was corrupted windows turned all 1.87 million files on the disk into filexxxx.chk files. The end of the song was that I took the disk home and spend 6 nights with data recorvery tools (I can not send those since they are not freeware) reconstructing 1,87 million files onto a second disk. When windows finds errors, let me know -detailed- what it reported.

Next when available, return to a previous restore point. This would mean that any changes in installed software or drivers after that point are lost, but is a more thorough method of going back to a defined point where everything was working the the last known good boot option.

When you installed rocrail initially, did you the tick the install as service box? When yes (I did not) you may try to do start, run services.msc and see if rocrail is in the list. When yes, try to stop it (double click, when loading is automatic switch that to manual, then the stop button is accesible).

Let me now how you progress, I'll keep my grey cells pondering on your misery.

Regards,
Ronald
ron&bram
 

Postby RAFHAAA96 » 13.06.2008, 22:12

Thanks for the suggested route to a fix Ronald
I can answer some of your questions from here.
As you are Dutch your English is probably better than mine. I have had dealings with the Dutch Ministry of Defence and your Air Force so I know how good you are with my language.
The laptop reboots to the desktop but freezes to a black screen whenever I select anything except the RR server.
I shall try safe mode next start-up and if possible save the xml to mobile memory. Then if possible uninstall & reload RR probably to a newer SVN than 2664.
I'll try the error check and make sure I do not check the auto-fix box.
After reverting to a known point of fix (if I can) I will report back.
When installing RR I did not tick the service box as that was (to my understanding) only if I wanted to run a split server / client arrangement. My RR is all on the one laptop, although it does (did) have a connection over my wireless network to other pcs and the internet.
More info as it happens, Rob
Regards Rob.
Halton Brat
OO gauge - Hornby Elite & eLink CS & Accessory Decoders - Win 8 - 64 bit.
RAFHAAA96
 

Rob's frozen laptop

Postby ron&bram » 13.06.2008, 22:21

Rob,

You are more then welcome. At least your setup is quite similar to mine. I also have an old laptop (in fact 14 of them, another hobby of mine is restoring Compaq Armada M700/E500 laptops) dedicated for rocrail, but with a wifi connection to my home network and over one of the two routers (whichever gives the best reception) via a proxy server frontend onto the internet.
One thing I always do, although a little late, I'll admit, is to keeps backups on a monthly basis or before any major change on a NAS disk only switched on during the backup. I do that by making Norton Ghost images of the hard disks (I have an older official Ghost 9 from my work to do the job). When something happens (and believe me, with 14 laptops and a young son) I do not even bother anymore, I just rip out the harddisk, put it in a usb holder and write back the most recent ghost image. Maybe something to keep in mind for the future.

I'll keep standing by.
ron&bram
 

Hope on the horizon for Elite cv reading?

Postby ron&bram » 13.06.2008, 22:26

Hello All,

I have installed JMRI's decoderpro and am able to read cv's throught the Eite with that. I will try to grab the communication with a port monitor when reading one cv and post it here to help the developers.

To be continued
ron&bram
 

Postby jeanmichel » 14.06.2008, 08:01

HI,

just alittle question: on the hornby page is a firmware update for the elite. Have you installed it?

Regards
Jean-Michel
jeanmichel
 

Elite updated

Postby ron&bram » 14.06.2008, 16:05

Hi,

Elite is running latest version from Hornby (1.3), unless they published a new version last night.

Regards,

Ronald
ron&bram
 

for the developers

Postby ron&bram » 14.06.2008, 17:24

As mentioned before,

I could read through the Elite using JMRI's locdecoder pro (1.6.0.6). I have made trail runs reading and writing cv's on the pt and captured the communication with a prot monitor. The result I have attached. I hope that the RR developers are able to make some sence/use of it.

Regards to all,
Ronald
Last edited by ron&bram on 14.10.2008, 20:41, edited 1 time in total.
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 RAFHAAA96 » 16.06.2008, 08:10

Hi all
Please disregard my post of the 13th to the RR city fathers.
Purely co-incedental with button pushes in RR the laptop goes to black screen.
This appears to be because the fan has died and the CPU is causing an overheat shutdown.
I am just about to go caravanning in France for 2 weeks so will not be able to repair it and confirm that it was the cause of the problem for a while, but I will report back later.
Thanks, Robbie
Regards Rob.
Halton Brat
OO gauge - Hornby Elite & eLink CS & Accessory Decoders - Win 8 - 64 bit.
RAFHAAA96
 

extra info for Jeanmichel help needed from other Elite owner

Postby ron&bram » 28.06.2008, 20:35

Jeanmichel,

I noticed something odd, now that I have added a booster with booster signal controlled through ddz. I now have to switch on (light bulb) in rocrail. With the ust the Elite I did not have to do that, commands were send regardless of the lightbulb being on or off.
Then I noticed, when switching off, very shortly the message e-stop appears on the Elite and then it switches back on (the booster stays off). Only very rarely the Elite also stays off. It almost looks like there is an echo on the line.
I do not have an interface to connect the Elite to the pc over xpressnet, I use the usb connection. If there is somebody out there that reads this, has an xpressnet interface to the pc and an Elite, would that somebody please be so kind to test what happens when a power off command is sned to the Elite not via the usb connection, but over the xpressnet bus and let me know.

Best ragards,
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
 

Please help software guru's

Postby ron&bram » 29.06.2008, 21:06

In my ongoing quest to get proper coorporation from my elite with rocrail I have spend some time on the www to find more port monitoring programs. I managed to find one that sniffs at the datatraffic and files it as a txt file with hex values.

So I went again; put a loco on the pt, started the serial sniffer on com6 and fired up decoderpro. I gave the command to read cv 1. Decoderpro send the following hex sequence to com6 (I'll forget all the ###'s):

22 15 01 36 21 10 31

Elite's response

63 14 01 05 73

and decoderpro:

21 81 a0

And when I do the same with rocrail, basically I see the same sequence BUT with one major difference, it is one long string. First six times 22 15 01 36, then six times 21 10 31 and finally six times 21 81 a0. No incoming traffic is recorded.

Now, question one; does rocrail try a transmission six times when it does not get the reply it expects and if yes, how can I change that to another number to investigate my idea (see question 2)?

question 2: could it be that the elite uses another mechanism then a proper Lenz to signal receipt of a message?

and question 3: iif question 2 is correct it must be in the hardware, since I do not capture anything on the data communication. Does anybody has an idea what it could be and how I could monitor that?

Looking forward to any comment, suggestion or help with my burning questions.

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
 

addendum to my previous post

Postby ron&bram » 29.06.2008, 21:30

That is what happens if you are enthousiastic and think you found something (like in my case a port monitor). You tell the port monitor to also record system events, but you forget to read the small print and don't tick anything in the picklist of system events to monitor. Then you write a reply in this post and after that, start thinking again. Attached is a file containing the monitored system events on com6 during rocrail and decoderpro startup. I can see clear differences in time-out values, Xon/Xoff and other specia character definitions and so on. The one thing I do not know, are these observations relevant and when so, how to correct them?

Any comments please.

Regards,
Ronald
Last edited by ron&bram on 14.10.2008, 20:43, edited 1 time in total.
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
 

Am I guessing right

Postby ron&bram » 30.06.2008, 12:52

Although I know something about computers, my mayor experience is with hardware and program languages for industrial control, like Siemens S7 and Foxboro I/A. I know very little about C, yet I downloaded the Lenz.c from rocrail/rocdigs/impl, revision 3155.

With some logic thinking I found the number of retries (5), which matches perfectly with my observation posted earlier of sequences being send 6 times to the Elite.

The way I read some other part of the code (the transactor part, line 816 onwards), after sending something, the program checks to see if it has been received, when yes, variable responceRecieved is set true, when not, command is send again after a wait and numtries is lowered. until either check is ok or numtries is zero.
One possbile answer of the cs is (line 949 of the code) #63 #21 -command station name-. From my serial sniffer log with decoderpro the response from the Elite is: #63 #14 #01.
Could it be so simple that the Elite's reponse is just a bit different in the second byte (the third byte would identify it as an LH200).

Programmers, Experts, what is your opinion to the above and what is possible to fix it (when somebody is willing to give me some hints and tips, I have no problem with following the entire procedure as described in "compiling for windows in 10 steps).

Best regards and to follow-up on Sergio's football post, for the Spanish rocrail users "felicitado con la victoria"

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, 13:30

Hi Ron,

ok, respect! your code observations are right! ;)

But:

From my serial sniffer log with decoderpro the response from the Elite is: #63 #14 #01.


is the answer for a programming task. It is handled around line 250, (SM response Direct CV mode).

I have no problem with following the entire procedure as described in "compiling for windows in 10 steps"


If you could set up a working build process under windows we can give it a try together.

Regards
Jean-Michel
jeanmichel
 

Thanks

Postby ron&bram » 30.06.2008, 16:40

Hello Jeanmichel,

Thanks for your reply and compliment.

I see what you mean about the response sequence #63 #14:

is the answer for a programming task. It is handled around line 250, (SM response Direct CV mode).


Am I right in my assumption that the code part starting at line 816 (all line references for version 3155) with:

static void __transactor

is the general code that is taking care of sending communication to the command station?
When wanting to read cv 1, a system command is issued (line 713); a block of 256 bytes is defined (outa), byte 0 contains #22, byte 1 #15, byte 2 #1. Transactor is called with outa as parameter.
Transactor then sends the bytes to and reads an answer from the serial port. The xor value for the number of read bytes is calculated, when not equal to the last byte read, error message xor not equal, continue. Then the content of the first byte read is used to determine the type of answer from the command station. When this could be done, the variable responceRecieved is set to true, when not, the proces is repeated for max. the value of numtries. the final result is always send via __evaluateResponse.
Next outb is filled with #21 #10 #31 and the whole procedure is repeated.
Finally comes outc with #21 #81 #A0.

Am I correct in my "limping through C code" proces thinking?

Regards,
Ronald

P.S.
Will try to do the 10 step procedure tonight, results to follow on this board.
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, 17:10

Hi,

Am I correct in my "limping through C code" proces thinking?


Somehow ... :) in real it is a little bit more tricky ...

In short (without correct syntax ... ):

line 1022 (svn3158) is the starting point for commands from rocgui. These are send to translate(...), nodeA is holding the structure.

In translate the command is translatet to the XpressNet format and sendet to a queue ThreadOp.post( ...);

in the method transactor( ) is a loop and inside the commands are fetched from the queue, and sended out using sendRequest(...).

Then we give the CS some time to a answer, and are reading the result. If the Answer is negative (cs busy) we try again 5 times, otherwise the next one is fetched.

Everytime we send the answer to evaluateResponse(...) and there the answer is translated back to a node and evaluated by rocrail.

What you can do for your turnout problem:
The commands for the turnouts are generated in the if statement line 454. There you can try to play around in the else part (not singlegate) and put the if(!data->elite) around the deactivate block.

But the code is fragile, don't cry if something is not working :)

Regards
Jean-Michel
jeanmichel
 

PreviousNext

Return to Hornby Elite