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 fosuna  
#1 Posted : 18 February 2021 07:27:43(UTC)
fosuna

Spain   
Joined: 14/04/2015(UTC)
Posts: 58
Hi everyone!

I am developing a program to connect my PC to a Central Station through the TCP protocol.

Does anyone knows which ports use the Central Station to receive TCP packages? Is this documented by Märklin?

I have seen that the VPC Viewer software uses the port 5900. But I do not know if this port is reserved only for its use with the CS3 Screen Server.

What I want is that my program searches automatically for a Central Station that is on and connected to my local network. The idea is to send a TCP broadcast message to the local network, to the specified port.

If someone could help me, I would appreciate it. Thanks in advance.

Francisco
Francisco Osuna
https://fosuna.net
Offline clapcott  
#2 Posted : 18 February 2021 08:10:35(UTC)
clapcott

New Zealand   
Joined: 12/12/2005(UTC)
Posts: 2,433
Location: Wellington, New_Zealand
Point to your CS2 with a browser (to access the internal webserver) for the latest CAN over ethernet
failing that, here is the Marklin link for an old version but the port info is valid

https://www.maerklin.de/...S2_can-protokoll_1-0.pdf

The ports are UDP
TCP is for communication with a CS1 but that requires you spoof a CS1s registration into the CS2

Peter
thanks 2 users liked this useful post by clapcott
Offline fosuna  
#3 Posted : 18 February 2021 16:21:24(UTC)
fosuna

Spain   
Joined: 14/04/2015(UTC)
Posts: 58
Originally Posted by: clapcott Go to Quoted Post
Point to your CS2 with a browser (to access the internal webserver) for the latest CAN over ethernet
failing that, here is the Marklin link for an old version but the port info is valid

https://www.maerklin.de/...S2_can-protokoll_1-0.pdf

The ports are UDP
TCP is for communication with a CS1 but that requires you spoof a CS1s registration into the CS2



Hi Peter (clapcott)!

Thanks for your answer. It helped me a lot. I did what I wanted using UDP.

I am actually using a CS3+, and logging into it with my browser, there is no CAN over ethernet information. At least I can't find any inside the Help menu options. I know the document you are refering to, and as you quote, it is a bit out of update. It lacks updated information.

Greetings from Spain,

Francisco
Francisco Osuna
https://fosuna.net
Offline French_Fabrice  
#4 Posted : 18 February 2021 19:17:40(UTC)
French_Fabrice

France   
Joined: 16/05/2011(UTC)
Posts: 1,475
Location: Lyon, France
Hello

Look there: https://wiki.rocrail.net/doku.php?id=mbus:mbus-en ; there is a download link to version 2 of can protocol.

Cheers
Fabrice
Offline fosuna  
#5 Posted : 20 February 2021 07:10:50(UTC)
fosuna

Spain   
Joined: 14/04/2015(UTC)
Posts: 58
Originally Posted by: French_Fabrice Go to Quoted Post
Hello

Look there: https://wiki.rocrail.net/doku.php?id=mbus:mbus-en ; there is a download link to version 2 of can protocol.

Cheers
Fabrice


Hello Fabrice!

Thanks for your post. I've got this document. Unfortunately, it is almost from a decade ago and I think it also lacks information. Or maybe I do not find it because of my still poor German.

Good weekend for everybody!

Francisco


Francisco Osuna
https://fosuna.net
Offline kiwiAlan  
#6 Posted : 20 February 2021 13:25:46(UTC)
kiwiAlan

United Kingdom   
Joined: 23/07/2014(UTC)
Posts: 8,082
Location: ENGLAND, Didcot
Originally Posted by: fosuna Go to Quoted Post
Originally Posted by: French_Fabrice Go to Quoted Post
Hello

Look there: https://wiki.rocrail.net/doku.php?id=mbus:mbus-en ; there is a download link to version 2 of can protocol.

Cheers
Fabrice


Hello Fabrice!

Thanks for your post. I've got this document. Unfortunately, it is almost from a decade ago and I think it also lacks information. Or maybe I do not find it because of my still poor German.

Good weekend for everybody!

Francisco




It is bound to be a case of they will only be telling us what they want us to know, there will be additions, enhancements and new features as found in the cs3 that are not in that document.

Somewhere I have a google translation of that document that I did many years ago when it came out. I CS2 CAN Protocol 2-0 Translated_files.zip (356kb) downloaded 149 time(s). Found it, thought I had already published it here.
Offline fosuna  
#7 Posted : 25 February 2021 07:11:44(UTC)
fosuna

Spain   
Joined: 14/04/2015(UTC)
Posts: 58
Originally Posted by: kiwiAlan Go to Quoted Post
Originally Posted by: fosuna Go to Quoted Post
Originally Posted by: French_Fabrice Go to Quoted Post
Hello

Look there: https://wiki.rocrail.net/doku.php?id=mbus:mbus-en ; there is a download link to version 2 of can protocol.

Cheers
Fabrice


Hello Fabrice!

Thanks for your post. I've got this document. Unfortunately, it is almost from a decade ago and I think it also lacks information. Or maybe I do not find it because of my still poor German.

Good weekend for everybody!

Francisco




It is bound to be a case of they will only be telling us what they want us to know, there will be additions, enhancements and new features as found in the cs3 that are not in that document.

Somewhere I have a google translation of that document that I did many years ago when it came out. I CS2 CAN Protocol 2-0 Translated_files.zip (356kb) downloaded 149 time(s). Found it, thought I had already published it here.


Hi kiwiAlan!

Thanks for your post. I have just downloaded your translation. Sure it will help me!

Greetings!

Francisco
Francisco Osuna
https://fosuna.net
Offline SapphireHD6970  
#8 Posted : 06 February 2022 18:11:31(UTC)
SapphireHD6970

Germany   
Joined: 06/02/2022(UTC)
Posts: 1
Location: Baden-Wurttemberg, Offenburg
Hi Francisco,

I just found your post, and I wanted to ask something. I'm also planning on developing some software to control the CS2 via TCP or UDP. So I was searching aroud for the protocol on how to communicate with the CS2 via TCP or UDP. But I haven't found something yet.

Did you find something there? Is there some kind of manual on all kind of existing messages? I found a lot on the CAN protocol, but nothing on how the CS communicates with a potential PC.

I would greatly appreciate some help, on how to get started here.

Thanks and cheers
Simon
Offline fosuna  
#9 Posted : 07 February 2022 08:53:52(UTC)
fosuna

Spain   
Joined: 14/04/2015(UTC)
Posts: 58
Originally Posted by: SapphireHD6970 Go to Quoted Post
Hi Francisco,

I just found your post, and I wanted to ask something. I'm also planning on developing some software to control the CS2 via TCP or UDP. So I was searching aroud for the protocol on how to communicate with the CS2 via TCP or UDP. But I haven't found something yet.

Did you find something there? Is there some kind of manual on all kind of existing messages? I found a lot on the CAN protocol, but nothing on how the CS communicates with a potential PC.

I would greatly appreciate some help, on how to get started here.

Thanks and cheers
Simon


Hi Simon,

The CS2 communicates with a PC through "UDP-sockets".

As far as I know, the CAN protocol is only for the communication between Märklin items over the Märklin-CAN-bus.

The information to set the UDP packages is on page 7 of the CAN_CS2_Protokoll-2.0.doc document.

Once you know how the UDP sockets work, it is relatively easy to develop a simple programm to send to and receive messages from the CS2. The most difficult (for me) is to know the details of the CAN packages that must be embedded in the UDP-packets. Most of them are not documented by Märklin in the above doc.

I hope this will help you a bit.

Greetings from Madrid.

Francisco

Francisco Osuna
https://fosuna.net
Offline kiwiAlan  
#10 Posted : 07 February 2022 14:41:20(UTC)
kiwiAlan

United Kingdom   
Joined: 23/07/2014(UTC)
Posts: 8,082
Location: ENGLAND, Didcot
Originally Posted by: fosuna Go to Quoted Post
Originally Posted by: SapphireHD6970 Go to Quoted Post

As far as I know, the CAN protocol is only for the communication between Märklin items over the Märklin-CAN-bus.

The information to set the UDP packages is on page 7 of the CAN_CS2_Protokoll-2.0.doc document.


My understanding is that the UDP messages are carrying the CAN messages.

There is a google translation of that document on this forum, that I uploaded some time ago. Someone else has also uploaded a PDF version of my translation document.

See this post to download it.

thanks 1 user liked this useful post by kiwiAlan
Users browsing this topic
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-2024, Yet Another Forum.NET
This page was generated in 0.667 seconds.