libat_core.a is AT Command Core, and it is the core of AT command, including the default AT instruction set, the AT command parsing, execution and responding. The lib contains 4 kinds of command, such as AT+TEST=?, AT+TEST?, AT+TEST=“abc” and AT+TEST. It supports custom AT commands based on the lib and related APIs, and ones can also define input and output medium, like uart, spi, socket, bt, etc.
The demo is the AT command set based on uart. You can replace the uart driver with other drivers whichever you want to use. But you have to make some changes in at_task.c. In addition, you can add some custom AT commands in at_custom_cmd like AT+CIUPDATE if necessary.
More details are in documentation esp32_at_instruction_set_and_examples_en.pdf or esp32_at_instruction_set_and_examples_cn.pdf. And if you enable the ethernet commands, please refer to esp32_at_ethernet.md.
The ESP32 Board sends AT commands through UART1 by default.
- GPIO16 is RXD
- GPIO17 is TXD
- GPIO14 is RTS
- GPIO15 is CTS
The debug log will output through UART0 by default, which TXD0 is GPIO1 and RXD0 is GPIO3, but user can change it in menuconfig if needed.
UART for console output
Notes: Please pay attention to conflict of the pin
- If choose
AT through HSPI, you can get the information of the hspi pin by
AT hspi settings
- If enable
AT ethernet support, you can get the information of the ethernet pin from
Compiling and flashing the project
Compiling the esp32-at is the same as compiling any other project based on the ESP-IDF:
- You can clone the project into an empty directory using command:
git clone --recursive https://github.com/espressif/esp32-at.git
- Note the
--recursiveoption! The esp32-at project already has an ESP-IDF as a submodule, which should be used to compile the project, in order to avoid any compatibility issues (e.g. compile failure or running problems, etc.).
- If you have already cloned the esp32-at without this option, run another command to get all the submodules:
git submodule update --init --recursive
rm sdkconfigto remove the old configuration.
- Set the latest default configuration by
Serial flasher configto configure the serial port for downloading.
make flashto compile the project and download it into the flash.
- Or you can call
maketo compile it, and follow the printed instructions to download the bin files into flash by yourself.
make print_flash_cmdcan be used to print the addresses of downloading.
- More details are in the esp-idf README.
make factory_binto combine factory bin, by default, the factory bin is 4MB flash size, DIO flash mode and 40MHz flash speed. If you want use this command, you must fisrt run
make print_flash_cmd | tail -n 1 > build/download.configto generate
- If the ESP32-AT bin fails to boot, and prints "ota data partition invalid", you should run
make erase_flashto erase the entire flash.
- Since we updated the toolchain recently, it is not compatible with the old version. Please use the toolchain we provided in the
esp32-at/esp-idf/docs/get-started/windows-setup.rstto build your ESP32 AT project.