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

Gregg Aug 25, 2015

  1. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    That's about it, make sure the zener is in the right place and right way round. Will you be trying the sketch later?
     
    Scott Eric Catalano likes this.
  2. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    All,

    Here's my cheap and simple set up for testing projects with the ESP8266.

    I bought a few of these as they are relatively cheap and available locally. I.E. don't have to wait for a 3 week slow boat from China.
    The 2 part module is known as the "Witty Cloud" development board. It's not breadboard friendly but is on a 0.1" pin pitch and down the page you can see how I got around that.

    Here's the assembled 2 part module. It has 3 push buttons on board and 2 micro usb connections. One is for programming via the built in serial interface on the lower board.
    There's built in voltage regulation too so we can power up from 5v usb.

    . P1020513.JPG

    My Breadboard rig is as simple as can be. I get to the pin-outs by bending the jumpers and plugging in to the area under the board.
    I have a preset pot on there, but a 220 ohm resistor will do. You can just make out the zener diode that drops to the ground rail.
    That is all you need for additional hardware, this is a very low cost no solder solution.

    P1020507.JPG

    P1020518.JPG

    Once you got programming done. Separate the two boards and plug in to your breadboard. Power up again from the boards independent micro usb,
    a phone charger is good. Again the top board has built in voltage regulation. You're good to go.

    These things were on promotion as they were new to market in January. Mine cost less than US $8.00 each including shipping from a UK supplier. Price is for the whole 2 part module.
    Other features are an on-board RGB LED and an Ldr.

    If your not keen on my breadboard idea, then customise by sawing down the centre groove and stick the two halves wider apart on a piece of hardboard.
    Or get 2 breadboards, detach the power rails on one edge and stick down, spaced wide enough apart accordingly.

    P1020523.JPG
    Steve.
     
    Last edited: Apr 9, 2016
    Scott Eric Catalano likes this.
  3. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Steve
    Waiting for some motor shields ... will report back after loading the sketch.
    Steve F
     
    Scott Eric Catalano likes this.
  4. w8one

    w8one TrainBoard Member

    89
    109
    5
    Scott Eric Catalano likes this.
  5. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
  6. sboyer2

    sboyer2 TrainBoard Member

    35
    41
    6
    just a note on the UNO it is available with a higher power regulator 7805 in TO-220 form factor goot for 2 to 2.5 amps with a heatsink. here's one found on ebay, there should also be some Megas with the same regulator.

    http://www.ebay.ca/itm/121835091377

    Steph
     
    Scott Eric Catalano likes this.
  7. sboyer2

    sboyer2 TrainBoard Member

    35
    41
    6
    and the sparkfun photon redboard is Arduino uno shield compatible for $40
     
    Scott Eric Catalano likes this.
  8. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Dave
    I am having the darnedest time getting an ESP8266 to load UK Steves sketch using either the Arduino IDE or NodeMCU-Flasher ( I think it might be a current issue with my breadboard power supply, yet its specs comply) or just the unstable and unreliable nature of the ESP8266 ...I have tried on 6 different ESP 8266 units. I am awaiting some Motor shields before giving up as I think I may have successfully loaded one of them (got the LED to flash during upload and no errors). In the meantime, have any of you experts written a controller sketch using an Arduino Ethernet shield to run a DCC++ base station using Engine Driver or other existing controller software? Thanks
    Steve F
     
    Scott Eric Catalano likes this.
  9. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Steve - When I program the ESP8266 using the IDE I have two buttons on the board - one for reset and one for program - I hold both buttons until it says UPLOADING - then I release the reset button and continue to hold the program button until dots start displaying showing that it is programming at which time I release the program button and let it finish up.

    see notes here: http://trainelectronics.com/WiFi-esp8266/Setup/

    Hope that helps

    dave
     
    Scott Eric Catalano likes this.
  10. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Dave
    Traced it down to a loose solder connection on my breadboard ESP8266 adapter (which is why the one ESP worked out) ..... I now have 6 ESP826 units loaded and waiting for my motor shields to arrive. You always seem to help .... even by inspiration and osmosis. :) Thanks again
    Steve F
     
    Scott Eric Catalano likes this.
  11. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Good to hear, Steve - once all of the bugs & other gremlins are removed all you have left is success!

    dave
     
    Scott Eric Catalano likes this.
  12. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Hi Steve,

    Pleased you got sorted with your ESP's, are you building a batch of units or something?

    On the Ethernet question, it's been done quite some time ago with various software. I guess it all depends what you would like from your set up.
    In the case of my mobile controller, I wanted a quick, any device (that runs a web browser) plug in throttle app that sets up in a minute or two and can be used by anyone.
    And importantly did not need a desktop or laptop computer to get a few trains moving. The beauty of the ESP8266 is that we can now do that as a very low cost addition to the system.

    Just recently, I've been tidying up the code and think we can call the result v1.0. I'll be revisiting the ESP webserver concept (controller page served from the ESP) shortly too.

    So where next, well I think I'm going to take a cue from Gregg's DCC++ Controller app and do an Html version. Briefly that will be something like a 10 channel (read trains) Throttle app,
    With session backup and other neat things, I've got lots of ideas, just need the coding skills. But it's doable for sure.

    If you need a few pointers on different software and connection configurations just shout. Oh and I did once connect Gregg's app via WiFi using just an ESP, without a router in the system.

    Steve.
     
    Last edited: Apr 15, 2016
    Scott Eric Catalano likes this.
  13. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Dave/Steve K
    If only that were true! ...... I have my stack (Uno/Motor Shield/ ESP Shield) assembled.. everything powers up with an external 5V power supply . Using an IP scanner I show the ESP at 10.0.0.7 ...... my router indicates that the ESP device at 10.0.0.7 is online (the ESP does not show up in "Network") .... (I have both my SSID and WEP pswd within the quotes in the DCCpp Websockets sketch, before up loading to the ESP) Using Chrome ws://10.0.0.7:81 reports that the website is not available. (FireFox just erases the ws: address and goes nowhere) ..... I am open to all suggestions on how to proceed.
    Thank you
    Steve F
     
    Scott Eric Catalano likes this.
  14. esfeld

    esfeld TrainBoard Member

    442
    382
    17
     
    Scott Eric Catalano likes this.
  15. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    shouldn't it be http://ipaddress:80 ? sometimes you have to hard code in Gateway, subnet, etc
     
  16. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Hi Steve,

    As I read things then, your ESP is connecting to your home network and is assigned 10.0.0.7 by your router. That's good, as the sketch is working as it should. It won't show up in 'Network' as it's not shouting
    it's ID as a computing device like a phone or TV or what ever. Now when you say using Chrome, for sure you have the correct format for the connection. But first you need an instance of the controller page
    open in a window here http://trainelectronics.com/WiFi-esp8266/Setup2/indexDCC++/indexDCC.html then alter the address in the top white box and hit the Connect button.

    The built in serial monitor will confirm things from there.

    Have fun.

    Steve.
     
    Scott Eric Catalano likes this.
  17. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Steve
    Realized that this AM and went to the controller page .... hit connect ... get response "Welcome Server ready" ..... power on ... enter cab # ... advance throttle ..... NO response from loco. So it looks like your sketch etc etc is working as it should but I am not getting power to the track. I have tried with another Uno..and another Motor Shield .. still nothing. I know it's not your area at this point, but if you could offer some suggestions from here I would be most appreciative.
    Steve F
     
    Last edited: Apr 16, 2016
    Scott Eric Catalano likes this.
  18. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Steve,

    Can you confirm that the Base Station (Arduino) is sending back replies to Mobile Controller serial display, i.e. you get something like <T1 35 1> when you move a throttle for example.
    If that's OK then we can confirm all connections are good from Browser>Esp8266>Arduino. Next is your Motor shield, are the 4 LED's lit on the output connections when you switch
    the power on in Mobile Controller? If that is all good, the next is track connection and the loco it's self.
    Just to clarify, responses from Base Station will be in angle braces <p1> etc. Other messages are from the ESP. You can get a status report from Base Station by using the <s> button.

    Steve.
     
    Last edited: Apr 16, 2016
    Scott Eric Catalano likes this.
  19. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Steve
    I get T1 and T2 when adding cab numbers but nothing else when I move a throttle. No, the motor shield LEDs do not light ... so no power is getting to the motor shield. I get Fn, new cab # and emergency stop responses but nothing in response to throttle changes
    Steve F
     
    Last edited: Apr 16, 2016
    Scott Eric Catalano likes this.
  20. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    OK that narrows it down a bit. The orange coloured messages are the 'serial monitor' they will continually scroll by as you use the Controller.
    My best guess is that the serial connections from ESP8266 to Arduino are not configured correctly.
    Arduino TX RX labelling can be confusing check Pin0 is arduino RX. Pin1 is TX

    Steve.
     
    Scott Eric Catalano likes this.

Share This Page