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

Gregg Aug 25, 2015

  1. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    esp1 (Small).JPG esp2 (Small).JPG
    I have 3.3V to VCC ....GND to GND ...ESP RX to resistor (thru diode) to Arduino TX and pin 4 to pin 13 ( as per Greggs schematics) NOTE: after studying Greggs photo I think I have my RX and TX reversed .... will try to rectify and let you know.
     
    Last edited: Apr 16, 2016
    Scott Eric Catalano likes this.
  2. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    From your photo it looks like you have the diode going to the wrong pin - the diode should go to the rx pin on the shield - looks like you have a resistor there.

    dave
     
    Scott Eric Catalano likes this.
  3. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Ah, a picture speaks a thousand words. Connections all good, you need 1 additional from ESP TX to Arduino RX, straight connection no further components necessary.
     
    Scott Eric Catalano likes this.
  4. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    From the photo everything looks good. The omission is the vital Tx from ESP. It would have worked had you omitted the other line instead.

    Ignore the arrows printed on the shield they are pointing the WRONG way. Add a wire as I've indicated and you should be good to go.

    esp2 (Small).JPG
     
    Last edited: Apr 16, 2016
    Scott Eric Catalano likes this.
  5. esfeld

    esfeld TrainBoard Member

    442
    382
    17
     
    Scott Eric Catalano likes this.
  6. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
  7. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Added ESP TX to Arduino RX ....... connects .. "power on" lights the Motor /Shield LEDs moving a throttle (Cab 75) shows <T1 126 1> but no response from engine 75 on track. Oddly with no throttle assignment (but power on) an engine (CV 1 = 3) gets power on the track and runs away.
     
    Scott Eric Catalano likes this.
  8. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    We're nearly there then.
    Base Station replying <T1 126 1> means Throttle 1 command, full speed sent in forward direction to what ever loco you assigned. Shame you don't get the Cab# back, but that's how Gregg configured things.
    Have these loco's been tested on any other working system?
    If yes, I can help with debugging.

    Steve.
     
    Scott Eric Catalano likes this.
  9. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    One thing to note, things must be done in a logical order for Mobile Controller to work.

    I've addressed this in later version. First get a Connection to ESP>>>Then turn the Power On >>> Then enter a Loco address >>> Then move the Throttle.

    Confirmation of all these actions will be shown in the serial monitor replies.
     
    Scott Eric Catalano likes this.
  10. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    I Follow that procedure each time I re connect .Yes all locos work on my regular layout and respond to their #s ...... These have been sound decoder locos .... When I put any non-sound decoder loco on the track it runs full speed the minute power is turned on whether I have assigned a throttle # or not and no matter what their loco (CV) number is.
     
    Last edited: Apr 16, 2016
    Scott Eric Catalano likes this.
  11. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Loco# addresses are registered in Eeprom on both the ESP and Base Station. So I'm guessing something messed up.
    Get a connection, then hit Exit Reset wait around 5 seconds, Eeprom will be cleared to default and the page will refresh.
    Reconnecting from there will reset Base Station as well.
    Then try things from there.

    Part of the software design was a choice between Save session or Clear to default at shut-down, which will be better implemented next release. It's easy to use once you got the hang of things.
     
    Scott Eric Catalano likes this.
  12. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Same behavior after Exit Reset or F5 page reload. Don't think it's an Eprom problem as a new loco (never entered and regardless of cab #) runs away on power up with no throttle assignment.
     
    Last edited: Apr 16, 2016
    Scott Eric Catalano likes this.
  13. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Hmm. We need to narrow that down to either Base Station or ESP.
    Disconnect your ESP shield. Then connect Base Station to the computer and get a serial monitor loaded and pointed to the correct USB port. The one in Arduino IDE is fine.
    With the loco on the track, type <1> at the window prompt and hit return, the system should power up. What is the behaviour of the loco now?
    If stationary, type <s> at the prompt, what is returned?
     
    Scott Eric Catalano likes this.
  14. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    <1> returns <1> <s> returns <s> Unfortunately I now have to attend to a family obligation. Thank you for your attentiveness. I will have to continue to try to see if this is a base station issue tomorrow ...... thank you again, you are a champ for helping me through this.
    Steve F
     
    Scott Eric Catalano likes this.
  15. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    That's OK Steve,

    I really want this to work for you, as one of the first users, I'm looking forward to your feedback once we got things sorted.

    From your last few tests, it looks like the serial connection was not good to the Base Station. Echoing back the command is not normal.
    <1> should have returned <p1> and powered up the motor shield
    <s> should be returning something like <p0><iDCC++ BASE STATION FOR ARDUINO MEGA / ARDUINO MOTOR SHIELD: BUILD Mar 31 2016 21:54:52><N0: SERIAL>

    Have a look into this and once it's working try sending a few commands to some loco's. Powered up with a <1> first of course.

    In the format <t1 521 35 1> where t1 is a throttle ID, 521 is a loco address, 35 is a throttle setting between 0 and 126, and 1 is the forward direction (0 = reverse).
    If that all works without issue then we'll have another look at the ESP8266.

    Steve.
     
    Scott Eric Catalano likes this.
  16. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    "Morning Steve ....... This morning I have eliminated the motor shields as a problem via substitution (they work when hooked up to a Mega on Greggs infra red controller)....... I now get the proper responses to <1> & <s> as shown in your reply ( but is a build April 17 2016) but the minute I execute <1> power, a loco runs away at full throttle .... thinking that the this is because the loco is DC compatible I measured track voltage and I am getting 13.5 V DC (I am using a 15V power supply) so it appears that my UNO (with latest Base Station uploaded) is not triggering PWM to the Motor Shield. The same UNO/Motor shield stack exhibits the same (loco runaway) behavior when using Greggs controller sketch running in Process.
    <t1 12 35 0> gets no response. At this point the ESP is not in the picture so until the power issue is solved we can eliminate that.
    Steve F
     
    Last edited: Apr 17, 2016
    Scott Eric Catalano likes this.
  17. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Hi Steve,

    I had a feeling the problem would be somewhere in Base Station / Motor Shield. I can't see it being a DC issue though.

    As I'm not altogether familiar with different loco decoders, are there any on the market that can memorise a throttle position even after a power down? Like what would happen with
    a derailment and subsequent return to the track and continue so to speak.

    Getting a response to <1> and <s> from Base Station doesn't quite eliminate the shields just yet, those responses are a reply from the arduino.
    We can just about say that Serial comm is clean and working both ways.
     
    Last edited: Apr 17, 2016
    Scott Eric Catalano likes this.
  18. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Yes, some decoders do but putting loco 12 (which I have been using) on my main DCC layout it responds normally (stopped until throttle is advanced). Do you think that there is a possible difference in the build dates ( I no longer have access to Base Station build April 17 2016?
    The stack is definetly putting out DC as if I reverse the output leads to the track the loco takes off in reverse!
     
    Last edited: Apr 17, 2016
    Scott Eric Catalano likes this.
  19. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Steve,

    The build date is just the day you uploaded the sketch to the Arduino.
    What I think might be wrong, is that there is some incompatibility with the runaway loco (decoder) and the DCC++ system.
    Can you get control of any other of your Loco's on the DCC++ system?
    Test for now just by issuing commands via the serial monitior.
     
    Scott Eric Catalano likes this.
  20. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    No I have no control of anything on the DCC++ system except power on/off and yet before starting the new project, my UNOs with base station/Motor Shield and Greggs Controller worked like a charm ..... now using the UNO/Motor Shield stack and "DCCppUno.ino" sketch give me this erratic behavior.
    Issuing commands via the serial monitor gets no response from the locos ... all locos used exhibit normal behavior on my regular DCC layout. Again, I think that the behavior when reversing track power leads from the DCC++ stack to the track indicates that the stack is putting out DC and not PWM DCC.
     
    Scott Eric Catalano likes this.

Share This Page