ESP-AT
When using browser-based Wi-Fi provisioning on ESP8266 through AT commands, why does AT+WEBSERVER=1,80,25 always return ERROR and fail to create the web server?
Cause: the default AT firmware does not include AT web server support.
Solution:
- In the
ESP_ATproject, run./build.py menuconfigand enable the AT web server feature. On ESP8266, you may need to disable some unnecessary options to make room for the required HTML files. - Save the configuration and run
./build.pyto compile. After the build is complete, flash the new firmware image with AT web server support to the ESP8266.
After configuring the country code with AT+CWCOUNTRY, will the working channel automatically follow local regulations, or does it only update the country_code field without changing channel parameters?
When country_policy is set to 0, the module's country code changes automatically according to the connected AP. The channel parameters are still assigned by the router.
In normal operation, the module's working channel is determined by the router. If the router supports channel hopping, the channel change can also be synchronized to the module.
How do I set the advertising interval to 1.6 seconds with AT+BLEADVPARAM?
In AT+BLEADVPARAM, the minimum and maximum advertising interval fields, <adv_int_min> and <adv_int_max>, use a unit of 0.625 ms.
To configure a 1.6 s advertising interval:
1600 ms / 0.625 = 2560
2560 is 0xA00 in hexadecimal, so both interval parameters should be set to 0xA00:
AT+BLEADVPARAM=0xA00,0xA00,0,0,7,0,,
If AT+CIPSTART blocks in ESP-AT, is there any command that can interrupt it?
- ESP-AT does not provide a command to forcibly interrupt
CIPSTART. AT+CIPSTARTremains blocked until the TCP connection attempt times out.
Possible mitigations:
- Reduce the TCP connection timeout, either on the server side or the device side.
- Avoid issuing BLUFI / provisioning commands concurrently with network connection commands.
- Optimize command timing to avoid repeatedly starting
CIPSTARTwhile the network is unstable.
Why is ping latency high in ESP-AT STA mode, and how can it be reduced?
Cause:
ESP-AT defaults to AT+SLEEP=1, which enables Wi-Fi Modem-sleep. In this mode, when the device operates in Station (STA) mode, the Wi-Fi radio periodically sleeps according to the AP's DTIM interval, which increases packet latency, including ping response time.
Solution:
Disable sleep after power-on:
AT+SLEEP=0
This keeps the Wi-Fi radio active and avoids extra delay caused by the DTIM mechanism.
Notes:
- Disabling sleep improves responsiveness but increases power consumption.
- This setting only takes effect when Wi-Fi is operating in STA mode.
When ESP-AT works as a BLE GATT Server, can AT commands customize the Service UUID or Characteristic UUID?
No. Standard runtime BLE AT commands cannot dynamically customize Service UUID or Characteristic UUID.
The ESP-AT GATT database is created at firmware build time. AT commands can only read or write values of existing Attributes. They cannot dynamically create, delete, or modify Services or Characteristic UUIDs.
AT+BLEGATTSSETATTR only modifies the data value of an existing characteristic. It cannot create a new Characteristic or modify its UUID.
If a customized GATT table is required, configure it on the firmware side or rebuild the firmware instead of relying on runtime AT commands.
Can AT+BLEINIT=2 and AT+BLUFI=1 be used at the same time in ESP-AT firmware?
They should not be used at the same time. AT+BLEINIT=2 enables the BLE role, while AT+BLUFI=1 enables Bluetooth provisioning. These features use overlapping Bluetooth resources, so enabling both can cause resource conflicts and unstable behavior.
The recommended flow is to finish Bluetooth provisioning first, then disable BLUFI before enabling the required BLE functionality. This keeps Bluetooth tasks and GATT resources from conflicting with each other.
Will a BLE UUID change in ESP-AT take effect immediately?
No.
The BLE GATT table is registered when BLE is initialized, and the UUID is a static attribute of the Attribute Table. In addition, clients usually cache the service structure after a connection is established. Therefore, after changing the UUID, BLE must be reinitialized before the new UUID can take effect.
How can UART configuration be changed in ESP-AT?
ESP-AT provides several ways to change UART configuration:
- Use
AT+UART_CURorAT+UART_DEFto change the current or default UART baud rate. - Use
AT+SYSMFGto modify factory-default parameters. - Rebuild the AT firmware with a different default UART configuration.
After establishing a Bluetooth connection with ESP32-C3 AT firmware, why does AT+SLEEP=2 fail to enter Light-sleep?
If this happens, UART0 usually prints the following error log:
E (40369) at-base: shouldn't enable sleep when softap is enabled
This means the device is currently operating in SoftAP mode, and the AT firmware does not support enabling sleep while SoftAP is active.
To fix it:
- Send
AT+CWMODE=1to switch the device toStationmode and disableSoftAP. - Then send
AT+SLEEP=2again to enableLight-sleep.
In addition, if Light-sleep is used in BLE mode, an external 32 KHz crystal is also required. Without it, sleep will not work correctly.