RocNet interface to Märklin Motorola i2c

Post Reply
MatsP

RocNet interface to Märklin Motorola i2c

Post by MatsP » 10.04.2010, 20:35

I'm building an interface for the Märklin i2c-port found on the older Märklin digital "boxes". The 6021 in particular, since it supports the "Newer" Motorola format with absolute direction.

To communicate with the device I'm thinking of using the RocNet since it seems easy to work with. What I'm wondering is if it's possible to easily use over USB-RS232 or RS232, since that is what I will be using to connect to the interface.

Anyone with knowledge about the RocNet-protocol please share your thoughts.

I'm also wondering how you can debug the connection between rocrail and any interface, to see exactly what commands are being sent back and forth. I'm using Snow Leopard on a Mac.
Attachments
6021.jpg
Sneak Peak
6021.jpg (88.89 KiB) Viewed 167 times

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

Post by rjversluis » 10.04.2010, 20:58

Hi,

I already replied on this posting, but my wireless LAN did send it to the sky. :-(

In short I will support your project to get RocNet running over RS232.
There is another active project with RocNet for running Trains with WLAN decoders... ;-)

MatsP

Post by MatsP » 10.04.2010, 21:26

I'm glad you're interested.
What version of RocRail/RocView should I be using to test with?

Right now I'm setting up the hardware on breadboards.

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

Post by rjversluis » 11.04.2010, 07:38

Hi,

use the latest 1.4 snapshot to be able to get the latest RocNet enhancements.

MatsP

Post by MatsP » 11.04.2010, 16:26

Now onto the next step. Getting the commands to be sent over USB-RS232 or RS232.

Although I can choose a serial port when setting up the RocNet Controller, it's not that simple I suppose. What would be the simplest thing to do? Change the RocRail source to be able to use both serial/UDP or code up some standalone software to do the translation to serial? I have not looked at the RocRail source.

I have looked at the packets being sent using Wireshark and glanced at sending/receiving multicast messages with python.

Also, the wiki-entry isn't that updated right? I got 8bit packets with group=9 which isnt even on the wiki.

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

Post by rjversluis » 11.04.2010, 19:36

You have to be patient; This is a hobby project. ;-)

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

Post by rjversluis » 12.04.2010, 16:39

Can you use a Ethernet to Serial converter instead of a USB to Serial?

MatsP

Post by MatsP » 14.04.2010, 21:53

I don't know exactly what an Ethernet to Serial converter is. Some custom hardware?

But I have been looking at connecting it directly to ethernet using a ENC28J60. But I'm not exactly sure how you use it with multicast UDP packages.

But anyway, I have made some progress. I can now convert all Switch-commands to the track. I'm using a "converter"-software i put together in Xcode. It also translates the commands to 7-bit extended-version of the protocol. Which I find easier for serial communication and the older Märklin formats.

Next up: Controlling trains.
Attachments
Skärmavbild 2010-04-14 kl. 22.48.25.png
Skärmavbild 2010-04-14 kl. 22.48.25.png (75.92 KiB) Viewed 120 times

MatsP

Post by MatsP » 17.04.2010, 23:44

I have now fixed support for driving Trains. The most important feature.

I have detected something that's not really "spot on" with the protocol right now. But maybe it has already been fixed.

Commands in HEX.

Code: Select all

(1)   00004800 01020202 2D05  (Moving forward)
<Click F0 (lights)>
(2)   00004800 01020202 2D05      (1st command, with lights but no dif.) 
(3)   00004800 01020202 2D05      (2nd command, with lights but no dif.)
(4)   00004800 01020303 400004   (All functions command)
<Now I try to change direction, doesn't send correct command.>
(5)   00004800 01020202 2D05
<Try to change direction again.>
(6)   00004800 01020202 2D05
Although i can understand if it's this way because there hasn't been time to work with it.

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

Post by rjversluis » 19.01.2011, 10:52

Hi,

I fully lost this subject from focus....

Today I added a serial sublib for RocNet:
http://wiki.rocrail.net/doku.php?id=roc ... et-prot-en

Post Reply

Return to “RocNet”