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

Gregg Aug 25, 2015

  1. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Hi Steve,

    Almost

    Server.value is derived from this line near the top of the page.

    <input type="text" class="form-control" id="server" value="ws://192.168.11.39/ws" placeholder="Server 'IP Address'" style="font-size:12px;width:145px;height:35px;">

    The first part being the elements 'id' (server) then the 'value' attribute of 'server' in reality........... "server.ws://192.168.11.39/ws" per my example, and value=" is where you'd enter the address.

    Further down the page look for this bottom line of function init()

    function init(){
    sessionStorage.setItem("dirA" , "1");
    sessionStorage.setItem("dirB" , "1");
    sessionStorage.setItem("T1" , "<T1 0 1>");
    sessionStorage.setItem("T2" , "<T2 0 1>");
    sessionStorage.setItem("T3" , "<T3 0 1>");
    sessionStorage.setItem("T4" , "<T4 0 1>");
    sessionStorage.setItem("T5" , "<T5 0 1>");
    sessionStorage.setItem("T6" , "<T6 0 1>");

    //connect(server.value); // Auto connects the Websocket.

    Removing the first 2 comment slashes activates auto connect. Attached is the latest code for you to try (still personalised with your loco's).
    Hope a quick extension change will work this time.

    Steve.
     

    Attached Files:

    Last edited: May 9, 2016
    Scott Eric Catalano likes this.
  2. esfeld

    esfeld TrainBoard Member

    443
    382
    17
    Steve
    I have finally come up with a work around for changing txt to html without standing on my head. The new page works beautifully. I still get occasional "Web Socket closed" and even failure to turn power on ...... but can get around them by restarting everything.
    Steve F
     
    Scott Eric Catalano likes this.
  3. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Great stuff, enjoy.

    S.
     
    Scott Eric Catalano likes this.
  4. esfeld

    esfeld TrainBoard Member

    443
    382
    17
    UK Steve/Gregg/Twin Dad
    Been awfully quit on the board lately .... have we come to a plateau in development? I feel the need for a project. :) :)
    Steve F
     
    Scott Eric Catalano likes this.
  5. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Hi Steve,

    I'm getting a similar feeling but I don't think it's a plateau as such. I'm guessing that now we can out in the spring sunshine, we've all got a little more to do with our spare time.
    Least I hope that is the case. Thinking back to what has been suggested or in some cases started, there is some mileage left in the project for sure.
    In my case, I'm still doing some work on the single throttle page design. I hope to have a working example ready quite soon.
    I know Gregg and Twin Dad keep popping in occasionally, so I guess they are up to speed.
    There is still a bus system of sorts on the drawing board I think and Gregg's 'Server Station' still to come.
    After 'WebThrottles' and supplementary pages I'm going to look at other uses for the ESP.
    Would be great if some of us could collaborate on a development now and then.
    Any ideas?

    S.
     
    Scott Eric Catalano likes this.
  6. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    All,

    Coming soon. It just about fits on 600 pixels across. Should be ideal for tablets and hi res phones.

    CaptureQ.JPG

    Steve.
     
  7. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    All,

    I think the 'page' code for the screenshot above is about ready for you guys to try out.

    If your intended display device is less than 600 pixels width (portrait mode) then sorry its not for you just yet.
    I can maybe shrink it down if there is ever a demand.

    This morning I ran it along with the twin throttle design, and can confirm both instances will stay in sync (excepting function switching) when used simultaneously.

    I'm about finished as far as throttles go in html format. Save for minor updates to what we have now.

    However for anyone interested in the wifi connectivity side of all this, and going back to something I mentioned a while ago.
    I have recently found a Websocket plug-in for Processing. This should make it easy to add this connection protocol to Gregg's DCC++ Controller application.
    Adding yet another layer of simultaneous controllability to the mix. As I mentioned also that my throttles are now (more or less) fully compatible with
    with the whole DCC++ system. So for as little as $5 you can add a wifi>serial connection to your set-up and do away with those usb cables :)
    Interested here https://github.com/alexandrainst/processing_websockets

    The new ESP_AsyncServer by Me_No_Dev that I have recently started using also does raw TCP so you could also connect DCC++ Controller, JMRI and others just by pointing
    to an IP address in the traditional way. I think it may now also be possible (don't quote me on this) to run both protocols simultaneously and interactively with his very powerful Async software suite.

    Steve.
     
    Scott Eric Catalano and esfeld like this.
  8. esfeld

    esfeld TrainBoard Member

    443
    382
    17
    Steve
    Just so that you don't think your work is falling on deaf ears ...... I am still thrilled with your ESP throttle, and yet, in my case, see no need for a speedometer. Gregg never answered my query about using 12 volts to power an UNO and allowing it to pass to the motor shield thru the originally disconnected Vin pin (thus doing away with a "power in" cable to the motor shield. I tried it with 9 volts but got slow loco performance. I am reluctant to try it with 12 volts as I have read about overheating the UNO using 12 volts. If I could run my stack with just two wires (12 volts to UNO and motor shield [via Vin pin] .... and a track connection) with your ESP throttle I would be a happy puppy.
    Regards
    Steve F
     
    Scott Eric Catalano and UK Steve like this.
  9. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Hi Steve,

    Yes, I can see the benefit of a single power source. Very neat and tidy. 12 volts is probably just on the limit, but we should also consider current draw.
    I can't say if you'd would be safe or not.

    On the throttle, yes the speedometer is a bit of show as are the yellow flashing radio buttons (only on my throttle :)).
    Just wanted to make a point over some rather pricey software and even more pricey hardware that is available.
    We're catching up !

    Enjoy your day.

    Steve.
     
    Scott Eric Catalano likes this.
  10. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    Hello UK Steve,

    I've been contemplating about purchasing the new all in one Wifi Arduino...this way I could run conventional and Wifi at the same time....what are your thoughts? - Scott
     
    UK Steve likes this.
  11. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Hi Scott,

    Yes, go for it. I'd love to get the low down on that device. As I said when we last discussed, it should give a no fuss solution straight out the box.

    S.
     
    Scott Eric Catalano likes this.
  12. sboyer2

    sboyer2 TrainBoard Member

    35
    41
    6
    i'd like to second this... your work is appreciated, having demonstrated the basic DCC++ command station to the club i'm in, 3 other members have decided to order the parts and build a system for themselves, including me and 2 other members for the "esp" version. we are currently waiting for those parts.

    great work, updates eagerly anticipated

    Steph!
     
    Scott Eric Catalano and UK Steve like this.
  13. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Steph,

    Thank you for those kind words. I'll be on hand if you guys need help through the "build".

    Regards.

    Steve
     
    Scott Eric Catalano and sboyer2 like this.
  14. sboyer2

    sboyer2 TrainBoard Member

    35
    41
    6
    Thanks.

    it'll be a few more weeks before the parts arrive. i'll set up mine first, documenting everything, then build en-masse the rest with the club members who ordered them, as to minimise confusion and mis-wired parts, also to give others the chance to see how easy and neat the system is. so little cash and time spent to get something that can give a Digitrax zephyr a run for it's money.

    to make a somewhat clean hardware installation, i chose to order these from eBay

    the esp module: http://www.ebay.com/itm/1PCS-ESP826...sceiver-Send-Receive-LWIP-AP-STA/171907296150
    a standard esp-01 (easiest to interface and find)

    the esp converter board: http://www.ebay.com/itm/ESP8266-ESP...evelopment-Tool-Board-Auto-reset/111819907565
    converts 3.3v to 5v and gives you your programming button, with minimal fuss.

    a prototyping shield: http://www.ebay.com/itm/321345048317
    to keep everything clean and with plenty of room to modify or add stuff should the need arise.

    best of all: the total for these 3 items are UNDER $10 USD
    and with the previous purchase of the UNO and Motor Shield for $15 USD
    this brings the complete total to $25

    the power supply i already had from an old Laptop ( DC 15Volt @ 5Amps ) so that was free

    as an aside: the prototyping shield has plenty of room, that i'm tempted to forgo the UNO and replace it with the NANO (an UNO in smaller size) it has all the UNO's connections and could be placed on the shield with the ESP, and this stacked on top (or under if height-wise there is enough room) for a more compact installation. i guess you could use a PRO but the difference in price is less than a dollar and you get USB onboard with the NANO, which makes it much easier to reprogram "on-the-fly" should the need arise when away from homebase.

    Steph!
     
    UK Steve and Scott Eric Catalano like this.
  15. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Hi Steph,

    I like your thinking on the Nano. Not sure if it's possible to to run Gregg's Base Station code on that device at this time. Perhaps other members could chime in here. Hey guys ?????

    Looking through your list I note an important piece missing.

    In the pic from the ebay listing, a programming interface (USB > Serial) will be required to get the Server code onto the ESP

    $_12.JPG

    That is the extension board on the right terminating in a micro USB connector.

    You will however only need 1 of these as you can share it across your group.

    Hope this helps.

    Steve.
     
    Scott Eric Catalano likes this.
  16. sboyer2

    sboyer2 TrainBoard Member

    35
    41
    6
    Nope not missing, it's simply NOT needed, you use the UNO directly, jumper reset line to ground, and the USB is now strait to the esp and you select UNOasISP in arduino/eclipse

    second , the NANO is a UNO ( same chip 328) no programming difference, whatsoever. exact same specs, only shield size is different.

    Steph!
     
    Scott Eric Catalano and UK Steve like this.
  17. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    On your 1st point. Well I learn something new every day ! That's not a technique I've ever seen documented, and I've done lot's of reading these last few months.
    That's a whole load of usb>serial cards people wont need, good work.

    Steve.
     
    Scott Eric Catalano and sboyer2 like this.
  18. sboyer2

    sboyer2 TrainBoard Member

    35
    41
    6
    this technique is documented in the installation of a bootloader on arduino boards, it is used to upload a new bootloader onto a uno/nano/mega/etc... that was received without it's bootloader, you put your working master board in reset mode so that the usb will go straight thru to the rs/ts lines to the waiting blank board.

    this basically makes the arduinos unbrickable as long as you have a spare to burn with.

    last year a friend ordered 3 UNO's and they were all missing the bootloader, took all of 5 minutes to fix them. a very neat function, and a real lifesaver for those boards.

    here's how to do it (second example is the serial way, just replace the 328 with the esp) the other examples is for the boards

    https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard

    Steph!
     
    Scott Eric Catalano and UK Steve like this.
  19. sboyer2

    sboyer2 TrainBoard Member

    35
    41
    6
    and more specifically, here's how to use the UNO as a USB to SERIAL connection to a bluetooth or wifi board.

    http://www.princetronics.com/arduino-uno-as-usb-to-serial-ttl-converter/

    can you tell that i really love these Arduinos... when i was in school ( so many decades ago...) we were doing assembly on the Motorola 6809 (8MHz) using 6551 for serial, 6821 for dual parallel I/O, and could only do less then these Arduinos and with a lot more chips, and when you wanted to change the program, out came the UV eprom eraser, and a 20 minute wait before you could burn a new program.

    a heck of alot more fun now.

    Steph!
     
    Scott Eric Catalano and UK Steve like this.
  20. esfeld

    esfeld TrainBoard Member

    443
    382
    17
    Hi Steve
    Hope all is well. Trying to use an older Galaxy S3 cell .... indexDCC.html is not rendering correctly. I get "stop" buttons overlaying the throttle sliders. Specs show the S3 as 1280 pixels wide and 720 pixels hi ....... on Android 4.3 ....It's usable but only with one cab slider functional. ..... any ideas?
    Regards
    Steve F
     
    Scott Eric Catalano likes this.

Share This Page