ESP32 Command Station

Atani Dec 10, 2017

  1. Atani

    Atani TrainBoard Member

    1,466
    1,736
    37
    From the web interface navigate to the OpenLCB / LCC configuration for the CS itself, scroll down to the WiFi configuration section and enable the LCC hub option. In JMRI set up the connection type as OpenLCB / LCC and use GridConnect over TCP and provide it with the IP address of the CS.

    Set JMRI default behaviors for things to OpenLCB / LCC and it should work.

    Note that there is a JMRI performance bug relating to TCP connections, it will be readily apparent in the CDI interface when downloading the CDI data.
     
  2. Richard Sleight

    Richard Sleight New Member

    5
    0
    1
    Atani, thanks for the pointers and for the incredibly fast response.

    When I change the option to Hub, the CS constantly reboots. This maybe something else I have set wrong while playing around, I'll reflash and test again.
     
  3. Atani

    Atani TrainBoard Member

    1,466
    1,736
    37
    If possible, capture the console output as it will give an indication as to why it is restarting. It sounds like a possible bug or missing validation somewhere.
     
  4. Richard Sleight

    Richard Sleight New Member

    5
    0
    1
    Ok so after a clean reload, selecting the Hub option does still cause the CS to keep rebooting. Heres the end of the console output

    Listening on port 80, fd 48
    [Hub] Starting TCP/IP listener on port 12021
    Listening on port 12021, fd 49
    [mDNS] Advertising _http._tcp:80.
    [mDNS] Advertising _openlcb-can._tcp:12021.
    [SNTP] Received time update, new localtime:Thu Feb 23 17:09:19 2023

    Incoming connection from 192.168.1.82, fd 50.
    [Hub] Starting TCP/IP listener on port 12021
    listen: error (112) Address already in use


    abort() was called at PC 0x4014900c on core 0​
     
  5. Atani

    Atani TrainBoard Member

    1,466
    1,736
    37
    Ok, this looks like a bug I just fixed a few days ago on a different product that uses OpenMRNIDF. Let me check what is needed for the CS to pick up that bug fix.
     
  6. Atani

    Atani TrainBoard Member

    1,466
    1,736
    37
    I've pushed a possible fix for this, if you can run the following:
    Code:
    idf.py reconfigure
    idf.py build ....
    
    This should update the OpenMRNIDF code and fix the issue (hopefully).
     
  7. Richard Sleight

    Richard Sleight New Member

    5
    0
    1
    That looks like its sorted. CS is running in Hub mode and I can connect from JMRI.

    Thanks so much for your help. I now have some JMRI learning to do. One thing I have noticed it JMRI Power control is greyed out. CS is configured with both Ops and Prog enabled and I have a dual L298 bridge connected with some LEDs on the enable GPIOs to show whats active.
     
  8. Atani

    Atani TrainBoard Member

    1,466
    1,736
    37
    That sounds like a bug in JMRI, it should support that by default when using OpenLCB / LCC mode. In the meantime you can enable track power via the web interface or by sending the event "
    01.00.00.00.00.00.FF.FE" to turn track power on and "01.00.00.00.00.00.FF.FF" to turn it off.

    Note that PROG will *NOT* be enabled for output unless it is actively in use and while in use OPS will be disabled.
     
  9. Sumner

    Sumner TrainBoard Member

    2,834
    5,968
    63
    see you got things going so deleted post,

    Sumner
     
  10. Richard Sleight

    Richard Sleight New Member

    5
    0
    1
    Thanks for this Atani.

    Is there a reference list for the available event codes?
     
  11. Atani

    Atani TrainBoard Member

    1,466
    1,736
    37
  12. murarduino

    murarduino New Member

    8
    3
    1
    Great project, is the CS PCB already available? Where can I find its schematic?
     
    RCMan likes this.
  13. Atani

    Atani TrainBoard Member

    1,466
    1,736
    37
    The PCB and schematic have not been released, the SMT version has a few thermal concerns which will require considerable rework to mitigate and also suffers from considerable parts shortages since it was designed (mostly on the h-bridges, some are back in stock but not all).

    There is a mostly THT version (four resistors and four transistors are SMT and easily hand soldered) of the PCB but it has not been tested yet to confirm it works as expected, though I don't anticipate any issues with it. This version is likely not to be released publicly for quite some time due to commercial product development contracts and a general lack of time to focus on some of my projects.

    For now, there are a couple options that are known to work without many issues. The easiest is to use an Arduino Uno R3 formfactor ESP32 board with an arduino motor shield (knock-off versions should be fine as long as they use the correct pinout) and use a couple jumper wires for the A0 and A1 pins which are not usable with WiFi.
     
  14. Texas Tim

    Texas Tim TrainBoard Member

    53
    52
    9
  15. Atani

    Atani TrainBoard Member

    1,466
    1,736
    37
    While it has a decent sized display it will not be supported since it is an ESP32-S3 module and not an ESP32. I did build a prototype using the ESP32-S3 but there were a significant number of changes required to even get it compiling.

    This project is also effectively in maintenance mode at this point mostly due to it being relatively stable. If there are bugs though please log them on GitHub and I'll take a look at them.
     
    Texas Tim likes this.
  16. MegaBlackJoe

    MegaBlackJoe TrainBoard Member

    43
    58
    10
    Sir. the description on github says it supports most of S3 boards. Are they supported or not really? Is this board supported? https://www.lilygo.cc/products/lilygo®-ttgo-t-display-1-14-inch-lcd-esp32-control-board

    Are there any plans to support boards that have displays and create a simple interface to run locos from the command station with interface without the need to connect an android phone or a pc? A crowdfunding project maybe?
     
    BNSF FAN likes this.
  17. Atani

    Atani TrainBoard Member

    1,466
    1,736
    37
    As of now only ESP32 boards are fully supported, ESP32-S3 was started but not fully implemented.

    This board is *NOT* and will *NOT* be supported due to the display type being SPI, only I2C displays are supported.

    Right now only boards with I2C displays (primarily OLEDs) are supported.

    There is a built-in web server which offers a basic throttle, there are no future plans for integrated interfaces for a variety of reasons (see below).

    This is not feasible for a variety of reasons but mainly due to the details below.

    A note about the future of this project...

    Over the last many years many developments have occurred, including development of a couple PCBs for the project. Unfortunately, this project is reaching it's end-of-life and will soon be archived. For the last twelve months I've been rewriting and developing it's replacement as a commercially available command station and developing throttles and accessories to go with it. The new version of the command station will be announced next weekend at the Amherst Railroad Hobby Show. After I return from the show I'll post some details in the Model Railroad Product News forum. There will also be live coverage on YouTube from a few creators that are planning to drop by the booth.
     
    Sumner and MegaBlackJoe like this.

Share This Page