[Solved] Serial connection terminated Elektor DCC

dhadzi
Posts: 20
Joined: 07.01.2012, 22:43
Location: Pozarevac, Serbia

[Solved] Serial connection terminated Elektor DCC

Post by dhadzi » 18.10.2012, 18:33

Why is this happening? If the Rockview Power switch off, after the serial timeout expiry connection is terminated (Error on mutex trywait). During normal operation, all works flawlessly. :roll: :?:
Control Station - Elektor DCC Command Station - Intellibox compatible P50x (a, b) by Patrick Smout.

Thanks, Dusan
You do not have the required permissions to view the files attached to this post.

derookamer

Post by derookamer » 18.10.2012, 19:25

Rob

could it be that the problem is the Intellibox ?

20121008.170308.812 r9999I clocktic OControl 1344 new clock event 17:03.08
20121008.170308.187 r9999I cmdr027C OClntCon 0269 monitoring for client is on
20121008.170308.187 r9999W cmdr027C OSystem 0520 invalid key
20121008.170308.187 r9999I cmdr027C OModel 2210 no valid donation key found
20121008.170309.328 r9999I statread OP50x 0635 Version info requested...
20121008.170309.343 r9999I statread OP50x 0743 Intellibox version --- 1.015 ---
20121008.170309.343 r9999I statread OP50x 0755 Intellibox serial# --- 9999999999 ---
20121008.170311.046 r9999I cmdr027C OModel 2272 Sending 19 fstats to client...
20121008.170408.890 r9999I clocktic OControl 1344 new clock event 17:04.08
20121008.170413.296 r9999E fbreader OMutex 0096 Error on mutex trywait. [0] [OK]
20121008.170414.328 r9999E 00000600 OMutex 0096 Error on mutex trywait. [0] [OK]
20121008.170414.328 r9999E 000006A0 OMutex 0096 Error on mutex trywait. [0] [OK]


br

fred

Patrick Smout

Post by Patrick Smout » 23.10.2012, 06:54

Hi,

I'm the developer of the command station and currently investigating the problem described above. I'm not an RocRail expert nor user, but I did find a strange behavior that I cannot explain.
FYI, the command station works flawlessly with Koploper and RR&Co (same protocol).

I've installed RocRail-4180 and did a few tests (P50x protocol / 9600Bd)
I was only able to see communication for a very short period.
I'm not able to switch on track power.

The communication log between the command station and RocRail server shows some strange things.
A message that is send from the RocRail server seems to be too short (only 1 byte instead of 3). Seems to be that the the parameter for the first byte send (0x94 / XTrntSts) are missing?

It would be great if somebody could send me a log of the startup session between P50x command station and RocRail server.

I've pasted the log below:

__________________________________________________________

0121022.213720.879 r9999B fbreader OP50x 0158 outsize=1 insize=40 inendbyte=0xFFFFFFFF
20121022.213720.879 r0000B fbreader (null) *trace dump( 0x0337FE10: length=1 )
offset: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F |ASCII...........|
--------------------------------------------------------- |----------------|
00000000: 94 |. |
20121022.213720.879 r9999B fbreader OP50x 0199 insize=40, inendbyte=0xFFFFFFFF
20121022.213720.941 r9999I 5502 OLoc 1285 Runner for "5502" started.
20121022.213721.706 r9999I clocktic OControl 1349 new clock event 21:37.21
20121022.213723.702 r9999E statread OMutex 0096 Error on mutex trywait. [0] [OK]
20121022.213725.715 r9999E statread OMutex 0096 Error on mutex trywait. [0] [OK]
20121022.213726.916 r9999E fbreader OSerial 0399 Timeout on serial read[com5] 0 of 40 read.[rc=0] tries=3
20121022.213726.916 r9999W fbreader OP50x 0225 unable to read 40 bytes
20121022.213726.916 r9999E fbreader OP50x 0235 ERROR in transact!!! rc=0 state=RCVERR

20121022.213726.916 r9999E 00000EF0 OControl 0953 Read error.
__________________________________________________________
*** XTrntSts (094h) - length = 1+2 bytes
Parameters (byte):
1st low byte of Turnout address
2nd high byte of Turnout address

__________________________________________________________


Kind regards,

Patrick Smout

rjversluis
Site Admin
Posts: 42306
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Post by rjversluis » 23.10.2012, 07:24

Hi Patrick,

did you setup the protocol like this:
http://wiki.rocrail.net/doku.php?id=int ... p_for_p50x
Protocol
In basic setup go to “Interface” and then select:
Syntax: 6050 & IB (“IB only” would not work)

Patrick Smout

Post by Patrick Smout » 23.10.2012, 10:41

Hi Rob,

thanks for the feedback. I've tagged the page and will sort it out later today.

Anyhow, still quite strange that only 0x94 is send? Is this an old 6050 command?

kind regards,

Patrick

rjversluis
Site Admin
Posts: 42306
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Post by rjversluis » 23.10.2012, 10:47

Hi Patrick

0x94 is not send but received in the fbreader thread:

Code: Select all

20121022.213720.879 r0000B fbreader (null) *trace dump( 0x0337FE10: length=1 ) 
offset: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F |ASCII...........| 
--------------------------------------------------------- |----------------| 
00000000: 94 |. | 

LDG
Site Admin
Posts: 2701
Joined: 18.10.2010, 00:03
Location: near Karlsruhe/Germany

Post by LDG » 23.10.2012, 11:01

Hi Patrick,

perhaps the problem ist the version request (or the answers to that request :!: ).
What is your Software sending back as answer(s) to a Version Request ('x'+0xA0)? How many lines? Which format to interprete the lines that are sent back?
Background: Currentlty we handle 5 different answer-types (in p50x-mode) to distinguish between IB, OpenDCC or TamsMC on the other side. Then we can decide if we can use extendend function commands (read 28 functions).

Regards,
Lothar

Patrick Smout

Post by Patrick Smout » 23.10.2012, 18:24

Hi,

I managed to get the communcation running when I set the number of sensors to 0.

@Rob,

you're right, 0x94 is a received byte. I overlooked that. Can I also turn on logging for transmitted bytes?

Kind regards,

Patrick

Patrick Smout

Post by Patrick Smout » 24.10.2012, 19:49

Hi Rob,

I've listened the communication between rocrail and the station using an standalone RS232 sniffer and can conclude that:

1) Type of controller is P50
2) If number of sensors in controller P50x config is 0, communication is working properly.
Command startup sequence:
SVR-> DCC CMD: 78 C4
DCC CMD -> SVR: 00
SVR-> DCC CMD: 78 A0
DCC CMD -> SVR: 02 22 10 02 00 00 01 00 01 00 01 01 05 99 99 99 99 99
SVR-> DCC CMD: 78 A2
DCC CMD -> SVR: 00
SVR-> DCC CMD: 78 CA
DCC CMD -> SVR: 00
SVR-> DCC CMD: 78 C9
DCC CMD -> SVR: 80

Previous 3 commands are now endlessly repeated (normal behavior)
________________________________________________________

3) If number of sensors in controller P50x config is 20, communication fails. 0x94 is transmitted by the RocRail server to the station!! (illegal command??) - no response from the station

Command startup sequence:
SVR-> DCC CMD: 94
DCC CMD -> None (timeout)
SVR-> DCC CMD: 78 A2
DCC CMD -> SVR: 00
SVR-> DCC CMD: 78 CA
DCC CMD -> SVR: 00
SVR-> DCC CMD: 78 C9
DCC CMD -> SVR: 80

Previous 4 commands (including illegal one) are endlessly repeated).

Anyone who can tell me where the 0x94 (illegal) command originates from?

Patrick Smout

Post by Patrick Smout » 24.10.2012, 20:04

If I select TAMSMC as controller, everything seems to work quite fine (with and without sensors)

Quite strange behavior for P50x controller type.

I'll ask the poster to do a test on his layout with the TAMSMC as controller.

kind regards,

Patrick

Patrick Smout

Post by Patrick Smout » 24.10.2012, 21:14

I've sorted it out.

THe 0x94 command is a P50 command that reads feedback (S88) modules:

read n s88 modules till the indicated module (0x80+n)
129 " reads only the first feedback module
159 " reads all 31 feedback modules
The Interface replies with 2 bytes per module, showing the status of the inputs
from 1-16

The command is not implemented in my station.

It's quite strange that the P50x controller uses the old P50 command to retrieve feedback status. Why not using the P50x command XSensor (0x98)?

kind regards,

Patrick

rjversluis
Site Admin
Posts: 42306
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Post by rjversluis » 24.10.2012, 21:20

Hi Patrick,

the poll option activates the P50 like s88 reading; Just uncheck this option if you do not need/want it.

http://wiki.rocrail.net/doku.php?id=int ... p_for_p50x
The poll checkbox should be left unchecked for better performance. This is a work around for Tams Easy Control.
The Poll option starts reading sensors in the p50 way, Märklin 6050/6051, which is not needed for the IB because it provides 'events' for this.

dhadzi
Posts: 20
Joined: 07.01.2012, 22:43
Location: Pozarevac, Serbia

Post by dhadzi » 24.10.2012, 21:42

Hi Patrick,
I have tested setting as Tams but problem remain.

Regards
You do not have the required permissions to view the files attached to this post.

Patrick Smout

Post by Patrick Smout » 25.10.2012, 19:51

Hi Rob,

thanks for the feedback. I guess next time I should take the time to read the manual ... :wink:

Kind regards,

Patrick

Patrick Smout

Post by Patrick Smout » 25.10.2012, 20:00

Hi Rob,

is it possible to turn on logging of / make visible the bytes that are send by RocRail?
Dusan is still having problems with the communication but I'm unable to reproduce it herer. It would be a great help if I knew what command is send to the station.

Kind regards,

Patrick

Post Reply

Return to “P50 and P50x”