Model Railway Forum

Go Back   Model Railway Forum > Model Railway Construction > Wiring & Electronics > DCC


Reply
 
Thread Tools Display Modes
Old 03-02-2018, 06:44 PM   #11
steve14
Member
 

Join Date: Dec 2016
Posts: 38
steve14 is on a distinguished road
Default

Quote:
Originally Posted by 4VEP View Post
It's not very difficult to control a train via a Sprog. All you've got to do is open a terminal window then control the train with a throttle. The commands sent to the train from the throttle will appear in the terminal window. You can then copy and paste this to create a sequence. Once you have got the hang of it, you can write a BASIC program to generate commands as required. On the Raspberry Pi, there is the option of using RISC OS and programming in BBC BASIC which avoids bothering with compilers.

The original R-Pi Model B and a 2gig SD card is all that is needed to run RISC OS.

A drawback with the Sprog and JMRI Is if you get a short. This sometimes forces a restart of JMRI and necessitates a reboot of Linux in some instances.
Thanks for the info I will give this a go when I get my pi, I've run out of Pi's at the moment as they are all being used for a heating project I have on the go. So just ordered one from ebay
steve14 is offline   Reply With Quote
Old 03-02-2018, 06:48 PM   #12
steve14
Member
 

Join Date: Dec 2016
Posts: 38
steve14 is on a distinguished road
Default

Just added another video quick demonstration on occupied sensors using a CT (current transformer) and the arduino to JMRI. I am using the CT as this is a n gauge layout and the current draw is too small for the ASC712. The arduino program is very basic not reading the actual current just picking up a change in reading to say the track is occupied.
Currently I have tested this on one piece of track and it works great. Not tried more than one waiting for more CT to turn up.

https://youtu.be/lyJY9hI2IX4
steve14 is offline   Reply With Quote
Old 03-02-2018, 07:09 PM   #13
4VEP
Hornby Collector
 

Join Date: Jan 2016
Location: Rye East Sussex
Posts: 649
4VEP is on a distinguished road
Default

Quote:
Originally Posted by Flashbang View Post
AFAIK Hornby's Railmaster only works with Hornby DCC items?
But I stand to be corrected as I've never tried it with other systems.
A C# library has been written to control a DCC loco via an eLink. It is claimed this method is more reliable than Railmaster.


https://networkfusion.wordpress.com/...mand-stations/


To develop this you need a Windows version with .NET installed. With this method you could control an elink via some program such as JMRI.

The rationale for controlling non-Hornby DCC command stations using Railmaster does not make sense to me. However I think following the C# library method indicated above you could make it so that commands meant for the elink could be intercepted and sent to some other hardware.
__________________
Railway Modelling is about life, the universe and everything.
4VEP is offline   Reply With Quote
Old 04-02-2018, 11:58 AM   #14
Flashbang
Administrator
 
Flashbang's Avatar
 

Join Date: Jul 2009
Location: SE UK
Posts: 8,414
Flashbang will become famous soon enough
Default

I feel your line of thought may have changed?? You said in post #5
Quote:
Originally Posted by 4VEP View Post
I find JMRI a bit slow and cumbersome. Maybe create a simpler interface like Railmaster?
To which I replied... AFAIK Railmaster only works with Hornby products.

eLink is a DCC command control system much like SPROG or any other DCC command unit designed to work with a PC input.
Whether eLink can be operated via third party software I have no idea and wasn't what I replied to at all. So why have you now quoted me in your post #13?
__________________
Broken? It was working when I left it!
Flashbang is offline   Reply With Quote
Old 04-02-2018, 12:43 PM   #15
RAFHAAA96
Trying-hard-to-re Member
 
RAFHAAA96's Avatar
 

Join Date: Dec 2009
Location: Moni, Limassol, Cyprus
Posts: 362
RAFHAAA96 is on a distinguished road
Default

There was a guy on RM Web who back engineered the RM - eLink interface just to get it to work faster. He wrote it all up but as it was considered he had broken the ‘no reverse engineering allowed’ rule in the RM licence the whole thread was culled.

It is obviously possible to get RM to work with other kit and vice-versa if you are smart enough but in theory and law you are not allowed to try.

Rob
__________________
Halton Brat, running Hornby 00 via Elite, Select Walkabout and eLink DCC using Railmaster Pro and occasionally Rocrail, β-tester. http://myweb.cytanet.com.cy/honnor/
RAFHAAA96 is online now   Reply With Quote
Old 14-02-2018, 04:24 PM   #16
steve14
Member
 

Join Date: Dec 2016
Posts: 38
steve14 is on a distinguished road
Default

All was going well but sadly I have come across a problem with JMRI which may prevent me from using it. With the Arduino connected simple script updating one bit data all works well in the sensor table. I also have the SPROG connected on a separate com port and this can control the trains. But if I save the table in JMRI and restart JMRI open the saved table the Arduino communication will not work. If I disconnect the SPROG and restart the JMRI using the saved sensor table all works ok.
So there seems to be a conflict with using SPROG and the CMRI library that I cannot work out a way to get it to work. I have done a you tune video of this link below.
Any suggestions welcome or its back to the drawing board my look at DCC++ with the arduino

https://www.youtube.com/watch?v=FZmI...ature=youtu.be
steve14 is offline   Reply With Quote
Old 14-02-2018, 07:44 PM   #17
Cudworth
Senior Member
 
Cudworth's Avatar
 

Join Date: Dec 2014
Location: Eastbourne
Posts: 759
Cudworth is on a distinguished road
Default

The Arduino and the Sprog do not need to be connected to the same Windows Box. What you can do is connect the Arduino via USB to the raspberry pi, and connect the PC to the Pi via ethernet (or wifi).
Cudworth is offline   Reply With Quote
Old 15-02-2018, 11:00 AM   #18
steve14
Member
 

Join Date: Dec 2016
Posts: 38
steve14 is on a distinguished road
Default

Hello Cudworth,
I was not using a Pi, currently I have a PC usb connected direct to SPROG and Arduino USB to PC setup as CMRI in PanelPro.

What you said may be a way forward I have a spare Pi. I assume I will need to set up JMRI on the pi, make a connection to the arduino by CMRI USB direct and then network connect to my PC.

The PC will have JMRI network connected to Pi for arduino accessory control and SPROG connection by USB for train connection.

Getting quiet complicated for a setup but can give this a try.

Or are you suggesting the Pi runs JMRI with HDMI monitor for GUI control. USB to arduino for accessory but I would still have USB to SPROG. Would this not cause the same issue.

Thanks steve
steve14 is offline   Reply With Quote
Old 15-02-2018, 05:37 PM   #19
Cudworth
Senior Member
 
Cudworth's Avatar
 

Join Date: Dec 2014
Location: Eastbourne
Posts: 759
Cudworth is on a distinguished road
Default

Quote:
Originally Posted by steve14 View Post
Hello Cudworth,
I was not using a Pi, currently I have a PC usb connected direct to SPROG and Arduino USB to PC setup as CMRI in PanelPro.

What you said may be a way forward I have a spare Pi. I assume I will need to set up JMRI on the pi, make a connection to the arduino by CMRI USB direct and then network connect to my PC.

The PC will have JMRI network connected to Pi for arduino accessory control and SPROG connection by USB for train connection.

Getting quiet complicated for a setup but can give this a try.

Or are you suggesting the Pi runs JMRI with HDMI monitor for GUI control. USB to arduino for accessory but I would still have USB to SPROG. Would this not cause the same issue.

Thanks steve


Issue 134 of Linux User had a feature on controlling an Arduino via a Raspberry Pi. The approach the article uses is to install Nanpy on th Pi. The example given controls a three colour lamp. You could approach the problem from this simple beginning.

I have tried using JMRI on Linux on both the Pi and X86 version of Linux - I think you are better off with the Windows Version, at least for developing. However, once you've got it going you can transfer it to the Pi, the advantage being there is no need for a complete computer in the layout room.

Regarding the problems you are having JMRI has no proceedure for handling shorts - this is a hardware implementation - JMRI is not specific to any hardware. When you connect a circuit so as to illuminate an LED for example, JMRI will see it as a short. You can clear the short by restarting JMRI, but that's not too clever.

An approach I think you can take is to have the arduino connected to the Pi and SSH to it from the Windows Box. In that way the Windows PC won't see the short.

I haven't got time at the moment to type any more, but I hope this helps with your research! I have got two Rpis but no Arduino currently. I may be getting one!
Cudworth is offline   Reply With Quote
Old 16-02-2018, 10:43 AM   #20
steve14
Member
 

Join Date: Dec 2016
Posts: 38
steve14 is on a distinguished road
Default

Quote:
Originally Posted by Cudworth View Post
Issue 134 of Linux User had a feature on controlling an Arduino via a Raspberry Pi. The approach the article uses is to install Nanpy on th Pi. The example given controls a three colour lamp. You could approach the problem from this simple beginning.

I have tried using JMRI on Linux on both the Pi and X86 version of Linux - I think you are better off with the Windows Version, at least for developing. However, once you've got it going you can transfer it to the Pi, the advantage being there is no need for a complete computer in the layout room.

Regarding the problems you are having JMRI has no proceedure for handling shorts - this is a hardware implementation - JMRI is not specific to any hardware. When you connect a circuit so as to illuminate an LED for example, JMRI will see it as a short. You can clear the short by restarting JMRI, but that's not too clever.

An approach I think you can take is to have the arduino connected to the Pi and SSH to it from the Windows Box. In that way the Windows PC won't see the short.

I haven't got time at the moment to type any more, but I hope this helps with your research! I have got two Rpis but no Arduino currently. I may be getting one!
Thanks for the reply. I have read the article you mentioned but this is not what I needed. I am trying to get CMRI working with SPROG but the tables will not work from a saved file, it only works when setup from fresh each time or with SPROG disconnected.

Im not getting any shorts, all the accessory control is through the arduino.

Thanks for your time and help. I think I might have to do this another way. possible to turn the arduinos into decoders which will control turouts and signals, but not sure how I would do occupied sensors back to JMRI with an arduino.
steve14 is offline   Reply With Quote
Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +1. The time now is 08:43 AM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.