At command that follows uart protocol

Post by flosko » Sun Jan 13, 2019 10:27 am

Dear ESP32-AT developers, especially newbies,

I am new to ESP32 and was burning a considerable amount of time in the recent days to enable AT commands via USB for the ESP-AT firmware for DevKitC (tested on SOLO and WROVER boards). The requried information is scattered across multiple places, guides and tutorials, so I figured it might be helpful for the one or the other to drop my collected findings here. They are current as of January 12th, 2019.

By default, UART0 (TXD0 is GPIO1 and RXD0 is GPIO3), connected to the USB bridge chip, acts as debug interface. Issuing AT commands is only possible via an additional UART interface (UART1, GPIO16 is RxD and GPIO17 is TxD) and thus requires additional hardware to fully use the DevBoard with a PC only. (Here is a good overview picture of the pinning: https://randomnerdtutorials.com/esp32-p . nce-gpios/). So if you liek to explore the ESP-AT firmware's cpabilities on a DevKitC, you need additional hardware, OR, modify the firmware a bit so that the AT interface is also available via UART0.

The following Step-by-Step- guide describes how to proceed on Windows 10x64, from installing the development environment until connecting the DevKitC to a WPA2-enabled WiFi and sending off HTTP requests to a Cloud Platform.

1. Install the Virtual COM Port Driver for the Cypress 210x chip: CP210x_Universal_Windows_Driver. Then you should be able to connect to the DevBoard via a standard terminal using the virtual COM port assigned to your board by the system.
https://www.silabs.com/products/develop . cp-drivers

2. Download and unzip the pre-built toolchain for ESP32, however, do NOT use the latest one, but this one to ensure compatibility with the ESP32-AT firmware referenced above:
https://dl.espressif.com/dl/esp32_win32 . 181001.zip
I recommend to stick with the default location 'c:\msys2' -- some paths seem to be hardcoded, and while you can of course use any location to drop the toolchain, you might experience problems with certain tools (e.g. pip) if the path is not the default one.

3. Make sure the path to the idf is set and available all times. The easiest way is to drop an additional file 'export_idf_path.sh' into 'msys32/etc/profile.d' with the line 'export IDF_PATH="C:/msys32/home/username/esp/esp32-at/esp-idf"'

4. Start the toolchain by executing 'mingw32.exe'. Check the IDF_PATH variable with 'printenv IDF_PATH'

5. Clone the ESP-32-AT project (ESP32_AT_V1.1.3) into a directory named '~/esp' in your home directory (Attention: The resulting path of the esp-idf must match the one we just defined in step 3) using the command:
git clone --recursive https://github.com/espressif/esp32-at.git
(I got version b80d4469ee2ecea93ab8bb1df03766c0ef833dd9 from Jan 3rd, 2019)
And here comes the pitfall: Do NOT use the latest esp32-IDF! ESP32-AT comes with its own IDF version against it MUST be built; otherwise you will experience compiler and linker errors.
The corresponding version for the above mentioned ESP-AT FW version is ESP-IDF 7fa98593bc179ea50a1bc8244d5b94bac59c9a10. You get it automatically if you use the parameter --recursive.

If you checked out the latest version via
git clone --recursive https://github.com/espressif/esp-idf.git
you can revert back to the matching version by issuing
git checkout 7fa98593bc179ea50a1bc8244d5b94bac59c9a10
If you go this way, don't forget to also update all submodules
git submodule update --init --recursive

6. Unfortunately, the pre-built toolchain is not complete for the ESP32-AT project. We need further Python libraries which we install with 'pip install pyyaml xlrd'