ESP32 Command Station

Atani Dec 10, 2017

  1. AndyH

    AndyH TrainBoard Member

    77
    9
    6
    Same as I'd have to anyway for the Prog track. Can I use the same inverted signal that feeds into my ops h bridge or would I have to make a fresh one?

    Sent from my SM-N976B using Tapatalk
     
  2. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    You might be able to use the same. Which h-bridge are you using for OPS?
     
  3. AndyH

    AndyH TrainBoard Member

    77
    9
    6
    Bts with 5a poly fuses.

    Sent from my SM-N976B using Tapatalk
     
  4. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    You can try and use the same inverted signal. If you are using a transistor make sure to have the bias resistor otherwise it may sink too much current and the signal may not be usable for more than one device.
     
  5. tusharpc

    tusharpc New Member

    5
    0
    13
    hi all and Atani, I'm just discovering the esp32 dcc command station (yes I was living under a rock) and im really intrigued at its capabilities. I'm quite well versed with Esp8266 and also by extension esp32 for several arduino projects, though my coding skills are limited.
    I'm slowly reading through the several pages on this message board but was hoping if some experts here can help point me in the direction of a updated instruction set on how to install and run the command station program on my ESP 32 dev kit C board. I have also read through the command station wiki that is provided on Github but still struggle to see some basic installation direction using platform io or expressiff idf, is there a guide for this ? I intent to use bare l298 chips as i have those laying around (as i wait for a motor board to be delivered)
    essentially looking to get started with installation and setup instructions and what files i should lok at for pin configuration so i can breadboard the esp32 command station?
    PS im well versed with arduinos and basic hobby electronics and robotics so i understand risks, issues and basic electronics circuitry.
    thanks in advance.
     
  6. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    https://atanisoft.github.io/ESP32CommandStation/building-esp32cs-idf.html should cover this. Note there is no wiki for ESP32 CS. Also note that Platform IO is *NOT* recommended due to fixes from ESP-IDF not making it into the PlatformIO bundled copies of ESP-IDF.
     
  7. tusharpc

    tusharpc New Member

    5
    0
    13
    thanks @Atani , I've been reading through that overview link you provided and i must admit im not quite following this, its my lack of coding skills showing here, im only familiar with Arduino IDF.
    Is there a "esp32 CS" for dummies version or a you tube video i can follow? right now im really just looking to get started with basic functionality.
     
  8. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    There are no plans to support Arduino IDE which does not allow reconfiguration of the ESP-IDF core which the CS is built upon.

    You can try using a pre-built binary, you can download a copy from https://github.com/atanisoft/ESP32CommandStation/actions/runs/505778788 (scroll down to the artifacts section and use the first zip). There should be a readme file in the zip which gives instructions on how to use esptool.py (or similar flashing tools) to flash the binary files to the esp32.

    The pins used would be for an Uno form-factor ESP32 using an Arduino Motor Shield (and compatible clones like Deek-Robot)
     
  9. tusharpc

    tusharpc New Member

    5
    0
    13
    ah thanks, so I got it uploaded, running and connected to my home wifi, now I need to figure out the pin mappings, is there a reference (schematic) on what pins are connected where ? or is there a config file i can check to see critical pin outs?
     
  10. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    Take a look at the Kconfig and/or KConfig projbuild files in the repository. They will have the default mappings. There is no schematic of the pins available today for generic builds as nearly all pins can be remapped via config.

    I'd also suggest monitor the serial console output as it should also print out critical pins.

    Sent from my ONEPLUS A5010 using Tapatalk
     
    tusharpc likes this.
  11. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    It's been a few months since I posted any updates in here... The project is very much alive and progress is being made on multiple fronts!

    First, there is a new "2.0" branch in the repository that is a streamlined version of the code which compiles with ESP-IDF v4.3 (or later). There are a number of major changes in the new code, the biggest of which being dropping support for a number of optional modules since they were not very maintainable or really usable. Additionally the OPS and PROG tracks will not be independently operated, if one is ON the other will be OFF.

    Functionality of the 2.0 CS:
    • Integrated web server for direct train control via mobile / pc browsers.
    • Accessory decoder DB (includes virtual accessory decoders that translate to OpenLCB events).
    • Train DB (roster) which is used to track locomotives.
    • Status LEDs, five WS2812 (or similar) LEDs used to indicate current status of the CS.
    • Status Display (OLED or LCD) for displaying current status.
    • OpenLCB Bootloader support for remote firmware upload from within JMRI over OpenLCB CAN connection.
    • OpenLCB Train Search Protocol, used by TCS UWT-100 / UWT-50 devices to locate the locomotives as part of Traction Control.
    • Current Sense and Temperature monitoring is now done via the ESP32 ULP Co-Processor. If thresholds are breached the ULP will alert the main processor that it needs to take action on something. Thresholds are configured for OPS track short, PROG track ACK and PROG track short.
    The custom CS PCB has gone through a few redesigns and I have what hopefully will be the final revision in-hand, below is the version I'm testing with and I have a new batch to assemble on my workbench:
    IMG_20210910_120323.jpg
    Additionally, the PCB is sitting in a very rough looking printed enclosure. The top is in very rough shape as it is still being tweaked:
    IMG_20210911_164504.jpg IMG_20210911_164443.jpg

    Overall dimensions of the enclosure:
    Tall side (rear): 105mm (wide) x 32mm (height)
    Short side (front): 105mm (wide) x 23mm (height).
    Depth is 85mm front to back.
    Screw mounts on the sides are 10mm (wide)x 15mm (tall) x 3mm (height) and are sized for up to M6 screw.

    The enclosure is designed to have a 30mm fan mounted inside which will help ensure the components remain cool / stable.
     
    tusharpc, RoadRailer, Sumner and 8 others like this.
  12. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    Version 2.0.0-alpha-1 of the ESP32 Command Station has been posted this morning.

    I'm working on reproducing one bug that has persisted for some time in the code, a crash in the LwIP stack, which causes a reboot. This usually only happens when the CS is under heavy stress but it can happen at other times. It appears to be a race condition deep in the ESP-IDF VFS code but I think I have an idea where it occurs and will be working on a standalone test case for submitting a bug report.

    Sent from my ONEPLUS A5010 using Tapatalk
     
  13. John Holdsworth

    John Holdsworth TrainBoard Member

    21
    4
    6
    I'm trying to compile the command station..but the esp-idf can't resolve the openmrn reference in the cmake file. Rather than enter the unknown land of adding a component to the ESP-IDF iw onder if you could check the reference to your github is correct ? its in the components floder but fails to resolve it in the compilation.

    Any help gratefully recieved...Regards JH
     
  14. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    Some questions to help determine what went wrong...
    1. Is the OpenMRNIDF component folder empty?
    2. Is the HttpServer component folder empty?
    3. Did you download a zip archive from GitHub to build from?
    If the answer to any of these are YES then that is why you are facing problems and one of the two bits below should help get it sorted for you:

    If you downloaded a zip file of the source code, GitHub is extremely helpful and *SKIPS* including the referenced submodules. Instead of downloading a zip file please use:
    Code:
    git clone --recursive https://github.com/atanisoft/ESP32CommandStation.git
    If you did use git clone to download the code from GitHub and the two referenced components folders above are empty run:
    Code:
    git submodule update --init
     
    Sumner likes this.
  15. Sumner

    Sumner TrainBoard Member

    2,798
    5,837
    63
    Great to see a post by you one here:). I think it has been a while:(,

    Sumner
     
  16. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    That it has been. It's been a busy number of months.

    There have been a number of new developments though!
    • Esp32 CS PCB has had numerous updates and is nearly ready for a "kit" release:
      cs-v2.0-THT-front.jpg
    • Esp32OlcbNodeBrowser will now have it's own PCB for either ESP32 or ESP32-S3:
      Esp32-front.jpg Esp32S3-front.jpg
    • Esp32C3OlcbIO PCB (8 5v IO) is progressing through testing:
    • Esp32C3OlcbIO.png
    • And a WIP PCB for IO (16 3v3 IO) and block detection (eight detectors):
      Esp32S3OlcbIO.jpg
    Once I have finalized the BOM (part number verification mostly) I'll be sending the CS PCB and NodeBrowser PCBs off to manufacturing. I have the Esp32C3OlcbIO PCBs on my workbench for testing. The IO/BOD board is still early in development and will have a few changes before it gets sent off for manufacturing.
     
    Sumner and NormHal like this.
  17. John Holdsworth

    John Holdsworth TrainBoard Member

    21
    4
    6
     

    Attached Files:

    NormHal likes this.
  18. John Holdsworth

    John Holdsworth TrainBoard Member

    21
    4
    6
    The empty folders were the symptom..also gzip wasn't on the path..now resolved..thank you very much for your time..
     
  19. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    Great! I'll make a note of these and add them to the docs.
     
  20. Richard Sleight

    Richard Sleight New Member

    5
    0
    1
    Hi, I'm new here as I'm getting back into rail modelling and am looking to DCC from the start. Having had experience with RPi's, Arduinos and various flavours of ESPs over the years, it was inevitable I would stumble across ESP32CommandStation (amongst other DCC DIY projects but this one seems the most comprehensive)

    I've spent the last week getting it to build and upload onto a number of different ESP dev boards I have (WROOM, WROVER, Heltec OLED etc) with varying success. Generally, I'm happy to dig my own way through problems (as they are usually of my own doing) - its about the journey as well as the destination.

    I have a build now working, it connects to WiFi, I can connect to he Web server and switch on the track etc, but I am struggling to work out how to connect JMRI to the CS. I have trawled this forum as well as the various docs for ESP32 Command Station and JMRI and I'm normally pretty good at figuring stuff out but I am at a dead end. Could someone explain where I need to be looking? Do I need additional hardware?

    I should point out that at this stage, I don't even have a layout built, most of what I do have (track, locos, wagons etc are in various boxes) But I do have most of the electronics built for the CS and decoders at the ready.

    Apologies if I've missed something obvious.
     

Share This Page