Welcome to the forum   
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Share
Options
View
Go to last post in this topic Go to first unread post in this topic
Offline osoraku  
#1 Posted : 26 December 2025 19:28:29(UTC)
osoraku

Portugal   
Joined: 22/01/2025(UTC)
Posts: 104
Location: Setubal, Palmela
Dear All -

A few weeks ago, dave55uk mentioned an interaction between two MS2s that I'd never heard of previously. He said,

Quote:

3. Yes, you can connect a second MS2 to the trackbox, as I have done. One of them will be the 'Master' and operate normally.
The other one will be the 'slave' and when you select a loco, there will be a short pause, then it will load the details for that
loco from the 'Master'. Then you're good to go. And yes, both controllers can have the same loco selected and you can control
that loco from either controller.

The 'Master' will be the one with the LOWEST serial number - the bottom number on the silver sticker on the back of the MS2.


I would like to know the digital details of this interaction. By digital, I mean that the only way that the two MS2s can communicate is over the CAN bus connecting them to the gleisbox that they are both attached to. Consequently, there must be undocumented commands in Marklin's CS2 protocol that allows one MS2 to query the other to download loco information (name, address, protocol, etc.) I'm familiar with the public documentation for the CS2 protocol, but this interaction is not described anywhere in it.

Does anybody have a CAN bus trace of this happening that they could share? Or a link to another forum where it is described? I would like to incorporate it into a program that I'm developing to run my own layout.

Osoraku
thanks 2 users liked this useful post by osoraku
Online dave55uk  
#2 Posted : 26 December 2025 22:12:55(UTC)
dave55uk

United Kingdom   
Joined: 15/09/2023(UTC)
Posts: 145
Location: Ely, England
Watching this even though the digital details will be way above my head LOL
thanks 2 users liked this useful post by dave55uk
Offline dsinn  
#3 Posted : 07 January 2026 18:31:56(UTC)
dsinn

United States   
Joined: 06/05/2024(UTC)
Posts: 4
Location: Washington, Seattle
Originally Posted by: osoraku Go to Quoted Post
Dear All -

A few weeks ago, dave55uk mentioned an interaction between two MS2s that I'd never heard of previously. He said,

Quote:

3. Yes, you can connect a second MS2 to the trackbox, as I have done. One of them will be the 'Master' and operate normally.
The other one will be the 'slave' and when you select a loco, there will be a short pause, then it will load the details for that
loco from the 'Master'. Then you're good to go. And yes, both controllers can have the same loco selected and you can control
that loco from either controller.

The 'Master' will be the one with the LOWEST serial number - the bottom number on the silver sticker on the back of the MS2.


I would like to know the digital details of this interaction. By digital, I mean that the only way that the two MS2s can communicate is over the CAN bus connecting them to the gleisbox that they are both attached to. Consequently, there must be undocumented commands in Marklin's CS2 protocol that allows one MS2 to query the other to download loco information (name, address, protocol, etc.) I'm familiar with the public documentation for the CS2 protocol, but this interaction is not described anywhere in it.

Does anybody have a CAN bus trace of this happening that they could share? Or a link to another forum where it is described? I would like to incorporate it into a program that I'm developing to run my own layout.

Osoraku


Would that not be the same thing that happens with the new MS2 software connecting to a CS2/CS3? Upon boot they resync from the "master" the set of loco's they are aware of and recopy down the settings of each. Or put another way, they are just re-adding the loco's from the "master" so they have the most current settings for each loco they are configured with.
thanks 1 user liked this useful post by dsinn
Offline osoraku  
#4 Posted : 09 January 2026 14:39:05(UTC)
osoraku

Portugal   
Joined: 22/01/2025(UTC)
Posts: 104
Location: Setubal, Palmela
Dear dsinn -

Yes, you're right that the only way an MS2 plugged into a CS2/CS3 can interact is over the CAN bus. Hence the CS2 protocol governs their loco data exchange too. However, that part of the protocol is not completely documented by Marklin, particularly "Anfordern Config Data" (0x20) and "Config Data Stream" (0x21). (Some old threads on the topic are in this forum, but lack details.) I'm observing the interactions between MS2s and figuring out how it works. When done, I hope to distill what I found and report how this works here. (Unless you already know and can spare me the effort of working it out!)

Osoraku

Edited by user 15 January 2026 11:14:04(UTC)  | Reason: Used correct codes not CAN IDs

thanks 1 user liked this useful post by osoraku
Offline osoraku  
#5 Posted : 14 January 2026 19:43:39(UTC)
osoraku

Portugal   
Joined: 22/01/2025(UTC)
Posts: 104
Location: Setubal, Palmela
Dear All -

Here's a brief summary of the MS2 - MS2 interaction. For full details (annotated trace of the exchange), see the attachment. Recall that all of the devices are attached through the CAN bus connecting them to the CS2/CS3 or to a Gleisbox.

A key command used by the MS2s (probably CS2/CS3s, too) is the "Anfordern Config Data (0x20)" command (ACD for short henceforth). The ACD command is followed by a response as a "Config data stream (0x21)" that all other agents connected to the CAN bus can read and use to update their internal state. Hence, the config data stream is never flagged as a response packet according to the Märklin CS2 v 2.0 protocol document.

The boot process starts with the master MS2 (lowest serial number MS2) issuing a CAN BOOT command. The Gleisbox responds. A SYSTEM STOP is issued, presumably for safety. Then another slightly different CAN BOOT command is issued to the Gleisbox to tell it to start.

The master MS2 sends a PING to discover other MS2s, followed by another general CAN BOOT and SYSTEM STOP. Then the master queries the other MS2 about its onboard files (an ACD "ms2-conf" inquiry). The ACD response is a config data stream labeled [config]. Next, the master MS2 asks the other MS2 what files it has (akin to a Windows dir command / Unix ls command). The response is a [files] data stream.

Loco information can only be changed on the master MS2. When it is, it is automatically rebroadcast to all other devices by a config data stream with the [lokliste] identifier.

When a loco is selected by an MS2 that is not the master, it asks the master for an update of the loco's properties. This interaction is an ACD inquiry for "lokinfo xxxx" where xxxx is the loco name. The response is a config data stream labeled, [lokomotive]. It contains all the info about the loco (name, functions, MFX UID, etc.)

The [config], [files] and [lokliste] are not documented data streams. [lokomotive] is, however, in Sec. 8.1 of the protocol document.

Sorry, not so brief (but compared to the attachment, it is).

Osoraku

Attachment (updated): MS2-MS2-log.pdf (54kb) downloaded 4 time(s).

Edited by user 15 January 2026 11:11:28(UTC)  | Reason: Uniformly referred to master MS2; updated attachment

thanks 3 users liked this useful post by osoraku
Offline osoraku  
#6 Posted : 15 January 2026 12:41:04(UTC)
osoraku

Portugal   
Joined: 22/01/2025(UTC)
Posts: 104
Location: Setubal, Palmela
Dear All -

FYI, here are the guts of a 60122 used to connect up to 5 MS2s to one gleisbox DIN9 outlet. Not much inside except for connectors. It is a CAN bus expander, essentially.



Osoraku

Edited by user 16 January 2026 00:02:19(UTC)  | Reason: Not Aston Martin, Deutsches Institut für Normung!

thanks 1 user liked this useful post by osoraku
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

| Powered by YAF.NET | YAF.NET © 2003-2026, Yet Another Forum.NET
This page was generated in 0.463 seconds.