Idiots guide to setting up ESP32 CS?

AndyH Aug 10, 2019

  1. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    Those look like vscode trying to parse the python file and they can be safely ignored since the file will be processed by PlatformIO instead.
     
  2. Jeepster

    Jeepster TrainBoard Member

    10
    0
    2
    Thanks @Atani for the ESP32 code, I am looking into using the same. My current setup is Arduino Mega + HiLetgo Motor Shield for DCC++ and I got an ESP32 dev board that I was planning to use for WiFi extension for connecting to JMRI however came across your work on ESP32, thanks for the same, and am looking into using that to connect to the HiLetgo motor shield (it's very similar to other supported motor shields so should probably work). I have flashed the ESP32 after building the ESP32 Command Station, but I cannot see it connect to the WiFi network. The Terminal is showing gibberish, I have tried changing the baud rate but no luck yet. Appreciate any tips to debug.

    Thanks
     
  3. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    Which version of the code did you flash?

    Use 115200 for the baud rate as that is the default used by ESP-IDF and is what the code configures for UART0 which is used for the serial debug output.

    Once you have sorted out the serial console output issue we can continue to debug the WiFi connectivity issue, I've only know of a couple cases where the ESP32 has issues with connecting to a network and they usually are due to one of the following:
    1. Insufficient supply of power/current for the WiFi radio to operate reliably.
    2. WiFi signal quality issues (cross-talk from other channels, external interference, etc)
    3. Non-commercial WiFi routers using slightly out-of-spec timeouts or dropping/missing packets.
    4. Incorrect SSID/Password provided during configuration.
    *IF* you see in the serial output that the SSID/Password is the problem and you are using 1.5.0 (or master) you will need to erase flash before sending a new firmware to the esp32.

    I've logged https://github.com/atanisoft/ESP32CommandStation/issues/41 to track adding the ability to fallback to SoftAP mode when SSID connect failures occur so that it is easier to fix without needing to erase and reflash the code.
     
  4. Jeepster

    Jeepster TrainBoard Member

    10
    0
    2
    Thanks for the reply. I am using 1.5.0. Modification dates on files are June 13, 2020. Latest code. I will try again by first erasing flash. Could be because of that.
    I am using 115200 baud rate, maybe it did not get flashed correctly.
     
    Last edited: Jul 26, 2020
  5. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    Ok, start with erase flash and I'd suggest set it up using SoftAP and station mode. If you set it for that even if it doesn't connect to your network it will not reboot and it will leave the SoftAP running so you can possibly reconfigure it

    Sent from my ONEPLUS A5010 using Tapatalk
     
  6. Jeepster

    Jeepster TrainBoard Member

    10
    0
    2
    When I am running "idf.py build" does it automatically pick up the config from "sdkconfig" file. I only see it loading the defaults from "sdkconfig.defaults"
     
  7. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    Yes it will pick up whatever is in sdkconfig. If the sdkconfig is newer than the defaults file the defaults file will be ignored.

    Sent from my ONEPLUS A5010 using Tapatalk
     
  8. Jeepster

    Jeepster TrainBoard Member

    10
    0
    2
    I changed the terminal baud rate to 74880 and I started getting some response on the terminal but still no Wifi and I am also not seeing any Access point. I also changed CPU frequency to 160MHz. Changed Crystal Freq to 26MHz. Now getting following output on the terminal. I think there are some card specific settings that I need to change to get it to work. I am going to try flash DCCpp_ESP and see if that works.

    Terminal Output:

    ets Jan 8 2013,rst cause:2, boot mode:(3,7)


    ets_main.c
     
    Last edited: Jul 27, 2020
  9. Atani

    Atani TrainBoard Member

    1,460
    1,697
    36
    It should be 115200 and not higher/lower than that.

    Why? You should use 240MHz (which is the default IIRC).
     

Share This Page