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
Chapter 3, 4
and
5.
May 2015
DocID025531 Rev 5
1/46
www.st.com
Contents
UM1695
Contents
1
2
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Command reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
2.10
2.11
2.12
2.13
2.14
2.15
2.16
2.17
2.18
2.19
2.20
2.21
2.22
2.23
2.24
2.25
2.26
2.27
AT: Attention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
AT+CFUN: comm function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
AT+S.HELP: display help text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
AT+S.GCFG: get configuration value . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
AT+S.SCFG: set configuration value . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
AT+S.SSIDTXT: get/set a textual SSID . . . . . . . . . . . . . . . . . . . . . . . . . . .11
AT&V: display all configuration values . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
AT&F: restore factory default settings . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
AT&W: save current settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
AT+S.STS: report current status/statistics . . . . . . . . . . . . . . . . . . . . . . . . 14
AT+S.PEERS: dump contents of the peer table . . . . . . . . . . . . . . . . . . . . 15
AT+S.PING: send a ping to a specified host . . . . . . . . . . . . . . . . . . . . . . 16
AT+S.SOCKON: open a network socket . . . . . . . . . . . . . . . . . . . . . . . . . 16
AT+S. SOCKW: write len bytes of data to socket . . . . . . . . . . . . . . . . . . . 17
AT+S.SOCKQ: query pending data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
AT+S. SOCKR: return len bytes of data from socket . . . . . . . . . . . . . . . . 17
AT+S.SOCKC: close socket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
AT+S.TLSCERT: configure SSL/TLS certificates . . . . . . . . . . . . . . . . . . . 18
AT+S.TLSCERT2: Cleanup SSL/TLS certificate resources . . . . . . . . . . . 18
AT+S.TLSDOMAIN: set CA domain name. It must match the
secured site name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
AT+S.SETTIME: initiate module reference time . . . . . . . . . . . . . . . . . . . . 19
AT+S.SOCKD: enable/disable the socket server . . . . . . . . . . . . . . . . . . . 19
AT+S.: command mode to data mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
AT+S.HTTPGET: issue an HTTP GET . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
AT+S.HTTPPOST: issue an HTTP POST . . . . . . . . . . . . . . . . . . . . . . . . 21
AT+S.FSC: create a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
AT+S.FSA: Append to an existing file . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2/46
DocID025531 Rev 5
UM1695
Contents
2.28
2.29
2.30
2.31
2.32
2.33
2.34
2.35
2.36
2.37
2.38
2.39
2.40
2.41
2.42
2.43
AT+S.FSD: delete an existing file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
AT+S.FSL: list existing filename(s) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
AT+S.FSP: Print the contents of an existing file . . . . . . . . . . . . . . . . . . . . 24
AT+S.WiFi: enable/disable Wi-Fi device . . . . . . . . . . . . . . . . . . . . . . . . . 24
AT+S.ROAM: trigger Wi-Fi reassociation sequence . . . . . . . . . . . . . . . . 24
AT+S.GPIOC: configure general purpose inputs/outputs . . . . . . . . . . . . . 25
AT+S.GPIOR: query general purpose input . . . . . . . . . . . . . . . . . . . . . . . 25
AT+S.GPIOW: set general purpose output . . . . . . . . . . . . . . . . . . . . . . . 26
AT+S.FWUPDATE: perform a firmware update . . . . . . . . . . . . . . . . . . . . 26
AT+S.HTTPDFSUPDATE: update static HTTPD filesystem . . . . . . . . . . 27
AT+S.HTTPDFSERASE: erase the external flash memory . . . . . . . . . . . 27
AT+S.HTTPD: Disable/Enable web server . . . . . . . . . . . . . . . . . . . . . . . . 27
AT+S.SCAN: perform site survey (scan) . . . . . . . . . . . . . . . . . . . . . . . . . 28
AT+S.ADC: Read ADC value on GPIO8 . . . . . . . . . . . . . . . . . . . . . . . . . 29
AT+S.DAC: enable/disable DAC on GPIO15 . . . . . . . . . . . . . . . . . . . . . . 29
AT+S.PWM: set PWM on GPIO1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3
4
5
6
Configuration variable reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Status variable reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Asynchronous indication reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
DocID025531 Rev 5
3/46
46
Overview
UM1695
1
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:
<cr><lf>+WIND:<number>:<descriptive string><cr><lf>
The <number> 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 “<cr><lf>+WIND:0:Console active<cr><lf>” 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<cmd><cr>
<zero or more response lines>
<cr><lf><responsecode><cr><lf>
The AT command line, up to the terminating <cr>, is sent from the host. The (optional)
response lines followed by <cr><lf><responsecode><cr><lf> are sent from the module.
The <response code> is one of the following:
OK
ERROR: <descriptive text>
The AT command handler allows for the AT commands to be entered in upper or lower
case.
4/46
DocID025531 Rev 5
UM1695
Command arguments are case sensitive.
The maximum command length is 512 characters.
Overview
Note that asynchronous indications are blocked from the time the initial “A” is sent to the
module until the <responsecode> 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 5
5/46
46