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 hwestl  
#1 Posted : 13 April 2017 16:28:35(UTC)
hwestl

Sweden   
Joined: 13/10/2007(UTC)
Posts: 82
Location: Ystad, Sweden
I bought this little add-on board to a Raspberry Pi2 from ifoedit, to connect the two to the trackbox of a MS2.
I have started to make my own program to control it from my PC, but my problem is that the doc of the CS2 CAN bus protocol from Märklin (can be downloaded using CAN bus protocol) is in German, and I have "some" problem understand it.
I have downloaded a program with source code from r-serwe.de and used that understand how it works. Same thing here, all comments etc are in german...
But it works, I can make simple commands. Changing speed or switch on functions is reflected on the MS2. But I would like to understand more of the protocol. Anybody knows if it's available in english anywhere?

Thanks
Håkan

MS2, trackbox, Raspberry Pi2
For me, this is a great board, making it possible for me to use whatever I want to control the trains, the MS2, a PC, a tablet or a smartphone BigGrin
thanks 2 users liked this useful post by hwestl
Offline kiwiAlan  
#2 Posted : 13 April 2017 17:16:58(UTC)
kiwiAlan

United Kingdom   
Joined: 23/07/2014(UTC)
Posts: 4,545
Location: ENGLAND, Didcot
Originally Posted by: hwestl Go to Quoted Post
I bought this little add-on board to a Raspberry Pi2 from ifoedit, to connect the two to the trackbox of a MS2.
I have started to make my own program to control it from my PC, but my problem is that the doc of the CS2 CAN bus protocol from Märklin (can be downloaded using CAN bus protocol) is in German, and I have "some" problem understand it.
I have downloaded a program with source code from r-serwe.de and used that understand how it works. Same thing here, all comments etc are in german...
But it works, I can make simple commands. Changing speed or switch on functions is reflected on the MS2. But I would like to understand more of the protocol. Anybody knows if it's available in english anywhere?

Thanks
Håkan

MS2, trackbox, Raspberry Pi2
For me, this is a great board, making it possible for me to use whatever I want to control the trains, the MS2, a PC, a tablet or a smartphone BigGrin


I have this google English translation that I have attached. It is a web page, so you need to unzip it into a directory, then open the web page.

CS2 CAN Protocol 2-0 Translated_files.zip (356kb) downloaded 43 time(s).

You still need to use the pictures from the German one, as Google didn't include the pictures in the translation.
thanks 1 user liked this useful post by kiwiAlan
Offline rbonet  
#3 Posted : 13 April 2017 19:43:30(UTC)
rbonet

Spain   
Joined: 01/02/2009(UTC)
Posts: 98
Location: Barcelona, Spain
Hi Håkan,
I've the same setup as you. It works very well with Rocrail. I've also tried it with Märklin CS2.exe and with Freewald's RR&Co.

For the CAN protocol I've the same problem as you, there is not an english version and even the german one is not complete.

[edit] By the way, you don't actually need the MS2.

Regards,

Rafael
Collecting Era I, II & III, mainly German, French & Spanish RR, some USA
thanks 1 user liked this useful post by rbonet
Offline eroncelli  
#4 Posted : 18 April 2017 11:16:47(UTC)
eroncelli

Italy   
Joined: 16/02/2011(UTC)
Posts: 124
Location: Bergamo - italy
You might get some useful hints from RocRail Forum (www.rocrail.com): just search for "mgbox" or "Arduino" or "RasPI"
thanks 1 user liked this useful post by eroncelli
Offline Moritz-BR365  
#5 Posted : 27 April 2017 13:20:44(UTC)
Moritz-BR365

Germany   
Joined: 02/04/2013(UTC)
Posts: 680
Hello,
this solution may be interesting for You, too!

https://www.marklin-user...-Box-and-mfx-programming
thanks 1 user liked this useful post by Moritz-BR365
Offline hwestl  
#6 Posted : 02 June 2017 13:51:57(UTC)
hwestl

Sweden   
Joined: 13/10/2007(UTC)
Posts: 82
Location: Ystad, Sweden
I found out a nice and cool feature using this setup with a MS2 and a Raspberry Pi2.
The MS2 can handle only 10 active locs, easily selectable, and then you you can have others that are "rolled out" with the "Lok freigeben/Free Loco" function. Total of 40, if I interpret the manual correctly (Interner Speicher für 40 locomotiven/40 internal memory locations)
Using the PC-program or my own Android-app, I can also control all locs that have been entered but rolled out.
I have added 12 locs, and I had no problem controlling a loc that was rolled out using my app.
I can now easily select any of my 40 locs of the MS2. After I have added them, of course Laugh
thanks 2 users liked this useful post by hwestl
Offline hwestl  
#7 Posted : 26 June 2017 17:31:48(UTC)
hwestl

Sweden   
Joined: 13/10/2007(UTC)
Posts: 82
Location: Ystad, Sweden
Today I found out that I don't have to add the locos to the MS2. It's enough that I have them in my app.
I just putted a "not registered loc in the MS2" onto the track, added it in my app, and could control it directly. Even betterLaugh
thanks 2 users liked this useful post by hwestl
Offline Moritz-BR365  
#8 Posted : 27 June 2017 07:26:22(UTC)
Moritz-BR365

Germany   
Joined: 02/04/2013(UTC)
Posts: 680
Originally Posted by: hwestl Go to Quoted Post
Today I found out that I don't have to add the locos to the MS2. It's enough that I have them in my app.
I just putted a "not registered loc in the MS2" onto the track, added it in my app, and could control it directly. Even betterLaugh


Hello Håkan,
is Your own app available for download, e.g. as apk-file?

Regards,
Moritz
Offline hwestl  
#9 Posted : 27 June 2017 10:07:15(UTC)
hwestl

Sweden   
Joined: 13/10/2007(UTC)
Posts: 82
Location: Ystad, Sweden
Hej Moritz

Well, not really. It's pretty hardcoded with my locs. From the start I had some thoughts of having it generic, but as time went on I made some shortcuts to make it easy. Mostly regarding the pictures. I can see if I can do some changes in the future. But it's also things like functions. I have only made it available for 10 functions (F1 - F10) since I don't have any loc that has more functions. And then the screen is adapted to my phone, Sony Xperia Z5 Compact

But anyway, this is the main screen and one can select loc using the drop down list.

iWesMS2

Regards
Håkan
thanks 2 users liked this useful post by hwestl
Offline Moritz-BR365  
#10 Posted : 27 June 2017 13:43:41(UTC)
Moritz-BR365

Germany   
Joined: 02/04/2013(UTC)
Posts: 680
Originally Posted by: hwestl Go to Quoted Post
Hej Moritz

Well, not really. It's pretty hardcoded with my locs. From the start I had some thoughts of having it generic, but as time went on I made some shortcuts to make it easy. Mostly regarding the pictures. I can see if I can do some changes in the future. But it's also things like functions. I have only made it available for 10 functions (F1 - F10) since I don't have any loc that has more functions. And then the screen is adapted to my phone, Sony Xperia Z5 Compact


Hello Håkan,
this looks nice. I would like to test if it runs together with the BananaPi solution.

What development Environment do You use?

Regards,
Moritz
Offline hwestl  
#11 Posted : 27 June 2017 16:12:08(UTC)
hwestl

Sweden   
Joined: 13/10/2007(UTC)
Posts: 82
Location: Ystad, Sweden
Originally Posted by: Moritz-BR365 Go to Quoted Post
Hello Håkan,
this looks nice. I would like to test if it runs together with the BananaPi solution.

What development Environment do You use?

Regards,
Moritz


Hej Moritz

I'm using Android Studio on a PC.
I can send you the source code of my project if you want to.

Regards
Håkan
thanks 1 user liked this useful post by hwestl
Users browsing this topic
OceanSpiders 2.0
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-2019, Yet Another Forum.NET
This page was generated in 0.590 seconds.