Skip to content

Commit

Permalink
docs: Backported some AT command docs to esp8266
Browse files Browse the repository at this point in the history
Includes the following AT commands:
- AT+USERRAM
- AT+USEROTA
- AT+USERWKMCUCFG
- AT+USERMCUSLEEP
- AT+CIPSTATE
- AT+CWSTATE
  • Loading branch information
ustccw committed Oct 31, 2024
1 parent 42c8e3f commit b3bd9fd
Show file tree
Hide file tree
Showing 9 changed files with 734 additions and 174 deletions.
84 changes: 0 additions & 84 deletions docs/en/AT_Command_Set/Basic_AT_Commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Basic AT Commands
- :ref:`AT+SLEEP <cmd-SLEEP>`: Set the sleep mode.
- :ref:`AT+SYSRAM <cmd-SYSRAM>`: Query current remaining heap size and minimum heap size.
- :ref:`AT+SYSMSG <cmd-SYSMSG>`: Query/Set System Prompt Information.
- :ref:`AT+USERRAM <cmd-USERRAM>`: Operate user's free RAM.
- :ref:`AT+SYSFLASH <cmd-SYSFLASH>`: Query/Set User Partitions in Flash.
- [ESP32 Only] :ref:`AT+FS <cmd-FS>`: Filesystem Operations.
- :ref:`AT+RFPOWER <cmd-RFPOWER>`: Query/Set RF TX Power.
Expand Down Expand Up @@ -625,89 +624,6 @@ Example
// print no prompt info when the connection status is changed
AT+SYSMSG=2

.. _cmd-USERRAM:

:ref:`AT+USERRAM <Basic-AT>`: Operate user's free RAM
------------------------------------------------------

Query Command
^^^^^^^^^^^^^

**Function:**

Query the current available user's RAM size.

**Command:**

::

AT+USERRAM?

**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
^^^^^^^^^^

- **<operation>**:

- 0: release user's RAM
- 1: malloc user's RAM
- 2: write user's RAM
- 3: read user's RAM
- 4: clear user's RAM

- **<size>**: the size to malloc/read/write
- **<offset>**: the offset to read/write. Default: 0

Notes
^^^^^

- Please malloc the RAM size before you perform any other operations.
- If the operator is ``write``, wrap return ``>`` after the write command, then you can send the data that you want to write. The length should be parameter ``<length>``.
- If the operator is ``read`` and the length is bigger than 1024, ESP-AT will reply multiple times in the same format, each reply can carry up to 1024 bytes of data, and eventually end up with ``\r\nOK\r\n``.

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

.. _cmd-SYSFLASH:

:ref:`AT+SYSFLASH <Basic-AT>`: Query/Set User Partitions in Flash
Expand Down
50 changes: 47 additions & 3 deletions docs/en/AT_Command_Set/TCP-IP_AT_Commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ TCP/IP AT Commands
:link_to_translation:`zh_CN:[中文]`

- :ref:`AT+CIPV6 <cmd-IPV6>`: Enable/disable the network of Internet Protocol Version 6 (IPv6).
- :ref:`AT+CIPSTATUS <cmd-STATUS>`: Obtain the TCP/UDP/SSL connection status and information.
- :ref:`AT+CIPSTATE <cmd-IPSTATE>`: Obtain the TCP/UDP/SSL connection information.
- :ref:`AT+CIPSTATUS (deprecated) <cmd-STATUS>`: Obtain the TCP/UDP/SSL connection status and information.
- :ref:`AT+CIPDOMAIN <cmd-DOMAIN>`: Resolve a Domain Name.
- :ref:`AT+CIPSTART <cmd-START>`: Establish TCP connection, UDP transmission, or SSL connection.
- :ref:`AT+CIPSTARTEX <cmd-STARTEX>`: Establish TCP connection, UDP transmission, or SSL connection with an automatically assigned ID.
Expand Down Expand Up @@ -96,11 +97,54 @@ Notes

- You should enable IPv6 network before using IPv6 related upper layer AT commands (TCP/UDP/SSL/PING/DNS based on IPv6 network, also known as TCP6/UDP6/SSL6/PING6/DNS6 or TCPv6/UDPv6/SSLv6/PINGv6/DNSv6).

.. _cmd-STATUS:
.. _cmd-IPSTATE:

:ref:`AT+CIPSTATUS <TCPIP-AT>`: Obtain the TCP/UDP/SSL Connection Status and Information
:ref:`AT+CIPSTATE <TCPIP-AT>`: Obtain the TCP/UDP/SSL Connection Information
----------------------------------------------------------------------------------------

Query Command
^^^^^^^^^^^^^^^

**Command:**

::

AT+CIPSTATE?

**Response:**

When there is a connection, AT returns:

::

+CIPSTATE:<link ID>,<"type">,<"remote IP">,<remote port>,<local port>,<tetype>

OK

When there is no connection, AT returns:

::

OK

Parameters
^^^^^^^^^^

- **<link ID>**: ID of the connection (0~4), used for multiple connections.
- **<"type">**: string parameter showing the type of transmission: "TCP", "TCPv6", "UDP", "UDPv6", "SSL", or "SSLv6".
- **<"remote IP">**: string parameter showing the remote IPv4 address or IPv6 address.
- **<remote port>**: the remote port number.
- **<local port>**: the local port number.
- **<tetype>**:

- 0: ESP runs as a client.
- 1: ESP runs as a server.

.. _cmd-STATUS:

:ref:`AT+CIPSTATUS (deprecated) <TCPIP-AT>`: Obtain the TCP/UDP/SSL Connection Status and Information
-----------------------------------------------------------------------------------------------------

Execute Command
^^^^^^^^^^^^^^^

Expand Down
1 change: 1 addition & 0 deletions docs/en/AT_Command_Set/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Here is a list of AT commands. Some of them can only work on the ESP32 series, s
[ESP8266 Only] Signaling Test AT Commands <Signaling_Test_AT_Commands>
Web server AT Commands <Web_server_AT_Commands>
[ESP32 & ESP32S2 & ESP32-C3] Driver AT Commands <Driver_AT_Commands>
User AT Commands <user_at_commands>
AT Command Set Comparison <AT_Command_Set_Comparison>

It is strongly recommended to read the following sections for some common information on AT commands before you dive into the details of each command.
Expand Down
Loading

0 comments on commit b3bd9fd

Please sign in to comment.