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,

    If you're up to speed with my latest developments and you would like to try them out, then sure I can do you a custom page with adjustments like blank IP no problem.

    Today I have just got the new server code working and ready for you guys to test. I'm running an example page all from the ESP now, which makes the whole thing self contained.
    I think you will love the new Roster feature and it's ability to run up to 10 throttles at once. My example page just downloads itself from the ESP 'Webserver' and is configured to
    auto-connect the Socket. Click the <s> button and Base Station sends the current Throttle Status and updates your page to any current session you have running. Should work with
    multiple devices (up to 4) as well. For you I've done all this on the current twin throttle page. Future variations will now all run on the same server code.
    It's the Future !!!

    Steve.
     
    FStop8 and Scott Eric Catalano like this.
  2. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Steve
    Where can I get the latest ESP 8266 sketch to upload and try out the new stuff?
    Steve
     
    Scott Eric Catalano likes this.
  3. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Hi

    The short answer is you can't just yet, this is so new, I've only just finished up a working server.
    First I need to ask a few questions on what you'd like to do.
    If I remember correctly, you have several ESP's at your disposal, so I would recommend you go the whole hog and work to getting a self contained install working.
    You will need to set aside some spare time as this whole thing takes in some new software and techniques. Don't be daunted by this, as once you get the hang of it
    you'll be flashing new updates in just a few minutes.

    First you need an additional tool for the Arduino IDE. This will enable you to upload files to the SPIFFS file system.

    Go here https://github.com/esp8266/Arduino/blob/master/doc/filesystem.md

    Closely follow the instructions under the heading.
    Uploading files to file system

    Note the install on my machine goes here

    C:\Users\Steve\Documents\Arduino\tools\ESP8266FS

    I'll be on hand for several hours let me know when you have got this done.

    If your not quite ready for this just yet, get back to me and we shall move to the other option of serving the files from your local device.
    We can't use a generic copy any more, as rather like Gregg's DCC++ Controller app you'll need a personalised copy for your layout.
    I'll do the configuration for you so don't be too concerned over that.

    Steve
     
    Last edited: May 3, 2016
    FStop8 and Scott Eric Catalano like this.
  4. TwinDad

    TwinDad TrainBoard Member

    1,844
    551
    34
    I'll look into this... looks like it's crashing not being able to find the images used for the digits.

    Just so it doesn't get lost in the shuffle, can you repost this error in the DCC++ JMRI thread?

    Thanks!
     
    sboyer2 and Scott Eric Catalano like this.
  5. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Steve
    Been trying to get around it for a while now ...... I have completed everything up to "create a directory named data" I am stuck at: Select Tools > ESP8266 Sketch Data Upload .... I keep getting an error that my data file is empty. I do not understand this: "............and any files you want in the file system there" I am sure that this is my problem because my data directory is empty ..... what files go in here?
    Steve
    Steve
     
    Scott Eric Catalano likes this.
  6. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Whoa,

    One step at a time. Sorry I was just going a step at a time so we didn't miss anything. It seems you have the tool installed correctly and the new entry is in your tools menu. Great stuff.

    Our project sketch folder can be anywhere, for convenience I put mine on the desktop. In that folder you need another new folder called 'data'.
    In the data folder will go the Page file and its dependencies. You should have copies of the dependencies if you have downloaded the zip of the project from my repo on Github.
    We don't need the old .html file in there. And there is some other interesting stuff we can include another day.

    That just leaves a preconfigured copy of the .html and the server code which I can post here.

    To do that for you, can you post a list of the loco addresses you would like including up to 10 max. Or I can do an 'open' copy where you enter them yourself.
    Also would need to know how many 'entry boxes' to include from 2 to 10.
     
    Scott Eric Catalano likes this.
  7. crusader27529

    crusader27529 TrainBoard Member

    247
    167
    11
    In preparation for attaching some motor drivers other than the 2 'supported' units, I wanted to do some testing as per defined previously in this thread....

    My problem is that the <D> command doesn't do anything! It doesn't return with a response on the serial console as expected, so it doesn't slow down the signals to show what's happening. The <1> or <0> command work, so the communications work OK.

    I'm using the standard Base Station release 1.2.1. Is the Diagnostic command in this version or some other release???
     
    Last edited: May 3, 2016
    Scott Eric Catalano likes this.
  8. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Steve
    locos: 3,85,75,18 and two "open" would be great ....... can you give me an URL for your repo on Github to make things easier from which I will take the Page file and dependencies to put into the Sketch folder on my desktop. ..... and I will await further instructions
    Steve
     
    Scott Eric Catalano likes this.
  9. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Steve

    You'll also need at least one more library installing, get it here https://github.com/me-no-dev/ESPAsyncTCP
    And if ESPAsyncWebServer is not in your library collection (look in here >> C:\Program Files (x86)\Arduino\hardware\esp8266com\esp8266\libraries) then you'll need this as well https://github.com/me-no-dev/ESPAsyncWebServer

    Server code below. Change the extension to .ino place in your new sketch folder, rename the folder to "DCCppSServer". Load to Arduino IDE, enter your SSID and Password in the sketch.
    Upload to your ESP as you've done before.

    That just leaves the Spiffs bit to do.
     

    Attached Files:

    KC Smith and Scott Eric Catalano like this.
  10. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    https://github.com/indev2/DCCpp-WebSocket

    Quick question. What devices will you be using on?
     
    Scott Eric Catalano likes this.
  11. esfeld

    esfeld TrainBoard Member

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

    UK Steve TrainBoard Member

    453
    683
    12
    Current layout will render well on the tablet.

    If you get problems on the cell I'll re-jig things a bit

    Here's your personal page. Change the extension to .html and put in the data folder that is in your sketch folder. We're nearly there.
     

    Attached Files:

    Scott Eric Catalano likes this.
  13. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    There are some loose ends to tidy up but I think you'll be able to get the idea.

    Now for the Spiffs bit.

    With all the files now in the data folder. Relaunch the DCCppServer sketch. With your ESP connected and in flash mode,
    Select the ESP8266 Sketch Data Upload in the tools menu. Confirmation of the upload starting should be confirmed then wait it can take several minutes depending on flash memory size.

    Then the magic bit hopefully, with your esp running point a browser to your esp IP address no slashes or file names required.

    If page comes back ok fill in the address box (now blank) with the address in a slightly different format............. ws://***.***.***.***/ws............. no port number required.
     
    Scott Eric Catalano likes this.
  14. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Steve
    Compiled and uploaded sketch to two of my ESP successfully ..... I take it that indexDCC.html goes in a "data" folder within the DCCppSServer folder or does it go in ".......users/spf/documents/arduino/data"
     
    Scott Eric Catalano likes this.
  15. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    Correct. I guess you missed that bit in #1192 ;-)

    Oh and you can 'test' the page by running it directly from the data folder, it should just open in your browser.

    If all is well you can simulate a session as long as your esp is connected to Base Station. You don't need to be connected to the layout.
     
    Last edited: May 3, 2016
    Scott Eric Catalano likes this.
  16. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    So far so good ....... thank you thank you .... I will have to continue in the morning and report back.
    regards
    Steve
     
    Scott Eric Catalano likes this.
  17. UK Steve

    UK Steve TrainBoard Member

    453
    683
    12
    You can assign any Loco to either throttle in any order, once its moving you'll see some magic confirmations. Get them all running at the same time.
    See what happens when you stop one. If you happen to disconnect the device, no worries just reconnect and hit <s> you're right back with it.
     
    Scott Eric Catalano likes this.
  18. sboyer2

    sboyer2 TrainBoard Member

    35
    41
    6
    no problem, done, should have thought of that in the first place :oops:
     
    Scott Eric Catalano and TwinDad like this.
  19. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    'morning Steve
    The page opens but on connect I get an error that says "Web Socket closed" on my computer and tablet. I can successfully ping the ESP but still get "Web Socket closed" when trying to connect from the web page. Any ideas?
    Steve
     
    Last edited: May 4, 2016
    Scott Eric Catalano likes this.
  20. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Also thought you would like to see the rendering in Chrome on my computer ( similar in tablet)...... the second pic goes under the first both all the way to the left with empty space on the right.............not what I use to get from your original.
     

    Attached Files:

    Scott Eric Catalano likes this.

Share This Page