ESP32 Command Station

Atani Dec 10, 2017

  1. John Holdsworth

    John Holdsworth TrainBoard Member

    21
    4
    6
    Could I be cheeky and ask you what dev environment you use? is it vsc with the idf extension? and what web page tool do you use?

    thanks JH
     
  2. Atani

    Atani TrainBoard Member

    1,469
    1,756
    37
    There will be a few more coming as I'm working on updating OpenMRN a bit to support ESP-IDF v4.0+ and ESP32-S2 (for a related project).
     
  3. Atani

    Atani TrainBoard Member

    1,469
    1,756
    37
    VS Code with the Espressif extension on Gentoo Linux. I also do some work via command line but prefer to use that mostly for the CI builds.

    Hand coded and tested manually via browser. I prefer not to use web page generation tools when possible.
     
  4. John Holdsworth

    John Holdsworth TrainBoard Member

    21
    4
    6
    Thanks for the info..started to use platformio for my humble projects....but it doesn't support encrypted boot loader functionality which my son wants for his work ....apparently expressif esp-idf does.
    You deserve the Victoria crosss for courage and endurance hand coding web pages..respect .
    regards JH
     
  5. Atani

    Atani TrainBoard Member

    1,469
    1,756
    37
    Arduino IDE does not support it either, unfortunately IDF is the only approach suitable. Just be sure to only enable the encryption once he is 100% ready for it as once it is on you can't turn it back off IIRC.

    As for the web page, @Shdwdrgn is working on an update for it that will go in sometime after v1.5.0 has been released.
     
  6. Dex

    Dex TrainBoard Member

    55
    30
    5
    Ok so i am trying to avoid Linux to compile this as there are a TON of windows users i have used the lastest master branch along with 1.5 alpha1 and it still fails at the same point which does not allow me to configure it at all. Here is my CMakeOutput.log maybe you can figure out what is going on.
    Basicaly it keeps telling me that the H-Bridge is not defined but thats what im trying to get to. I think because its in the main Cmake file it fails
     

    Attached Files:

  7. Atani

    Atani TrainBoard Member

    1,469
    1,756
    37
    Yes, it definitely looks like it is failing to run CMake successfully. About the only thing I can suggest is move F:\Train Stuff\ESP32CommandStation to just F:\ESP32CS to shorten the path and remove the space from it.

    Which command were you running at the point of failure though?
     
  8. Dex

    Dex TrainBoard Member

    55
    30
    5
    I am running the idf.py menuconfig building also fails at same point

    Sent from my Pixel 4 using Tapatalk
     
  9. Dex

    Dex TrainBoard Member

    55
    30
    5
    Also file path limitations are removed

    Sent from my Pixel 4 using Tapatalk
     
  10. Atani

    Atani TrainBoard Member

    1,469
    1,756
    37
    Looks like a windows specific bug in their tools. Did you use the tools installer package?

    A quick fix, check your env variable "PATH" to make sure it uses only \ (backslash) and not / (forward slash). Similarly make sure it uses ; (semicolon) and not : (colon) as separator. You can fix this via Control Panel -> System -> Advanced System Settings -> Environment Variables. Check both the User variables and System variables for PATH. After fixing this you can open a new command line prompt and give that a go.
     
  11. Dex

    Dex TrainBoard Member

    55
    30
    5
    O trust me I made sure of all that because before i got this far I was having path issues which I managed to fix I even will have a pr for u to allow using gzip from git bash install

    Sent from my Pixel 4 using Tapatalk
     
    Atani likes this.
  12. Dex

    Dex TrainBoard Member

    55
    30
    5
    What I really need to know is how to get cmake to read the config at this point I was able to generate the config files from each menu individually using mconf-idf and the name of the kconfig file which allowed me to get it saved with custom file name I just need cmake to read those files or just one file. I added to the sdkconfig but they were over rridden what I haven't tried just a config file by itself I will do that when I get home

    Sent from my Pixel 4 using Tapatalk
     
  13. Atani

    Atani TrainBoard Member

    1,469
    1,756
    37
    name the output config file as sdkconfig and it should pick it up.
     
  14. Dex

    Dex TrainBoard Member

    55
    30
    5
    Ya I already have one that was auto generated it keeps getting over written

    Sent from my Pixel 4 using Tapatalk
     
  15. Dex

    Dex TrainBoard Member

    55
    30
    5
    So I gave up and booted my laptop with mint on it so I think I found the issue it looks as if the server that needs to run for the menu config doesn't work properly or is not started on windows I will trouble shoot more but I also think I could build this with Arduino because they do support eap32

    Sent from my Pixel 4 using Tapatalk
     
  16. Atani

    Atani TrainBoard Member

    1,469
    1,756
    37
    You can try but it will be 100% unsupported and will not be configurable. There are a number of IDF settings that are customized to improve performance and enable features that are not on by default in Arduino.
     
  17. Dex

    Dex TrainBoard Member

    55
    30
    5
    Well I should be able to get those same settings somehow I'm trying to make this easily adaptable for all who what to use. The learning curve to get it working was a major challenge even for me and I write code all the time and am a PC Tech by trade . I am in no way not tech savvy but those who would look to use ur code may not be as inclined as me and I had a helluva time getting it to even the attempt to compile point in windows

    Sent from my Pixel 4 using Tapatalk
     
  18. Atani

    Atani TrainBoard Member

    1,469
    1,756
    37
    The only way to do that is rebuild Arduino in IDF *AND* then remove Arduino as it is bloat that is not needed or used now.

    The fastest way to get it working is with the Espressif IDF plugin for VSCode. That is how other people have accomplished what you are trying to do now and is the approach I recommend people to use (regardless of platform). It may also work with PlatformIO but there will be some setup work for that.

    Also pre-built binaries are available on GitHub that can be flashed to the ESP32, it uses the default settings or the PCB specific build.
     
  19. Dex

    Dex TrainBoard Member

    55
    30
    5
    Well I think that is possible to remove the Arduino bloat if the header is not included there are board feds for the esp32 from expressif. As for that using the plugin I was I even attempted to install directly using the setup file and it still failed. Although on Linux it worked just fine.

    Sent from my Pixel 4 using Tapatalk
     
  20. Atani

    Atani TrainBoard Member

    1,469
    1,756
    37
    I believe the plugin is not checking for some dependencies ahead of time (python 3.x and possibly git client).

    Probably the easiest solution would be PlatformIO since it works in VSCode and provides the necessary dependencies itself. I haven't tested with it though, but a very basic platformio.ini file might do the trick (just be sure that sdkconfig.defaults and the custom partition are used).

    The arduino-esp32 project bundles a pre-built binary copy of ESP-IDF v3.x today (ESP32 CS requires v4.0), there is a 4.0 branch and an esp32s2 branch (4.2 / master). But the problem is the options picked for the pre-built IDF binary are tailored to a "one size fits most" model of Arduino (not a bad thing!) and there are a few options which are changed to improve compatibility and stability in the CS use-case:
    • CONFIG_LWIP_MAX_SOCKETS set to 16 instead of 10. (more active sockets)
    • CONFIG_LWIP_MAX_LISTENING_TCP set to 10 instead of 16. (fewer listener sockets)
    • CONFIG_ESP32_WIFI_NVS_ENABLED disabled rather than enabled. (reduces chances of SSID connect failures due to stale auth data)
    • CONFIG_ESP_MAIN_TASK_STACK_SIZE set to 9kb vs 4kb. (the app_main method which runs the Executor [aka scheduler] runs from this method directly)
    • CONFIG_ESP_IPC_TASK_STACK_SIZE set to 2kb vs 1kb (can't remember why now)
    • CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE set to 2.75kb vs 2kb (slightly higher memory needed for event_loop)
    • CONFIG_ESP_INT_WDT_TIMEOUT_MS set to 1800 vs 300 (RailCom originally, will be reviewed again)
    • CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 disabled since the Executor runs from this core and does not call vTaskDelay or other yield like methods.
    • CONFIG_PTHREAD_TASK_PRIO_DEFAULT set to 1 (matching app_main, pthread is not used though)
    • CONFIG_SPIFFS_MAX_PARTITIONS set to 1 vs 3 (no need for more than one)
    • FreeRTOS flags set to enable task list functionality (disabled by default in arduino-esp32)
    These are likely not the only customization to IDF.
     

Share This Page