Rocrail Arduino CAN-bus interface, MS2, Gleisbox GFP and S88

woodyboy
Posts: 628
Joined: 18.11.2013, 16:01

Re: Rocrail Arduino CAN-bus interface, MS2, Gleisbox GFP and

Post by woodyboy » 28.11.2015, 22:07

Dear Forummembers,

Attached a new version of the Arduino Ethernet-CAN gateway for the Gleisbox. Build with Arduino 1.6.6 with an updated ethernet library, the update is offered by the Arduino IDE. Before building the sketch the included libraries should be installed, updating the libraries is mandatory for building.
Main changes; the implementation of the SPI bus, shared by ethernet and CAN shield, is now transaction safe.
Attachments
CAN_UDP_gwV26.zip
libs included
(37.89 KiB) Downloaded 90 times

Lindi
Posts: 10
Joined: 24.08.2015, 16:29

Re: Rocrail Arduino CAN-bus interface, MS2, Gleisbox GFP and

Post by Lindi » 28.12.2015, 10:52

Hello Bert,

this is Lindi again.

Bert, your solution is based on two different Arduinos, one handling the messages to the track and the other one handling the feedback from sensors. As far as I understand the description both have a CANDIY shield. I wonder if it is possible to handle the track messages by a different system e.g. Raspberry Pi and to look after the sensors by only one Arduino with an Ethernet shield but no CANDIY shield. Is this a solution one could think about or do I miss something essential?

Regards,
Lindi

woodyboy
Posts: 628
Joined: 18.11.2013, 16:01

Re: Rocrail Arduino CAN-bus interface, MS2, Gleisbox GFP and

Post by woodyboy » 28.12.2015, 23:08

Hi Lindi,

Sorry to say but I have no plans to release a solution for a Pi. There are enough alternatives for the Pi platform.
I thought I already released an Ethernet based Arduino S88 solution. I used the Ethernet solution in the early days, but changed it to a local CAN bus solution. The equipment is build together, the bridge, Gleisbox circuit, power supply and booster. This configuration uses only one Ethernet port and works pretty reliable.

Lindi
Posts: 10
Joined: 24.08.2015, 16:29

Re: Rocrail Arduino CAN-bus interface, MS2, Gleisbox GFP and

Post by Lindi » 30.12.2015, 11:26

Hi Bert,

sorry. I didn't want to annoy you. This is such a long lasting thread. I simply overlooked the s88 Ethernet version. The last one is S88EthLCD_V25 from August 2014, right?

I'll try this and will report if something interesting happens.

Best regards,
Lindi

sv1iw
Posts: 46
Joined: 16.09.2014, 21:40

Re: Rocrail Arduino CAN-bus interface, MS2, Gleisbox GFP and

Post by sv1iw » 29.01.2016, 00:52

Hi Bert and I hope all are well with you. I see you got all the problems solved, hi!
After a long time and with much effort due to the capital controls I have got my canbus shield from Seeed Studio. Since I still do not have an Ethernet shield yet I would like to ask for the latest usb sketch so I can be acquainted with rr and canbus gateway. I am little confused with the thread and different versions so if you can point me at the right sketch it will be much appreciated.

Regards Manos SV1IW

woodyboy
Posts: 628
Joined: 18.11.2013, 16:01

Re: Rocrail Arduino CAN-bus interface, MS2, Gleisbox GFP and

Post by woodyboy » 29.01.2016, 20:07

Hi Manos,

The latest USB versions are not published due to the fact I had no time (and motivation) to test the sketches extensively. The logic itself is tested, so I expect no problems but the USB versions are extremely hard to debug. If you want, give it a try.....

I read that the Seeed version had a hardware change for the CS line. The sketches containing a configuration for the CS pin configured on pin 10 on the shield.

Due to the fact something changed in the libraries, replacing with the included libraries is mandatory.
Attachments
CAN_USB_gwV26Q_GFP_CSP10.zip
USB version gateway only, libs included
(33.53 KiB) Downloaded 58 times
CAN_USB_gw_S88_V26Q_GFP_CSP10.zip
USB version with limited S88 support, use isolated sensor units.
(35.01 KiB) Downloaded 49 times
Last edited by woodyboy on 14.10.2016, 18:43, edited 1 time in total.

sv1iw
Posts: 46
Joined: 16.09.2014, 21:40

Re: Rocrail Arduino CAN-bus interface, MS2, Gleisbox GFP and

Post by sv1iw » 30.01.2016, 18:27

Thanks Bert
My Ethernet shield should be on it's way soon so I can try the can_udp sketch as well. I will report results perhaps[s for the benefit of others too... Stay well.

P.S. What you said abt CS will it have an effect to the Ethernet shield? Do I need to change something?

73 Manos SV1IW

woodyboy
Posts: 628
Joined: 18.11.2013, 16:01

Re: Rocrail Arduino CAN-bus interface, MS2, Gleisbox GFP and

Post by woodyboy » 30.01.2016, 21:34

Hi Manos,

When using the Arduino W5100 Ethernetshield pins 10 -13 are used by the Ethernetshield. The CS pin used by the CAN bus shield should not within the range 10-13.

sv1iw
Posts: 46
Joined: 16.09.2014, 21:40

Re: Rocrail Arduino CAN-bus interface, MS2, Gleisbox GFP and

Post by sv1iw » 02.02.2016, 01:59

Hi Bert
True, it needs a cut, a solder to pin 9 and some library change to match the change. By the way FYI the usb sketches are working fine...

Regards Manos SV1IW

welli
Posts: 62
Joined: 16.12.2012, 10:28

Re: Rocrail Arduino CAN-bus interface, MS2, Gleisbox GFP and

Post by welli » 22.05.2016, 10:23

Daer Bert,

Maybe your are the right person who can help me with this question, knowing that this is not the topic of this chat.
Found this Modul << BTS7960B High-power 43A Motortreibermodul/Smart-Car-Modul >> would it be possible to connect it to the Gleisbox?
Check already on the Gleisbox chematic and for me it could be possible.
If possible it would be a strong and cheap booster.
link: http://www.amazon.de/Amazing-trading-BT ... s=bts7960b

Best regards.
Welli

sv1iw
Posts: 46
Joined: 16.09.2014, 21:40

Re: Rocrail Arduino CAN-bus interface, MS2, Gleisbox GFP and

Post by sv1iw » 14.06.2016, 15:18

This might be a little outdated but perhaps it may provide an easy catch for someone not so experienced with electronics. As mentioned by Bert in his very first post much attention should be made if using a second arduino as S88 controller which might be damaged from the floating power supply of the GFP. If you insist of using track occupancy sensing on RR there is a way to protect arduino inputs by inserting a limiting circuit between the isolated track and micro controller input as described here in Method #1: http://www.rugged-circuits.com/10-ways- ... an-arduino
I would increase the resistor to say 2.2 or 4.7K and use a 4 or 3.3V zener but the protection will work with the values as in the schematic.
Another solution is to use infra red sensors which practically have no direct involvement with the rails and so on....

Regards
Manos SV1IW
Last edited by sv1iw on 01.10.2017, 20:55, edited 2 times in total.

torstenSch
Posts: 19
Joined: 05.02.2015, 14:48

Re: Rocrail Arduino CAN-bus interface, MS2, Gleisbox GFP and

Post by torstenSch » 10.01.2017, 14:43

Dear Bert,

best wishes for 2017!

As I am using the left vacation days from 2016, I worked on my model railroad again.

Is there a way, to get the locos saved in the list of the MS2 (get loco from list) into rocrail. New MFX locos are taken, but I would like to get the non MFX locos transfered as well. The MS2 loclist offers me the functions along with the address, which would ease the Transfer.

Thank you!

Best regards,

Torsten

woodyboy
Posts: 628
Joined: 18.11.2013, 16:01

Re: Rocrail Arduino CAN-bus interface, MS2, Gleisbox GFP and

Post by woodyboy » 10.01.2017, 17:39

Hi Torsten,

Thanks for your question, although I do not fully understand what you mean. The loco list of the MS2 offers only eleven registrations. Registering in Rocrail offers a much longer list and far more meta information about your locomotives. A one time registration in Rocrail for all stock is sufficient. If the MS2 is in slave mode it is very easy to select a loco from Rocrails list as stated in the wiki http://wiki.rocrail.net/doku.php?id=cs2:gbox-en.
If the functions are correct defined in Rocview, even the functionicons are correct displayed in the controllers. I'll try to create a screenshot in the wiki how to define the functions.

torstenSch
Posts: 19
Joined: 05.02.2015, 14:48

Re: Rocrail Arduino CAN-bus interface, MS2, Gleisbox GFP and

Post by torstenSch » 11.01.2017, 17:08

Hi Bert,

sorry for being inprecise.

Using rocrail as master for the MS2 works!

It's just the fact, that the MS2 gives me all settings per loco based on the cataloque number from Märklin, which I would like to use (if it is easy to do).

Best regards,

Torsten

woodyboy
Posts: 628
Joined: 18.11.2013, 16:01

Re: Rocrail Arduino CAN-bus interface, MS2, Gleisbox GFP and

Post by woodyboy » 11.01.2017, 22:10

Hi Torsten,

Building the current slave mode took me some weeks. Maybe, if the MS2 supports querying the loco database and MS2's loco list, it takes a little bit fewer time to code. But the protocol documentation from M* is not really clear about exchanging information. So I expect there is a serious amount of time necessary for implementing. Currently I am building a new layout and family affairs take a lot of time. Maybe later this year I'll check the possibilities of implementing. After all it is a nice challenge. :coding:

Post Reply

Return to “DIY Hardware”