Skip to content

Using AT Commands

This content support products:

  1. Mini DTU(Y201)
  2. RS485/RS232 DTU(Y202)

Those devices supports both serial AT and network AT for parameter querying and configuration. For details on switching to serial AT mode.

at commands

AT Command Guidelines:

  • Prefix and Suffix: All AT commands must start with "AT+" and end with "\r" or "\n".
  • Case Sensitivity: AT commands are not case-sensitive, but uppercase letters are recommended.
  • Single Command per Line: Only one AT command is allowed per line. The maximum length of a single command is 256 bytes.
  • Parameter Separation: Multiple parameters within a command must be separated by commas (",").
  • Command Execution Sequence: Ensure that the previous command has returned a response before sending a new one. The maximum timeout for a command is 12 seconds.

WARNING

All AT commands end with characters \r\n.

Read commands

AT+CMD

Response as:


CMD:value
OK

Set commands

AT+CMD=value1,value2…

Response as:


OK

Get help for a command

Some commands need parameters, use get help commands for details.

AT+CMD?

Response as:


CMD:param1:detail1,param2:detail2...
OK

Commands

List all commands:

AT+LIST

Reboot device:

AT+REBOOT

Reset device:

AT+RSTCFG

Reset device:

AT+RSTCFG

Error Code

When the command execution fails, the device will issue an error code. The format of the error code is: \r\n+ERROR:Error_Code\r\n. The description corresponding to the error code can be found in following:

Error CodeDetail
ARGSInvalid parameters: parameter length, size, format, etc.
ARGCInvalid number of parameters: incorrect number of parameters.
CMD_UNKNOWNUnknown command: command does not exist.
CMD_FORMATFormat error: does not start with AT+.
CMD_LENGTHLength error: exceeds maximum command length.
DEV_MEMORYMemory error: memory error.
DEV_SAVESave failed: save failed.

Exiting AT command mode

In AT command mode, you can switch to transparent mode by using the command AT+EXIT or by restarting the device.