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

Gregg Aug 25, 2015

  1. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    I took a closer look at the schematic and see that, once the trace is cut, the motor power only goes to pin 6 on the L298 - The warning on the schematic is only if the trace is not cut.

    dave

    [​IMG]
     
    KC Smith and Scott Eric Catalano like this.
  2. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    I've added the CR/LF myself...also I've made my own GUI program and added responses myself to talk
     
    sboyer2 likes this.
  3. esfeld

    esfeld TrainBoard Member

    443
    382
    17
    Scott
    Could you give us more info on your GUI .... while I love Greggs Controller, it is a bit verbose for those of us looking for just forward/reverse/lighting and functions. Thanks,
    Steve
     
    sboyer2 and Scott Eric Catalano like this.
  4. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    OK, if anyone is brave enough to actually TRY the WiThrottle interface for me, you can download the code from my personal github account:

    https://github.com/msunderwd/BaseStation-Uno

    You will want the "WiThrottle" branch.

    You should be able to set WiThrottle (or EngineDriver, etc.) to point to the BaseStation as the WiThrottle server (use the Base Station's IP and Port number), and connect directly. *IF* it works, of course. Which I doubt it will on the first pass.

    There will be some debug information (probably not the debug I need) posted to the serial port.

    If you want to get fancy, you should ALSO be able to connect a regular DCC++ controller (or JMRI) over the ethernet port at the same time, and the parser should be able to handle commands from both at the same time.

    Let me know what happens, OK??
     
    Scott Eric Catalano likes this.
  5. mikegillow

    mikegillow TrainBoard Member

    116
    117
    13
    Dave - I would love to see a fleshed out description of the overall setup you used if you have the time. JMRI? What did you use for Throttles?
    Thanks, Mike
     
    Scott Eric Catalano likes this.
  6. HVT

    HVT TrainBoard Member

    74
    93
    15
    TwinDad,
    What about running JMRI via the USB at the same time as a direct connected WiThrottle?
    Dave
     
    Scott Eric Catalano likes this.
  7. esfeld

    esfeld TrainBoard Member

    443
    382
    17
    TwinDad
    I am ready to try your code .... you are calling it "BaseStation-Uno" is that just in keeping with the original nomenclature? Will it also work with a DCC++ Mega?
    Steve
     
    Scott Eric Catalano likes this.
  8. esfeld

    esfeld TrainBoard Member

    443
    382
    17
    ...........................added the updated V2 ethernet.h ..still getting errors in trying to compile the sketch
     
    Scott Eric Catalano likes this.
  9. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    Yes, that should work as well. Part of the "genius" of Gregg's implementation with the < > brackets is that debug messages are neatly ignored by the JMRI command parser.

    Belay that... I'm not sure the code in SerialCommand.cpp can handle incoming data from more than one port... yet...

    Yes, I just didn't rename my fork of the repository. It will work with the Mega, if you set the stuff in Config.h correctly. I don't own an UNO :)

    Hmm... do you have the right include file un-commented in Config.h?

    What errors are you seeing?

    The WiThrottle doesn't directly use the Ethernet library. It just intercepts the stream of bytes coming from whatever port is connected and looks for WiThrottle-formatted messages. So you should probably get the Ethernet/DCC++ stuff working first before trying WiThrottle. If adding the WiThrottle code is still causing compile errors, post up what's going on and I'll try to fix it.
     
    Scott Eric Catalano likes this.
  10. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Mike - the setup was a Windows laptop running JMRI (version 4.1.5) - the Arduino & motor shield plugged into the laptop's USB port. The power to the motor board was from a retired laptop power supply - it put out 15 volts at 2 amps.

    JMRI has on-screen throttles (see image below) - we opened three throttles - two to run the trains on the main line and the third to work an engine on some sidings.

    For more information on JMRI see http://jmri.sourceforge.net/ --- for information on compatibility between DCC++ and JMRI see http://jmri.org/help/en/html/hardware/dccpp/index.shtml

    It worked well for us but hand held Digitrax throttles are much more convenient - you also have the option of using your cell phone to act as a throttle using a free Android app called Engine Driver (I believe the is one for IOS, too) - To use the phone app you run an application on the JMRI computer that broadcasts its availability over WiFi - the phone has to be logged into the same WiFi network - The Engine Driver app should find the server and let you control a train from it. For more info on Engine Driver see http://enginedriver.rrclubs.org/

    The Science Center where we were operating had WiFi but, unfortunately, they blocked the ports on their system that are needed to use Engine Driver - One can set up a simple wireless network with just a wireless router that will allow you to use the phone app. That is something we may do the next time we set up there.

    Hope that helps ---- Please let me know if you have any questions

    dave

    [​IMG]
     
  11. esfeld

    esfeld TrainBoard Member

    443
    382
    17
    Got it to compile, but, my bad ..... I am using an Arduino wireless shield, which I thought you were developing for, not an ethernet shield ........ inorder to conform to what you are developing I will have to replace the shield and then proceed.
     
    Scott Eric Catalano likes this.
  12. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    No, it should work with a Wireless shield as well... remember, WiFi is just Ethernet without wires. The WiThrottle code doesn't care what ethernet link you use (wired, wireless, etc.) It's just parsing the incoming data stream looking for WiThrottle-formatted commands.

    In fact, my intended endgame is to use a WiFi shield to directly connect phones to the base station... but a person lacking a WiFi shield could use an Ethernet shield with a wireless router to get the same effect (with more hardware).

    Just make sure it will compile with your WiFi shield's library, and it should work... if there is stuff within the WiThrottle code itself that is preventing this, let me know and I'll fix it.
     
    Scott Eric Catalano likes this.
  13. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    The iOS version is WiThrottle... it's available in the App store as a free "light" version and a paid full version. The "light" version is all you need to run a locomotive.

    You can force WiThrottle/EngineDriver to use a specific port... even Port 80 if you really have to (though that has some obvious downsides)... if you are in a place with blocked ports.
     
  14. esfeld

    esfeld TrainBoard Member

    443
    382
    17
    Progress ..... your code is fine .......compiled and uploaded ....I haven't analyzed your code yet to see if you assign any IP ........ is there a way to assign a fixed IP to the base station? I scan my network but can't seem to discover the base station IP or port.
     
    Scott Eric Catalano likes this.
  15. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Thanks for the info on ports - that could come in handy!
    dave
     
    Scott Eric Catalano likes this.
  16. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    From looking in DCCpp_Uno.ino, on line 256 the call to Ethernet.begin(mac) uses DHCP to acquire an IP address for the interface. You can change this to Ethernet.begin(mac, ip) where ip is a 4-byte array something like [ 192, 168, 0, 7] to specify a fixed IP address.

    The port number is set in Config.h
     
    KC Smith and Scott Eric Catalano like this.
  17. KC Smith

    KC Smith TrainBoard Member

    109
    111
    12
    Hi Guys.

    Just Verifing;
    Is JMRI Release V4.1.5 still the only DCC++ supported Version?
    If so, I use the JMRI Test Version 4.1.5? correct

    On the JMRI site I see Production Versions 4.0.1 and 4.2 and Test Version 4.1.5

    In additions to Greggs DCC++ Controller 1.1.0
    For Android Controller testing purposes do I use JMRI
    DecoderPro 4.2
    PanelPro
    and Engine Driver 2.11

    Thanks
    Kevin
     
    Last edited: Jan 12, 2016
    Scott Eric Catalano likes this.
  18. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    JMRI 4.3.1 and future releases will also support DCC++

    Only 4.1.6 and 4.2.x are missing support.
     
    Scott Eric Catalano likes this.
  19. KC Smith

    KC Smith TrainBoard Member

    109
    111
    12
    Got it ... Test Version 4.1.5 now then 4.3.x mid year
    Thanks
     
    Scott Eric Catalano likes this.
  20. HVT

    HVT TrainBoard Member

    74
    93
    15
    Kevin,
    Actually 4.3.1 came out December 31, 2015, and 4.3.2 was released January 8th.
    Dave
     
    Scott Eric Catalano likes this.

Share This Page