Automatic recognition of mfx id with CS2 & Gleisbox

Märklin Central Station 2

Re: Automatic recognition of mfx id with CS2 & Gleisbox

Postby Niklas01 » 02.10.2015, 15:03

Hey John,

are you using a MS1? On my CS2 i get following INVALID packets when i plug in a MS1:
Code: Select all
15:43:36 INVALID packet; CAN hash value: 0x2883
15:43:36 INVALID packet; PRIO byte contains too high value: prio=0x18


But (nearly) everything else works fine. Just with 3-way-turnouts i get the following Message:
Code: Select all
15:47:53 INVALID packet; command value: CAN-ID=0x61

@ Bert:
Do you think you can fix it? Do you need an other trace-level?

edit: I was not able to find a documentation about the CAN-ID 0x61. :(
So it's maybe not possible to solve the problem. (Well, the problem is just the message, nothing more).

Best regards,
Niklas
You do not have the required permissions to view the files attached to this post.
Viele Grüße / Best regards Niklas
MCS2, PC mit Win10/Linux Mint 18
Niklas01
 

Re: Automatic recognition of mfx id with CS2 & Gleisbox

Postby woodyboy » 02.10.2015, 21:24

Rob, would you be so kind to merge the attachment?

Hi Niklas,

The invalid reported 0x61 packet type should be solved by the patch in the attachment. I can't remember what it means, but I must have seen this before. Because packet 0x60 was explicitly marked as valid in the code, now 0x60 and 0x61 are both valid. To determine if it is possible to detect a MS1 attached to a CS2, it is necessary to get a trace containing an error message. In the attached trace I can't find a such a packet.
You do not have the required permissions to view the files attached to this post.
Regards,

Bert

Equipment: Roco WLANMaus, MS2, Gleisbox 2x(separated switch & rollingstock). Ubuntu 16. Edits booster. Arduino: S88 CANbus interface & Ethernet-CANbus gateway
woodyboy
 

Re: Automatic recognition of mfx id with CS2 & Gleisbox

Postby John Hoek » 03.10.2015, 12:43

Hi Niklas,
I don't have a ms1... Only a ms2 connected to the gleisbox. And now a cc-schnitte to connect to my pc.
Before is used the arduino-ethernet-CANbus electronischs, but there i had the same errors....
The cc-schnitte just passes al can frames to the gleisbox. Nothing more.

But the errors you see are exacty the ones i get also. Despite this it looks that everything still works fine... But the errors annoy me. Alway CAN hash valur, with PRIO byte contains too high value.. Etc. Etc.

CODE: ALLES AUSWÄHLEN
15:43:36 INVALID packet; CAN hash value: 0x2883
15:43:36 INVALID packet; PRIO byte contains too high value: prio=0x18


Remark: the CAN hash value nr could be different; and the pRIO code also; but the error is basicly te same.
John Hoek
 

Re: Automatic recognition of mfx id with CS2 & Gleisbox

Postby woodyboy » 03.10.2015, 14:21

John,

The errors reports/look the same but are totally different. 2883 is a valid MS1 CAN frame but isn't a valid CS2 frame. Thats just the difference between the MS1 and MS2 format. Analyzing the log it is possible to recognize shifted packets which are partial overwritten with another frame. The marked invalid frames in your uploaded trace are invalid without doubt:
Code: Select all
    offset:   00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F |ASCII...........|
    --------------------------------------------------------- |----------------|
    00000000: D7 00 00 00 00 00 00 00 00 00 00 00 00          |.............   |
20040908.032336.168 r9999E gbxreade OMCS2    2287 INVALID packet; PRIO byte contains too high value: prio=0xD7
20040908.032336.168 r9999E gbxreade OMCS2    2291 INVALID packet; CAN hash value: 0x0000


If the data is corrupted in the cc-schnitte or in the computers fifo buffer that is impossible to determine from here.
Regards,

Bert

Equipment: Roco WLANMaus, MS2, Gleisbox 2x(separated switch & rollingstock). Ubuntu 16. Edits booster. Arduino: S88 CANbus interface & Ethernet-CANbus gateway
woodyboy
 

Re: Automatic recognition of mfx id with CS2 & Gleisbox

Postby Niklas01 » 04.10.2015, 14:49

Hi Bert,
woodyboy wrote:To determine if it is possible to detect a MS1 attached to a CS2, it is necessary to get a trace containing an error message. In the attached trace I can't find a such a packet.


of course, it was just a Trace for the 0x61-Problem. Now that's working fine.

Attached the traces with a plugged in MS1.
In the next days I won't be online. So I'm not able to do new tests until Friday.

Niklas
You do not have the required permissions to view the files attached to this post.
Viele Grüße / Best regards Niklas
MCS2, PC mit Win10/Linux Mint 18
Niklas01
 

Re: Automatic recognition of mfx id with CS2 & Gleisbox

Postby woodyboy » 06.10.2015, 21:56

Rob,

Would you be so kind to merge the attachment in the repository? The attachment contains a fix to ignore the heartbeat between the MS1 and CS2 in CS1 format as invalid packets.

@Niklas, analyzing the trace only heartbeat packets are logged. If you still get warnings when sending commands from the MS1, then the CAN bus is shared for the MS1 and CS2 format. In that case I will create a new patch.
You do not have the required permissions to view the files attached to this post.
Regards,

Bert

Equipment: Roco WLANMaus, MS2, Gleisbox 2x(separated switch & rollingstock). Ubuntu 16. Edits booster. Arduino: S88 CANbus interface & Ethernet-CANbus gateway
woodyboy
 

Re: Automatic recognition of mfx id with CS2 & Gleisbox

Postby rjversluis » 07.10.2015, 05:50

Hi Bert,

I just merged it.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: Automatic recognition of mfx id with CS2 & Gleisbox

Postby Niklas01 » 10.10.2015, 09:55

Hey Bert,

there are still more errors: (those packets were not in the last trace)
Code: Select all
10:46:09 INVALID packet; CAN hash value: 0x2502
10:46:09 INVALID packet; PRIO byte contains too high value: prio=0x18
10:46:09 INVALID packet; CAN hash value: 0x2503
10:46:07 INVALID packet; CAN hash value: 0x2502
10:46:07 INVALID packet; PRIO byte contains too high value: prio=0x18
10:46:07 INVALID packet; CAN hash value: 0x2503
10:46:03 INVALID packet; CAN hash value: 0x0D02
10:46:03 power off, freeze clock
10:46:03 INVALID packet; CAN hash value: 0x0D03
10:46:02 INVALID packet; CAN hash value: 0x0D02
10:46:02 INVALID packet; CAN hash value: 0x0D03
10:45:54 INVALID packet; CAN hash value: 0x0D02
10:45:52 INVALID packet; CAN hash value: 0x0D02


Attached a byte-trace. Thanks in advance!
Niklas
You do not have the required permissions to view the files attached to this post.
Viele Grüße / Best regards Niklas
MCS2, PC mit Win10/Linux Mint 18
Niklas01
 

Re: Automatic recognition of mfx id with CS2 & Gleisbox

Postby woodyboy » 14.10.2015, 21:06

Dear Forummembers,

Attached a new version of the mgbox library which should ignore error detecting in case Maerklin protocol version 1 is present on a CS2 CAN bus.

@Rob, would you be so kind to merge the attached files? Files are tested with the sources of 14 Oct 21:00.
You do not have the required permissions to view the files attached to this post.
Regards,

Bert

Equipment: Roco WLANMaus, MS2, Gleisbox 2x(separated switch & rollingstock). Ubuntu 16. Edits booster. Arduino: S88 CANbus interface & Ethernet-CANbus gateway
woodyboy
 

Re: Automatic recognition of mfx id with CS2 & Gleisbox

Postby Niklas01 » 15.10.2015, 17:42

Hi,

it's working great now. Thanks a lot :D
Viele Grüße / Best regards Niklas
MCS2, PC mit Win10/Linux Mint 18
Niklas01
 

Re: Automatic recognition of mfx id with CS2 & Gleisbox

Postby woodyboy » 17.11.2015, 22:08

Dear Forummembers,

Attached a new version of the mgbox library improvements:
A fix for a Gleisbox with a UID at boottime < 0x2000
Preventing locomotives, equipped with a classic decoder, rushing to drive away for about 0,5 sec during boot of the Gleisbox with a booster attached leaving the stored occupancy status invalid.

@Rob, would you be so kind to merge the attached files? Files are tested with the sources of 17 Nov 20:00.
You do not have the required permissions to view the files attached to this post.
Regards,

Bert

Equipment: Roco WLANMaus, MS2, Gleisbox 2x(separated switch & rollingstock). Ubuntu 16. Edits booster. Arduino: S88 CANbus interface & Ethernet-CANbus gateway
woodyboy
 

Re: Automatic recognition of mfx id with CS2 & Gleisbox

Postby woodyboy » 21.11.2015, 23:29

Dear Forummembers,

Attached a new version of the mgbox library improvements:
A fix for a mixing up MS2 devices in case multiple controllers
System detection of the CAN bus configuration cleanup/improvement at startup.

@Rob, would you be so kind to merge the attached files? Files are tested with the sources of 21 Nov @ noon
You do not have the required permissions to view the files attached to this post.
Regards,

Bert

Equipment: Roco WLANMaus, MS2, Gleisbox 2x(separated switch & rollingstock). Ubuntu 16. Edits booster. Arduino: S88 CANbus interface & Ethernet-CANbus gateway
woodyboy
 

Re: Automatic recognition of mfx id with CS2 & Gleisbox

Postby bertc3p0 » 22.11.2015, 19:41

Hi Bert,
woodyboy wrote:Dear Forummembers,

Attached a new version of the mgbox library improvements:
A fix for a mixing up MS2 devices in case multiple controllers
System detection of the CAN bus configuration cleanup/improvement at startup.

@Rob, would you be so kind to merge the attached files? Files are tested with the sources of 21 Nov @ noon

i have a problem with the new version (MGBOX using ethernet):

Code: Select all
root@BananaPi:/opt/rocrail# ./rocrail -nodevcheck
   --                     
  / /  (_)__  __ ____  __
 / /__/ / _ \/ // /\ \/ /
/____/_/_//_/\_,_/ /_/\_\
--------------------------------------------------
                                            lll   
                                        iii lll   
                                            lll   
 rrrrrr   ooooo   ccccc rrrrrr   aaaaaa iii lll   
 rrr rrr ooo ooo ccc    rrr rrr aaa aaa iii lll   
 rrr     ooo ooo ccc    rrr     aaa aaa iii lll   
 rrr      ooooo   ccccc rrr      aaaaaa iii  lll 
--------------------------------------------------
 TM and Copyright 2002-2015 Robert Jan Versluis.
 All Rights Reserved.
   r.j.versluis@rocrail.net
   http://www.rocrail.net
--------------------------------------------------
 Rocrail 10184 [57ae2212617c1a853b565597e961bc7ca7b64d4d]
 Build: Nov 22 2015 18:22:32
 librocs 2.0-0 build Nov 22 2015 18:22:20
 processid = 2128
       mac = 02030A4306440200
--------------------------------------------------
...
20151122.193112.699 r9999I main     OMCS2    2856 ----------------------------------------
20151122.193112.699 r9999I main     OMCS2    2857 MGBOX 2.0.0
20151122.193112.699 r9999I main     OMCS2    2858 ----------------------------------------
20151122.193112.699 r9999I main     OMCS2    2859   s88 modules      [0]
20151122.193112.700 r9999I main     OMCS2    2860   version          [0]
20151122.193112.700 r9999I main     OMCS2    2861   sensor device ID [0]
20151122.193112.700 r9999I main     OMCS2    2862   command pause    [10]ms
20151122.193112.700 r9999I main     OMCS2    2863   sensor range     [0-0]
20151122.193112.700 r9999I main     OMCS2    2864   hash             [0x2F20]
20151122.193112.700 r9999I main     OMCS2    2866   system info      [yes]
20151122.193112.701 r9999I main     OMCS2    2867   discovery        [yes]
20151122.193112.701 r9999I main     OMCS2    2868   bind             [yes]
20151122.193113.033 r9999I main     OMCS2    2869   report state     [yes]
20151122.193113.033 r9999I main     OMCS2    2873   sublib           [default]
20151122.193113.033 r9999I main     OMCS2    2879   udp address      [127.0.0.1]
20151122.193113.033 r9999I main     OMCS2    2880   udp tx port      [15731]
20151122.193113.034 r9999I main     OMCS2    2881   udp rx port      [15730]
20151122.193113.034 r9999I main     OMCS2    2882 ----------------------------------------
...
20151122.193113.135 r9999c mgboxsvc OMCS2    2622 No CS2/MS2 CAN devices detected on iid: Gbox2, sending boot to standalone Gleisbox
20151122.193114.035 r9999I fbreader OMCS2    0706 MCS2 feedbackpoll started, polling 0 S88 units
20151122.193114.385 r9999I fbreader OMCS2    0719 feedbackpoll ended.
20151122.193115.436 r9999I mgboxsvc OMCS2    2625 mcs2gfpUID: 0x00000000  mcs2guiUID: 0x00000000 ms2UID: 0x00000000 gbUID: 0x00000000 on interface: Gbox2
20151122.193116.136 r9999E mgboxsvc OMCS2    2660 CANbus device error, no MS2 / Gleisbox detected on interface: Gbox2

The CAN-Bus doesn't have any problem and I see the packets:
Code: Select all
root@BananaPi:~# ip -s -d link show can0
4: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 10
    link/can  promiscuity 0
    can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
     bitrate 250000 sample-point 0.875
     tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
     sun4i_can: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1
     clock 24000000
     re-started bus-errors arbit-lost error-warn error-pass bus-off
     0          0          0          0          0          0         
    RX: bytes  packets  errors  dropped overrun mcast   
    459        77       0       0       0       0       
    TX: bytes  packets  errors  dropped carrier collsns
    389        87       0       0       0       0     

 (2015-11-22 19:31:13.046014)  can0  TX - -  00302F20   [0]
 (2015-11-22 19:31:13.046609)  can0  RX - -  0031533C   [8]  47 43 7B 11 01 27 00 10
 (2015-11-22 19:31:13.137509)  can0  TX - -  00362F20   [0]

IMHO this is related to last change - the old one worked fine.

Could you have look at this ?

Thx and have a nice weekend

Gerd
bertc3p0
 

Re: Automatic recognition of mfx id with CS2 & Gleisbox

Postby woodyboy » 22.11.2015, 21:59

Gerd,

Can you upload a trace with info and byte level enabled from start during the first 10 seconds. Two cases one with a booted Gleisbox and one with an unbooted Gleisbox (power cycled but no MS2 attached).

The current log is to small to determine the error.
Regards,

Bert

Equipment: Roco WLANMaus, MS2, Gleisbox 2x(separated switch & rollingstock). Ubuntu 16. Edits booster. Arduino: S88 CANbus interface & Ethernet-CANbus gateway
woodyboy
 

Re: Automatic recognition of mfx id with CS2 & Gleisbox

Postby bertc3p0 » 22.11.2015, 23:23

Hi Bert,
woodyboy wrote:Gerd,

Can you upload a trace with info and byte level enabled from start during the first 10 seconds. Two cases one with a booted Gleisbox and one with an unbooted Gleisbox (power cycled but no MS2 attached).

The current log is to small to determine the error.


sorry for the noise - your patch is fine. I switched back to a known good version and saw the same malfunction. So it was clear, that the root cause is not the Rocrail module. For any reason the packets were dropped and didn't reached Rocrail. I reinstalled Rocrail and rebooted - and voila everything is working.

Anyway thanks for your support and keep up the good work :thumb_up:

Gerd
bertc3p0
 

PreviousNext

Return to CS2