ESP32 Command Station

Atani Dec 10, 2017

  1. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    Can anyone wanting to reserve one (or more!) please send me an email so I don't lose track of anyone? At this current count I believe I'm at 10 or so now.

    Also a small update, my plans for a drive down to Arizona yesterday were postponed until next weekend since there is no easy/fast route for me to get to near Phoenix Arizona (I5/Grapevine and SR58 through Tehachapi both closed yesterday morning due to heavy snow) from just north of Yosemite. Thankfully no snow at my place but plenty of rain and more on the way (approx 2" so far this week and more on the forecast for the weekend). So with my schedule freed up a bit I'll be working on the PCB v1.1 assembly/testing today with hopes to have the kit finalized by end of the weekend if nothing major comes up from the testing.

    I'm also exploring offering the CS PCB kit via an online retailer which I've received a pair of servo mounts from in September (still need to post the review).
     
    bocabob likes this.
  2. bocabob

    bocabob TrainBoard Member

    47
    22
    6
    Sent to your github address.
     
    Atani likes this.
  3. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    Thanks, received and on the list.

    For others on this thread that I could find I'll make note of your ID on here and if you can send me a note with your email it would be great.
     
  4. Erik84750

    Erik84750 TrainBoard Member

    334
    134
    12
    Hi Atani, where can I find the schematic for this board?
    Earlier in this thread (number 40-ish) there was talk of Kicad files: would you have Eagle files too?
    Grts,
    Erik
     
  5. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    These have not been publicly release yet due to ongoing testing of the PCB. I'm hoping to wrap up the testing in the next week or so and once done I'll be publishing the schematic, BOM and gerber files. I will not be publishing Eagle files as I do not have the software and it is not necessary for manufacturing of PCBs since I have gerber files that will work.
     
    Erik84750 likes this.
  6. Erik84750

    Erik84750 TrainBoard Member

    334
    134
    12
    ESP32 development boards do not follow a specific standard for pin layouts: do you have a recommended list of these boards?
    Grts,
    Erik

    PS: I find it admirable how you stay on top of things!
     
  7. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    Very true, there are two boards that I'm currently targeting with the PCB:
    1) TTGO T1 (includes SD slot on bottom side and external antenna connector)
    2) DevKit-C (does not include SD slot)

    I'll have PCB kits which will include everything ready to go and it will include a TTGO T1 module.

    I do what I can :)
     
    Erik84750 likes this.
  8. pepeONrails

    pepeONrails TrainBoard Member

    14
    2
    7
    Hi,
    some help for a good starting point needed!
    Trying to jump in here for an ESP32CommandStaion, going through the thread from the beginnig
    but now I am a bit confused as there are links to a wiki page
    (#243 ../atanisoft/DCCppESP32/wiki/DCCppESP42-Hardware) which obviously did not exist...?
    Trying to find information about recommended hardware and maybe some wiring diagrams,
    but in the moment, as more I search as more I get confused - so many different boards, a few different
    versions of the program, and no way to find that wiki - I give up for the moment!
    Any hints for me from where to start?

    thanks

    Peter
     
  9. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    The wiki pages have been retired and mostly replaced with https://atanisoft.github.io/ESP32CommandStation/. More content needs to be migrated as well as improvement of the documentation.

    The easiest would way to get started would be with an ESP32 with the Uno form factor coupled with an Arduino motor shield. The only problem you may encounter will be with the motor shield as there are a number of them on the market that do not have current sense capability, you can typically find these marketed with an L298D (bad) chip rather than L298N (good), they can be marketed as stepper motor drivers (bad) or possibly even have jumpers on the PCB (a VIN jumper is nice but others are BAD).

    Use the latest release listed here. Version 1.3.0 (current master code) has not been released and is not likely to be released due to a critical bug in the DCC code which I could not easily resolve. The development branch is more up-to-date but has one issue which I haven't been able to track down yet. With any luck v1.5.0 will be released sometime this month provided I can fix this last bug and complete testing of the custom PCBs (pending item is RailCom)
     
  10. pepeONrails

    pepeONrails TrainBoard Member

    14
    2
    7
    thanks for your quick answer ...

    it seems rather difficult to get the mentioned board.
    Is there a "general" pin mapping ( I found some info in post #156 - but that list seems to be uncomplete)
    or wiring diagram?
    I have a tiny little "Sparkfun Thing Plus - ESP32 WROOM"
    Is there a chance for using that board?
    (A confusing thing with that board is, that it should be used as "adafruit feather" but thats a bit off topic I think...)
    ah.. as you can see, I'm pretty green on the ESP32 platform...

    kind regards,
    Peter
     
  11. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    You should be able to find them via multiple online retailers (google for TTGO esp32 uno). I've purchased most of my ESP32/Arduino boards from retailers in China and waiting for them to arrive, however they can also be found via US retailers (DevKit-C and Pico-D4 Kit versions). I'm currently waiting for a Pico-D4 to arrive which I'll do some testing with soon.

    There really aren't any hardcoded pins, all of them can be reconfigured inside the Config_XXX files.

    Many of the pins on that board should work fine for basic connectivity between the ESP32 and the motor shield, however, the cost on that board though is pretty high ($20!!!) whereas many ESP32 boards are available for under $10. If you don't already have an ESP32 board, I would highly recommend the Espressif DevKit-C if you can not find the Uno form factor board as these are available for $10 or less typically. The only big problem I'm aware of with the "feather" line of boards is that they do not expose all pins and some of the pins they do expose are not really usable for their intended purpose while WiFi is active.

    We all start somewhere :) I've been at this for a number of years now and still finding things that I didn't know about on the ESP32.
     
  12. Shdwdrgn

    Shdwdrgn TrainBoard Member

    251
    182
    13
    Most of the ESP32 boards should work with this project, but what you use depends a lot on what you are comfortable with. The Uno boards that Atani mentioned are great for folks who aren't comfortable with soldering but would like to get involved with a more plug&play solution. On the other hand, if you are familiar with breadboarding you can get an ESP32 version with header pins and set up whatever board you have, or even use a bare ESP32 and solder together the whole circuit.

    In my case, I use the ESP32 that has an OLED 128x64 display built onto the board and pug that into a breadboard. This link shows the circuit I currently use (including a separate 5V regulator if you want to run a number of extra arduino decoders). If you want to convert this to another ESP32 board just note that the blue wires need to connect to ADC pins, the orange wires need to connect to PWM pins, then just update the hbridge config file to match your particular pinout. If you want to use the L298N board you'll need to desolder the marked pin from the board and reconnect it through the 1.5 ohm resistor -- however the blue IBT board can be used as-is and supports a much higher output.
     
  13. pepeONrails

    pepeONrails TrainBoard Member

    14
    2
    7
    @Shdwdrgn
    thanks for the schematic! Although I want to use an Arduino Motorshield or maybe a Polulo MC33926 Motor Driver Shield
    it helps very much in understanding the circuit. What are the the 3N3904 transistor for, I hope I dont need them for the shields...

    @Atani
    the bad news - version 1.2.3 is actually not building on platformio...

    The Good News: 1.3.0 builds without any problem and loads to the device without error.
    I've already bought that sparkfun board and did some tests (blink, bluetooth etc) an it all worked.
    I've worked out the following setting with the values MotorBoard.h comes with to connect to the Arduino Shield

    OPS PWM pin 25 -----> pin 3 on the shield
    CurrentSense (Ch0) 36 -----> AO
    DCC signal 19 -----> 12

    Prog PWM pin 23 -----> pin 11 on the shield
    CurrentSense (Ch3) 39 -----> A1
    DCC signal 18 -----> 13

    further a common GND and what is with the 5V line (the broken purple line in Shdwdrgn schematics)
    should that go to AREF on the shield? If so, the little board doesn't have a 5V out but 3,3V so what to do?

    If I understand it right I can use any (more or less) of the GPIO pins, just set it up in MotorBoard.h
    as there is no pin 25 on the board I just use 21 and thats it?

    thanks in advance

    Peter
     
  14. Shdwdrgn

    Shdwdrgn TrainBoard Member

    251
    182
    13
    An H-bridge can be used to run different types of devices, depending on how it is used. In our case, we're running a simple DC motor so the output need to be either a forward or reverse voltage, which means you need to put a Vcc signal to one side of the bridge and a ground signal to the other side. These two signals are always opposite each other. The 3904 transistor is wired up as a simple NOT circuit, so instead of using a second I/O pin from the arduino to provide the function the transistor does it for you and saves the I/O pins for other uses. If you are using a motor shield board, it will already have this built in although it may use a logic gate instead of a transistor to do the same thing. I could have also used a 74hc14 to do the same thing but I had the transistors lying around.
     
  15. pepeONrails

    pepeONrails TrainBoard Member

    14
    2
    7
    update:

    I now sorted out the compiler problem. It was a python issue!
    My os has two versions of that interpreter 2.7.17 and 3.8.1 but the installation of vscode and platformio
    points only to the 3.x version and that did not work..., but now I sorted it out, the vscode/pio now uses
    python2 and, except a few "warnings" the ESP32-CS code compiles flawlessly....

    Searching that error cooles me down a bit, and I also found "pin25" on my sparkfun "thing plus"
    blame on me, I didn't examine the doc of the board carfully enough - its not that
    plug'n'play alike approach than the Arduino Uno!
    So, for now, I make a brake here, dive a bit deeper in the esp32 stuff, than (hopefully)
    coming bake to the ESP32DCC projekt.
    Thanks for now for your help and patiently answers

    Peter
     
  16. RoadRailer

    RoadRailer TrainBoard Member

    41
    11
    4
    If I am interpreting posts 788 and 797 correctly in conjunction with the ESP32 Command Station website, will RailCom only be functional on custom boards (it appears special circuitry is needed for RailCom)?
     
  17. Dex

    Dex TrainBoard Member

    55
    30
    5
    Ok i give i have tried everything to get this to compile with latest dev branch along with compiling various cherry picked versions of the master and dev branch to no avail getting it to read my loco on prog track or even on ops track. I have experienced power issues where the DCC signal is not being sent. JMRI causing esp32 to reboot on connecting, Reboot on CV 29 reading, runaway trains among other stuff. I have given this the better part of at least 12 hours and i am decent with getting stuff built but this is by far the most trouble i have had. Any guidance would be appreciated at this point. I have a SparkFun ESP32 with a Deek-Robot Motor Shield(arduino shield) Please help!!!!!!!!!!!!
     
  18. John Flanagan

    John Flanagan TrainBoard Member

    45
    6
    7
    I notice that the build system has changed. Can you give me a pointer to how I would build it now. My attempts with CMake have not worked.

    Thanks
     
  19. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    That is correct, for RailCom to work there is a bit of detection hardware required as well as some software that still needs some debugging.

    Sent from my ONEPLUS A5010 using Tapatalk
     
    RoadRailer likes this.
  20. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    I would stick with v1.2.3 at this point with a couple minor fixes which I'll need to post tomorrow. The dev version and latest master code are not compatible and there is a nasty bug in the current master code is not easily fixed and on dev branch that code has been replaced entirely. Dev branch is a bit too unstable still as I'm working on removal of Arduino dependencies to pick up a few fixes that haven't been made available on the Arduino side.

    Sent from my ONEPLUS A5010 using Tapatalk
     

Share This Page