Introducing DCC++ ---a complete open-source DCC station and interface

Gregg Aug 25, 2015

  1. craftech

    craftech TrainBoard Member

    52
    7
    19
    Hi everyone,

    I have to agree with several people in this long thread of the need for a step by step for beginners.

    I started out watching a video from five years ago, buying an UNO and motor shield and then spending two weeks reading and watching other videos
    because the information in the first one didn't work because it never mentioned Arduino software and a few other things absolutely needed for it to work. Came to this forum and couldn't find it here.

    I thought the Arduino was defective so I found a video to test that before I concluded that there was nothing wrong with it.
    Watched another old video that explained what the first one left out and I finally at least got the setup to recognize the locomotive was present.

    Since the programmer recognized ALL Econami decoders in the list instead of just one of them I had to do research to find out which one my new N Scale engine had. I could have opened it, but it was a steamer. No information by the manufacturer or anyone else so I did it through trial and error until I finally figured out which decoder it had and 'sort of' programmed it.
    But there was nothing to tell me how to set up any of the CV's only a bunch of choices with no explanation so I left them at the default.
    There is one recent part one and two video with a guy sniffling and coughing from a viral cold that may help. I haven't watched that one yet.
    I know a lot of people use DCC++EX, but that seems geared toward a MEGA. I can't find out if it works with an UNO, or if I would even gain anything by doing so, or how to do it even if it WERE worthwhile. So I am leaving the UNO setup with DCC++ as is.

    Finally I bought a Raspberry Pi and loaded Steve Todd's pre-configured image on it and followed his instructions which were geared to the novice (like me). That worked perfectly along with my tablet and phone running engine driver with a basic simplified couple of CVs (a fraction of what is possible).
    Weeks of work.

    I am not lazy. I spent hours and hours trying to piece together information so I could get it to work because I have never done anything like this before. I never even owned a commercially made DCC controller or setup.

    Thanks,
    John
     
    Last edited: Feb 14, 2021
    appCurious likes this.
  2. Sumner

    Sumner TrainBoard Member

    2,798
    5,837
    63
    Hi John, nice post.

    I had two Uno's with Gregg's DCC++. Took one the other day and put DCC++EX on it and it runs fine. In fact I think you will find that using JMRI it reads and writes CV's better than the DCC++ code and that is a big help.

    I also have the Classic DCC++ on a Uno and it also programs better than the original. The guys cleaned up the original DCC++ some but otherwise left it pretty much alone. If you don't want EX I'd still suggest putting Classic on your UNO as it is better than the original.

    DCCC++EX fits on the Uno memory wise but an Elegoo Mega is really not that expensive at $17.00 in the states and much cheaper if you are welling to wait on longer ship times. I'd recommend going to it. You will see no difference but it does offer more options if you want to use them and will allow DCC++EX to become more comprehensive down the road as it has the memory to expand.

    I also run a Pi with Steve's image file and it is great as you don't need to know anything about a Pi to make it work.

    I also just designed a case...

    [​IMG]

    ... that houses a Mega and Pi if you have access to a 3D printer. I also have print files up now for case options for the Uno and Pi but they aren't combined into one case like above,

    Sumner
     
    Last edited: Feb 14, 2021
    sidney and Mark Ricci like this.
  3. craftech

    craftech TrainBoard Member

    52
    7
    19
    Thanks for that information Sumner. Really helpful. Nice work on that impressive case.
    John
     
    Mark Ricci likes this.
  4. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    I hope that the web page is getting more and more information as time goes on (new pages and changes weekly) and explains everything to folks so they don't have to go searching all over the internet. There ARE step by step instructions and videos. If anyone wants to help write any documentation or make a video, please let me know:

    https://dcc-ex.com

    As for requirements (Uno vs. Mega, etc.) we are just trying to keep things simple. With too many options, it can get even more confusing and we lose people. So...

    SHORT ANSWER: Buy a Mega if you can, but an Uno will work the same for the base Command Station.

    LONG ANSWER: is on the website, but in general Megas are cheaper than Unos. They have more memory, more GPIO pins, 3 extra serial ports, you can get a Mega WiFi that also has built in WiFi, the timers are different, etc.. The Command Station alone will run just fine on an Uno or even a Nano! But if you want to add a Wifi shield to connect Engine Driver directly to the Command Station (no JMRI or computer needed), that is where the 1 serial port and only 2k or memory on an Uno just isn't enough. If you are using WebThrottle-EX or JMRI, or something else as a front end using a USB cable or the wireless equivalent, your Uno will work just fine with DCC-EX.

    We may have other options for wireless throttle on an Uno though in a future release. There are more major changes coming in version 3.1 to be released in the next week or so. It will have more motor board support, be faster still, more accurate waveform, new, simpler function command, wifi information on an optional LCD or OLED display, and replacing libraries with our own code so you don't have issues trying to install separate software.

    Fred
    DCC-EX
     
    sidney, Mark Ricci and Sumner like this.
  5. appCurious

    appCurious TrainBoard Member

    10
    6
    2
    Thanks for all of your hard work to make an open source system and continue the DCC-PlusPlus adventure going. I can see how much time and effort has gone into the project and the code!!

    i'm having a bit of an issue getting up and running. I've been looking for troubleshooting guides and I've been reading through the documentation and codebase found here https://github.com/DCC-EX

    I am running H.O. ( not sure if that's a support scale as it seems most people are posting N scale comments)
    My objective is to send in control signals <t 1 3 20 1> and run my DCC ready loco ( which i converted to DCC )
    I am writing my own web app that communicates with Uno running DCC-Ex

    I have some success by testing and watching Arduino IDE and monitoring coms
    • Sending this command <t 1 3 20 1> returns <T 1 20 1>
    • Sending that command my loco 'chugs' forward
    • Sending the <f 3 144> command will turn on the head lights
    • Sending the <f 3 128> command will turn off the head lights
    Obstacles to overcome
    • The loco only 'chugs' forward ( or backward )
    • It is as if a 'brake' is set or as if i have a completely disconnected track
    • If i push the loco along it will begin to move on its own for a short distance
    My testing setup
    • Sound Traxx DCC mobile decoder MC1h102P8
    • Arduino Uno
    • DIY MORE Motor Shield HN
    • USB cable connected to Window PC and Uno
    • Uno wired to test track for main operation A+ A- terminals
    • 15V 1.5A power supply
    • I am using the Arduino IDE to send commands via Serial Monitor

    Thanks for any and all replies or guidance toward resources!!

    ~ appCurious Greg
     
  6. Sumner

    Sumner TrainBoard Member

    2,798
    5,837
    63
    Curious, is there a reason you aren't running the new DCC++ Classic or DCC++EX?

    https://dcc-ex.com/

    Sumner
     
  7. appCurious

    appCurious TrainBoard Member

    10
    6
    2
    Thanks for replying Sumner.

    Well i started with the original code in DCC++ because in the Arduino Library Management it was an option. I found the active repo and thought it better to stay current rather than use the archives for classic DCC++and BaseStation-EX

    I followed a Word document that helped me get setup and this is what is currently running.
    https://github.com/DCC-EX/Support-Doc/blob/master/Startup Guides/command_station_install.docx

    DCC++ EX v3.0.3<iDCC-EX V-3.0.3

    Is it better to use the Classic or DCC-EX stable archive?
     
  8. Sumner

    Sumner TrainBoard Member

    2,798
    5,837
    63
    Instead of using the github I've used the installer on DCC++EX site (the link I supplied above). Sounds like you probably have the same versions of Classic or EX that I have.

    Maybe I misunderstood your problem. Sounds like you are trying to run the train without JMRI and one of its throttles or using JMRI to run a phone throttle but want to send the individual commands with a web app you are creating. If that is the case maybe one of the current developers might find your question here and answer it here but another option would be to contact them through Discord ....

    https://dcc-ex.com/support/index.html

    Sumner
     
    Mark Ricci and appCurious like this.
  9. appCurious

    appCurious TrainBoard Member

    10
    6
    2
    Thanks Sumner!

    You are correct. I have not installed JMRI. I had not utilized the installer for DCC++EX.

    I was just trying to utilize the CommandStation-Ex and send it commands. I was just watching some videos on how to use the installers and JMRI. Looks super simple to set it up that way.

    Thanks for the calling out Discord....never thought to look there.
     
    Mark Ricci likes this.
  10. Sumner

    Sumner TrainBoard Member

    2,798
    5,837
    63
    If you have a Pi you can put Steve Todd's image file on it and be up with JMRI and a phone throttle with no work at all. Put the image file on a micro SD card. Put the card in the Pi, power it up and JRMI comes up on the screen and you have a WiFi connection for phone throttles without having to do basically anything,

    Sumner
     
    Mark Ricci, appCurious and sidney like this.
  11. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    Have you tried a faster speed command than 20? The maximum speed with default decoder settings is normally 126 - e.g . <t 1 3 126 1>
     
  12. appCurious

    appCurious TrainBoard Member

    10
    6
    2
    Jimbo thanks for replying. Yes i have tried faster speeds and 126 specifically.

    I am currently installing the DCC++EXtended drivers to see if JMRI is able to read the decoder.

    I may have purchased the incorrect decoder. Using JMRI - I was creating a new roster and clicked read to read the loco info... the result was an error no response.

    When i look at the numeric pin indications on the decoder - it looks like i am Unable to lineup #1 pin with #1 socket ( i am assuming lower left socket J1 as pin #1). Reading some other forums they indicate if I can turn on the lights but not control the loco it may be that the decoder is installed incorrectly. I have tried installing the decoder in the 2 positions it would fit ( as the other forum indicated it would NOT damage the encoder )

    Athearn DCC Ready Loco ATH96074
    Sound Traxx Mobile Decoder MC1H102P8

    decoder.jpg
     
    Last edited: Feb 22, 2021
  13. appCurious

    appCurious TrainBoard Member

    10
    6
    2
    I really appreciate you guys responding and taking your time to help me. THANKS!
     
    Mark Ricci likes this.
  14. appCurious

    appCurious TrainBoard Member

    10
    6
    2
    I was working with @FlightRisk on this. THANKS again for all the time you spent on it. Awesome Support.

    There are some other complications going on but Flight got it rolling - CV 19 consist mode was on.
     
    sidney and Mark Ricci like this.
  15. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    Now we just need to find out why we aren't getting a report of any current on either the A0 or A1 pins! I moved the discord discussion to the support channel for Command Station EX. Feel free to post any pictures or ask here too. That board has current sense and should be reporting something.
     
    Mark Ricci and appCurious like this.
  16. appCurious

    appCurious TrainBoard Member

    10
    6
    2
    @FlightRisk it has been a while since i could get back to this project. regarding current readings on the main track (A0 & A1) i have an output when i send in the <c> command which i believe is a good sign of current monitoring and proper operation for H.O. scale.

    At idle :
    c CurrentMAIN 2 C Milli 0 1997 1 1997 a 1>

    While operating:
    I believe this is indicating my locomotive is drawing 409 milliamps which 1/2 an amp would be normal for H.O. I am not sure what a 210> is reporting ( perhaps the time it took to sample and report)

    <t1 3 90 1>
    <c>
    c CurrentMAIN 409 C Milli 0 1997 1 1997 a 210>
     
    Last edited: Mar 7, 2021
  17. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    Is it possible that message was truncated? It should look like this.:

    <c CurrentMAIN 409 C Milli 0 1997 1 1997><a 210>

    So it should be 2 separate messages, each surrounded by <>. Is that what you see or were there brackets missing? The second message is for backwards compatibility with JMRI and will be removed soon. The old DCC++ Classic sent an "a" response for the pin value of the current, which seemed inconsistent, and just the raw reading from 0-1024 from the Arduino analog pin. Our thought was that if we send a "c", so we should get back a "c" and the current should be in something meaningful like milliamps. So yes, we think you are seeing 409mA on the track. The other parameters are things programs like JMRI can use for display purposes like the name of the meter, whether this is current or voltage, maximum mA the board can deliver, and the value in mA that will trip the overcurrent warning and shut down the track.
     
    Mark Ricci likes this.
  18. appCurious

    appCurious TrainBoard Member

    10
    6
    2
    Mark Ricci and FlightRisk like this.
  19. Ash

    Ash TrainBoard Member

    106
    66
    8
    Here is a reading from a current sensor, which has a pin reading of 512 at 0A -- captured from the serial monitor. JMRI used to report current as a percentage; I think the <a 710> means 71%.

    <c CurrentMAIN 1539 C Milli 0 2218 1 2218><a 710>

    There is a comment in DCCEXParser.cpp:
    //'a' message deprecated, remove once JMRI 4.22 is available

    Perhaps the 'a' message should remain for a while. How quickly is one expected to jump on 4.22? If the 'a' message is missing, what problems does this cause for earlier versions of JMRI?
     
    Mark Ricci likes this.
  20. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    We will keep it for a while. JMRI would not read current if it didn't pars a message that started with "<a"
     
    Mark Ricci likes this.

Share This Page