Homemade DCC Software
Posted
#235781
(In Topic #13003)
Full Member
DDC software to control Teasel Bay
As well as physically building Teasel Bay (http://yourmodelrailway.net/view_topic.php?id=15131&forum_id=21) I set out to build some software to run it. Just like people build scratch built models, my interest lies in scratch building some software.My plan is to be able to run locomotives, accessories such as signals and points as well as control lighting etc from multiple computers which are all connected. Eventually adding sensors to locate locomotives around the layout so I can automate them with the ability to take control of aspects such as a locomotive or the signals and the system react. I also want to be able to control locomotives from my mobile as well as a more tactile controls like I used to on DC.
If you are not interested in the technical bits simply ignore anything in italics!.. I've written Mainline as a web service in .NET Core. Having it as a web service means I am unrestricted in how many devices and connect and fur fill different roles. The front end is written in Angular with JSON as the communication layer between the server and client. I found an open source library called XPressNetSharp which takes commands and converts them to HEX which is then fired down to the eLink.
Today I got trains running with it for the first time which is exciting! It needs prettying up but this is how it looks currently. Hitting connect creates a link to the eLink and initialises it ready for commands.
"Trains"/Control screen has a list of my trains and a control for each.
Its a start, I've no idea if I'll ever get around to writing half of the software I plan to but it was very satisfying controlling trains this evening on something I'd written.
Hope this is of interest to some!
Last edit: by TeaselBay
Posted
Site staff
Ron
NCE DCC ; 00 scale UK outline.
NCE DCC ; 00 scale UK outline.
Posted
Full Member
I dont know much about computer programming but I have heard of Xpressnet in conjunction with JMRI software.
Posted
Full Member
A someone that uses a computer program to run a layout I think your new venture is great.
I dont know much about computer programming but I have heard of Xpressnet in conjunction with JMRI software.
Xpressnet is the information bus used by Lenz and other DCC systems…….I assume it is the equivalent of loconet.
So on Granby, Xpressnet sends data to the Lenz box which in turn sends it to Train Controller
Posted
Full Member
Posted
Full Member
Yeah spot on, Xpressnet is a protocol which just defines how information is passed down the DCC bus to the locomotives/accessories. XpressNetSharp is a C# implementation of it which simply takes messages and converts them into commands for the ELink in this instance: https://github.com/networkfusion/XpressNetSharp[user=540]gdaysydney[/user] wrote:A someone that uses a computer program to run a layout I think your new venture is great.
I dont know much about computer programming but I have heard of Xpressnet in conjunction with JMRI software.
Xpressnet is the information bus used by Lenz and other DCC systems…….I assume it is the equivalent of loconet.
So on Granby, Xpressnet sends data to the Lenz box which in turn sends it to Train Controller
Thank you for the positive feedback, it is most appreciated. I wasn't sure if anyone would be interested in this aspect!
Last edit: by TeaselBay
Posted
Full Member
I created a simple proof of concept application on the Arduino which listens for inputs from the usb and then changes the state of the output which is a light. I then wrote a little C# play app to toggle the light on the laptop. You can see it working in the video below.
[yt]RIeB3flqPDQ[/yt]
This can easily be scaled up to turn on the platform lights, building lights etc.
Posted
Full Member
Commands to pin:
- Gnd - Black
- 13 - Green: Signalbox
- 12 - Red: Station lights
- 11 - Orange: Station building lights
- 10 - White: Station house outside light
- 9 - Yellow: Ticket office outside light
At the moment this is controlled by a very simple C# desktop app which simply toggles the lights on/off.
There is something strangely satisfying by simply turning the lights on/off, lol!
Posted
Full Member
:thumbsI agree - maybe its the therapy/gratification from the satisfaction of getting it to workThere is something strangely satisfying by simply turning the lights on/off, lol!
:nice
I am following this thread with interest as the electronics / automation side of layout building has always appealed to me. Keep it going
Posted
Full Member
1 guest and 0 members have just viewed this.