User AT Commands




AT+USERRAM : Operate user’s free RAM

VariantCommandResponseFunction
Query Command Function: Query current available user’s RAM size. Command:
AT+USERRAM? Response: +USERRAM:<size> OK

Response:

+USERRAM:< size>
OK

Set Command

Function:

Operate user’s free RAM

Command:

AT+ USERRAM=<operation>,<size>[,<offset>]

Response:

+USERRAM:<length>,<data>    // esp-at returns this response only when the operator is ``read``
OK

Parameters

Notes

Example

// 
malloc 
1 
KB 
user
's RAM
AT+
USERRAM=
1,
1024// 
write 
500 
bytes 
to 
RAM (
offset: 
0)
AT+
USERRAM=
2,
500// 
read 
64 
bytes 
from 
RAM 
offset 
100
AT+
USERRAM=
3,
64,
100// 
free 
the 
user
's RAM
AT+
USERRAM=
0

AT+USEROTA : Upgrade the Firmware According to the Specified URL

ESP-AT upgrades firmware at runtime by downloading the new firmware from a specific URL.

Set Command

Function:

Upgrade to the firmware version specified by the URL.

Command:

AT+
USEROTA=<
url 
len>

Response:

OK>

This response indicates that AT is ready for receiving URL. You should enter the URL, and when the URL length reaches the <url len> value, the system returns:

Recv <
url 
len> 
bytes

After AT outputs the above information, the upgrade process starts. If the upgrade process is complete, the system return:

OK

If the parameter is wrong or firmware upgrades fails, the system returns:

ERROR

Parameters

  • <url len> : URL length. Maximum: 8192 bytes.

Note

  • The speed of the upgrade depends on the network status.

  • If the upgrade fails due to unfavorable network conditions, AT will return ERROR . Please wait for some time before retrying.

  • After you upgrade the AT firmware, you are suggested to call the command AT+RESTORE to restore the factory default settings.

  • AT+USEROTA supports HTTP and HTTPS .

  • After AT outputs the > character, the special characters in the URL does not need to be escaped through the escape character, and it does not need to end with a new line(CR-LF).

  • When the URL is HTTPS , SSL verification is not recommended. If SSL verification is required, you need to generate your own PKI files and download them into the corresponding partition, and then load the certificates in the code implemented by the AT+USEROTA command. Please refer to How to Generate PKI Files for PKI files. For AT+USEROTA command, ESP-AT project provides an example of USEROTA .

  • Please refer to How to Implement OTA Upgrade for more OTA commands.

Example

AT+
USEROTA=
36
OK>
Recv 
36 
bytes
OK

AT+USERWKMCUCFG : Configure How AT Wakes Up MCU

Set Command

Function:

This command configures how AT checks whether MCU is in awake state and how to wake it up.

  • If MCU is in awake state, AT will directly send the data to it without waking it up.

  • If MCU is in sleep state and AT is ready to actively send the data to MCU (the data sent actively is same to ESP-AT Message Reports ), AT will send wake signals to wake it up first and then send the data to it. Wake signals will be cleared after MCU is waked up or timeout.

Command:

AT+
USERWKMCUCFG=<
enable>,<
wake 
mode>,<
wake 
number>,<
wake 
signal>,<
delay 
time>[,<
check 
mcu 
awake 
method>]

AT+USERMCUSLEEP : MCU Indicates Its Sleep State

Set Command

Function:

This command can only be taken effect when the <check mcu wake method> Bit 0 of the AT+USERWKMCUCFG command is configured. It used to inform AT that the current MCU sleep state.

Command:

AT+
USERMCUSLEEP=<
state>

Provide feedback about this document