UM1695
User manual
Command set reference guide for "AT full stack" for
SPWF01Sx series of Wi-Fi modules
Introduction
This document is a guide to the “AT full stack” command set, a firmware application
embedded in the SPWF01Sx series of Wi-Fi modules.
The “AT full stack” command set is a user-friendly interface of a complete TCP/IP stack
supporting both direct links with Wi-Fi enabled devices and infrastructure communication
modes with an access point. Application utilities such as an http client and a web server are
also featured in the software to allow easy integration with many Internet-based
applications.
This document provides a detailed description of each command supported by the “AT full
stack” interface. A description and explanation of configuration variables, status variables
and asynchronous indication messages are also integrated into the document, respectively,
in Section 3, Section 4 and Section 5.
July 2018
DocID025531 Rev 8
1/60
www.st.com
Contents
UM1695
Contents
1
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2
Command reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2/60
2.1
AT: Attention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2
AT+CFUN: comm function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3
AT+S.HELP: display help text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4
AT+S.GCFG: get configuration value . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.5
AT+S.SCFG: set configuration value . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
2.6
AT+S.SSIDTXT: get/set a textual SSID . . . . . . . . . . . . . . . . . . . . . . . . . . .11
2.7
AT&V: display all configuration values . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.8
AT&F: restore factory default settings . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.9
AT&W: save current settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.10
AT+S.STS: report current status/statistics . . . . . . . . . . . . . . . . . . . . . . . . 15
2.11
AT+S.PEERS: dump contents of the peer table . . . . . . . . . . . . . . . . . . . . 16
2.12
AT+S.RMPEER: disassociate a peer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.13
AT+S.PING: send a ping to a specified host . . . . . . . . . . . . . . . . . . . . . . 17
2.14
AT+S.SOCKON: open a network socket . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.15
AT+S.SOCKW: write len bytes of data to socket . . . . . . . . . . . . . . . . . . . 18
2.16
AT+S.SOCKQ: query pending data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.17
AT+S.SOCKR: return len bytes of data from socket . . . . . . . . . . . . . . . . 19
2.18
AT+S.SOCKC: close socket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.19
AT+S.TLSCERT: configure SSL/TLS certificates . . . . . . . . . . . . . . . . . . . 20
2.20
AT+S.TLSCERT2: Cleanup SSL/TLS certificate resources . . . . . . . . . . . 21
2.21
AT+S.TLSDOMAIN: set Server domain name. It must match the secured
site name 22
2.22
AT+S.SETTIME: initiate module reference time . . . . . . . . . . . . . . . . . . . . 22
2.23
AT+S.SOCKD: enable/disable the socket server . . . . . . . . . . . . . . . . . . . 23
2.24
AT+S.: command mode to data mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.25
AT+S.HTTPGET: issue an HTTP GET . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.26
AT+S.HTTPPOST: issue an HTTP POST . . . . . . . . . . . . . . . . . . . . . . . . 25
2.27
AT+S.HTTPREQ: custom HTTP request . . . . . . . . . . . . . . . . . . . . . . . . . 26
DocID025531 Rev 8
UM1695
Contents
2.28
AT+S.FSC: create a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.29
AT+S.FSA: Append to an existing file . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.30
AT+S.FSR: rename an existing dynamic file . . . . . . . . . . . . . . . . . . . . . . 29
2.31
AT+S.FSD: delete an existing file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.32
AT+S.FSL: list existing filename(s) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.33
AT+S.FSP: Print the contents of an existing file . . . . . . . . . . . . . . . . . . . . 30
2.34
AT+S.WIFI: enable/disable Wi-Fi device . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.35
AT+S.ROAM: trigger Wi-Fi reassociation sequence . . . . . . . . . . . . . . . . 32
2.36
AT+S.GPIOC: configure general purpose inputs/outputs . . . . . . . . . . . . . 32
2.37
AT+S.GPIOR: query general purpose input . . . . . . . . . . . . . . . . . . . . . . . 32
2.38
AT+S.GPIOW: set general purpose output . . . . . . . . . . . . . . . . . . . . . . . 33
2.39
AT+S.FWUPDATE: perform a firmware update . . . . . . . . . . . . . . . . . . . . 33
2.40
AT+S.HTTPDFSUPDATE: update static HTTPD file system via HTTP GET
34
2.41
AT+S.HTTPDFSWRITE: update static HTTPD file system via UART . . . 34
2.42
AT+S.HTTPDFSERASE: erase the external Flash memory . . . . . . . . . . 35
2.43
AT+S.HTTPD: disable/enable web server . . . . . . . . . . . . . . . . . . . . . . . . 35
2.44
AT+S.SCAN: perform site survey (scan) . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.45
AT+S.ADC: read ADC value on GPIO8 . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.46
AT+S.DAC: enable/disable DAC on GPIO15 . . . . . . . . . . . . . . . . . . . . . . 38
2.47
AT+S.PWM: set PWM on GPIO1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3
Configuration variable reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4
Status variable reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5
Asynchronous indication reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
DocID025531 Rev 8
3/60
60
Overview
1
UM1695
Overview
The “AT full stack” command interface described in this user guide consists of a set of:
•
AT-style commands
•
configuration variables
•
status variables and
•
asynchronous indications (also known as unsolicited responses or WINDs)
The communication of commands, variables, and asynchronous indications is executed via
the serial port and implies the integration of the SPWF01Sx modules with a host processor
as indicated in Figure 1.
Figure 1. SPWF01S integration with an host processor
UART
Host
(STM32/STM8)
AT commands
Conf. Variables
Status Variables
Asynchronous Indications
Asynchronous indications may arrive at any time (except as noted below), and have the
format:
+WIND::
The field of each asynchronous indication type is unique. The descriptive string
may be safely ignored.
Immediately after reset, no commands should be sent and only asynchronous indications
are present until the indication “+WIND:0:Console active” is received. After
WIND:0 is received, AT commands may be sent to the SPWF device.
AT commands are always in the form of:
AT
The AT command line, up to the terminating , is sent from the host. The (optional)
response lines followed by are sent from the module.
The is one of the following:
OK
ERROR:
The AT command handler allows AT commands to be entered in upper or lower case.
4/60
DocID025531 Rev 8
UM1695
Overview
Command arguments are case sensitive.
The maximum command length is 512 characters.
Note that asynchronous indications are blocked from the time the initial “A” is sent to the
module until the line is sent. Any indications generated from events during
the processing of an AT command are queued for delivery after the command is complete.
DocID025531 Rev 8
5/60
60
Command reference
2
UM1695
Command reference
This chapter details each of the AT commands including brief descriptions of the behavior,
syntax of the command, example of use and types of responses.
The commands described are those listed in Table 1.
Table key:
•
S: command is supported in this release
•
NS: command is not supported in this release
•
New: command is introduced with this release
•
Deprecated: command is deprecated in this release
Table 1. AT command list summary
“AT full stack” commands
6/60
Rel. 1.0
Rel. 2.0
Rel. 3.3
Rel. 3.4
>=Rel. 3.5
AT
S
S
S
S
S
AT+CFUN
S
S
S(1)
S
S
AT+S.HELP
S
S
S
S
S
AT+S.GCFG
S
S
S
S
S
AT+S.SCFG
S
S
S
S
S
AT+S.SSIDTXT
S
S
S
S
S
AT&V
S
S
S
S
S
AT&F
S
S
S
S
S
AT&W
S
S
S
S
S
AT+S.NVW
S
S
Deprecated
NS
NS
AT+S.STS
S
S
S
S
S
AT+S.PEERS
-
New
S
S
S
AT+S.PING
S
S
S
S
S
AT+S.SOCKON
S
S
S
S
S
NS
NS
AT+S.SOCKOS
S
S
Deprecated(2)
AT+S.SOCKW
S
S
S
S
S
AT+S.SOCKQ
S
S
S
S
S
AT+S.SOCKR
S
S
S
S
S
AT+S.SOCKC
S
S
S
S
S
AT+S.SOCKD
-
-
New
S
S
AT+S.
-
-
New
S
S
AT+S.HTTPGET
S
S
S
S
S
AT+S.HTTPPOST
-
New
S
S
S
AT+S.FSC
S
S
S
S
S
DocID025531 Rev 8
UM1695
Command reference
Table 1. AT command list summary (continued)
“AT full stack” commands
Rel. 1.0
Rel. 2.0
Rel. 3.3
Rel. 3.4
>=Rel. 3.5
AT+S.FSA
S
S
S
S
S
AT+S.FSD
S
S
S
S
S
AT+S.FSL
S
S
S
S
S
AT+S.FSP
S
S
S
S
S
AT+S.MFGTEST
S
S
Deprecated
NS
NS
AT+S.PEMDATA
S
S
Deprecated
NS
NS
AT+S.WIFI
S
S
S
S
S
AT+S.ROAM
S
S
S
S
S
AT+S.GPIOC
S
S
S
S
S
AT+S.GPIOR
S
S
S
S
S
S
S
S
S
S
S
S
S
S
S
S
S
S
S
S
AT+S.HTTPDFSERASE(3)
-
-
New
S
S
AT+S.HTTPD
-
-
New
S
S
AT+S.SCAN
-
New
S
S
S
AT+S.ADC
-
-
-
New
S
AT+S.DAC
-
-
-
New
S
AT+S.PWM
-
-
-
New
S
AT+S.TLSCERT
-
-
-
New
S
AT+S.TLSCERT2
-
-
-
New
S
AT+S.TLSDOMAIN
-
-
-
New
S
AT+S.SETTIME
-
-
-
New
S
AT+S.RMPEER
-
-
-
-
New
AT+S.HTTPREQ
-
-
-
-
New
AT+S.FSR
-
-
-
-
New
AT+S.HTTPDFSWRITE
-
-
-
-
New
AT+S.GPIOW
AT+S.FWUPDATE
(3)
AT+S.HTTPDFSUPDATE
(3)
1. Extended to manage low power configuration modes
2. The use of UART 2 and UART 3 interfaces is disabled
3. Command only supported on the HW versions SPWF01Sx.11
The following subsections cover each AT command in detail.
DocID025531 Rev 8
7/60
60
Command reference
2.1
UM1695
AT: Attention
AT, by itself, is a null command that always returns an OK result code. It is useful for testing
the module interface for readiness.
Arguments:
none
Example:
AT
OK
2.2
AT+CFUN: comm function
AT+CFUN sets a power mode with default values as it is indicated in the table 2 and
includes a reset of the device.
Arguments:
0 = switch to the active state and reset the device
1 = keep the current state and reset the device
2 = switch to the powersave state and reset the device
3 = switch to the sleep state and reset the device
4 = switch to the standby mode and reset the device
Table 2. Power states default configuration
Module states
Shortcut command
STM32 states WLAN states
Active
CFUN 0
Run
Rx Idle
Rx Active
Tx Active
Run
at+s.scfg=sleep_enabled,0
at+s.scfg=wifi_powersave,1
PS or Fast PS at+s.scfg=wifi_operational_mode,11
at+s.scfg=wifi_beacon_wakeup,1
at+s.scfg=wifi_listen_interval,0
Power save
CFUN 2
AT variables default values
at+s.scfg=sleep_enabled,0
at+s.scfg=wifi_powersave,0
at+s.scfg=standby_enabled,0
Sleep
CFUN 3
Stop
at+s.scfg=sleep_enabled,1
at+s.scfg=wifi_powersave,1
PS or Fast PS at+s.scfg=wifi_operational_mode,11
at+s.scfg=wifi_beacon_wakeup,1
at+s.scfg=wifi_listen_interval,0
Standby
CFUN 4
Standby
Off
Example:
AT+CFUN=1
8/60
DocID025531 Rev 8
at+s.scfg=standby_enabled,1
at+s.scfg=standby_time,10
at+s.scfg=sleep_enabled,0
UM1695
Command reference
+WIND:2:Reset
2.3
AT+S.HELP: display help text
AT+S.HELP prints a list of all commands supported with a brief help text for each command.
Arguments:
none
Example:
AT+S.HELP
# Recognized commands
#
AT -- Null cmd, always returns OK
#
AT+CFUN = -- Enable common functionalities
#
AT+S. -- Switch to data mode
#
AT+S.HELP -- This text
#
AT&F -- Restore factory default settings
#
AT&V -- Dump all settings
#
AT&W -- Save current settings to flash
#
AT+S.GCFG = -- Get config key
#
AT+S.SCFG =, -- Set config key
#
AT+S.STS [=] -- Report current status/statistics
#
AT+S.SETTIME = -- Set current time
# AT+S.FSC =,[,] -- Create a file for httpd
use
#
AT+S.FSA =, -- Append to an existing file
#
AT+S.FSD = -- Delete an existing file
#
AT+S.FSR =, -- Rename an existing file
#
AT+S.FSL -- List existing filename(s)
# AT+S.FSP =[,,] -- Print the contents of an
existing file
# AT+S.GPIOC =,[,] -- Configure specified GPIO
[Optional IRQ]
#
AT+S.GPIOR = -- Read specified GPIO
#
AT+S.GPIOW =, -- Write specified GPIO
#
AT+S.DAC = -- Disable/Enable DAC on GPIO15
#
AT+S.ADC [=raw] -- Read [raw] ADC value on GPIO8
#
AT+S.PWM =frequency[,duty_cycle] -- Set PWM on GPIO1
#
AT+S.WIFI = -- Disable/Enable WiFi
#
AT+S.ROAM -- Trigger a WiFi Roam
#
AT+S.RMPEER =peer_number -- Disconnect peer from miniAP
# AT+S.SCAN [=[,[,]]] -- Perform a [active/passive]
network scan, [filter off/SSID/MAC], [print to file]
# AT+S.SSIDTXT [=] -- Set a textual SSID (not hex), otherwise
prints current SSID
#
AT+S.PEERS [=peer_number[,peer_var]] -- Dump contents of the peer table
DocID025531 Rev 8
9/60
60
Command reference
UM1695
# AT+S.TLSCERT =, -- Configure SSL/TLS
certificates
# AT+S.TLSCERT2 =clean, -- Cleanup SSL/TLS
certificates resources
# AT+S.TLSDOMAIN =, -- Set Server domain
name. It must match the secured site name EXACTLY.
# AT+S.SOCKD =[,] -- Disable/Enable socket server. Default is
TCP
#
AT+S.SOCKON =,,[,ind] -- Open a network socket
#
AT+S.SOCKQ = -- Query socket for pending data
#
AT+S.SOCKC = -- Close socket
#
AT+S.SOCKW =, -- Write data to socket
#
AT+S.SOCKR =, -- Read data from socket
#
AT+S.HTTPD = -- Disable/Enable web server
# AT+S.HTTPGET =,[,port] -- Http GET of the
given path to the specified host/port
# AT+S.HTTPPOST =,,[,port] -- Http
POST of the given path to the specified host/port
# AT+S.HTTPREQ =,[,port], -- Custom Http
Request to the specified host/port
#
AT+S.HTTPDFSERASE -- Erase the external httpd filesystem
# AT+S.HTTPDFSWRITE = -- Write the external httpd
filesystem
# AT+S.HTTPDFSUPDATE =,[,port] -- Download a new
httpd filesystem from the specified host/port
# AT+S.FWUPDATE =,[,port] -- Upgrade the onboard
firmware from the specified host/port
#
AT+S.PING = -- Send a ping to a specified host
OK
2.4
AT+S.GCFG: get configuration value
AT+S.GCFG prints the value of one named configuration variable. See Section 3:
Configuration variable reference for a list of available variables. AT&V provides the list of all
variables and values on a running module.
Arguments:
Name of the configuration variable
Example:
AT+S.GCFG=ip_ipaddr
# ip_ipaddr = 192.168.0.50
OK