3
AT commands over the UART
The factory module configuration sets the UART console mode as the default interface for the SPWF04Sx. This
corresponds to the configuration variable “console_enabled” being set to 1.
AT commands over the UART have a max length of 512 bytes; they are case insensitive and are always in the
form of:
AT+S.
<cmd-parameters><cr>[data]
Note:
Any command requiring data after the <cr> is not reentrant. If bytes are lost during data transfer over the
UART, the module remains in the waiting stage for incoming bytes.
A command is followed by a variable number of response lines that have the following format:
AT-S.
<response-string><optional-parameters>
The AT command line, up to the terminating <cr>, is sent from the host. Response lines are sent from the module
to the host.
AT-S.OK:<free_heap>:<wifi_state>
returned when a command is successfully executed.
Note that free_heap and wifi_state are shown depending on
the "console_verbose" configuration variable value (0 to 2).
AT-S.ERROR:<error-code>:<error-string>
qualifies a synchronous error. The <error-code> field of each
asynchronous indication type is unique. The descriptive string
may be safely ignored.
Note that error_code and error_string are shown depending
on the "console_errs" configuration variable value (0 to 2).
Command parameters
A command can require parameters that follow an “=” character. The parameters are positional and separated by
a configurable separator (by default, a comma).
Parameters can require mandatory or optional values. In the latter case, if the value is not specified a default
value will be used. In the format of the command, an optional parameter is represented in squared brackets.
Asynchronous indications
Asynchronous indications may arrive at any time (except as noted below), and have the format:
+WIND:<number>:<descriptive-string>[:<variables>]<cr><lf>
The
<number>
field of each asynchronous indication type is unique. The descriptive string may be safely ignored.
Note that number and descriptive strings are shown depending on the "console_winds" configuration variable
value (0 to 2).
Refer to
in the Appendix for a complete list of WIND messages.
Note:
Immediately after reset, no commands should be sent and only asynchronous indications are present until
the indication “
+WIND:0:Console active<cr><lf>
” is received. After this event, AT commands may be safely sent to
the device.
UM2114
AT commands over the UART
UM2114
-
Rev 3
page 7/66