The SPWF04Sx series of Wi-Fi modules integrate a complete TCP/IP protocol stack and a rich set of applications including, but
not limited to, web server, web client RESTful API, TFTP, MQTT and SMTP.
Security is added in the multiple layers of Wi-Fi and peer-to-peer protocols. The stack implements the WPS protocol, WPA2 in
both the Personal and Enterprise options, and the TLS for end-to-end secure transactions.
Users access the features of the SPWF04Sx modules via UART using the simple AT command syntax, or via SPI using a
custom packet format and protocol.
To enable a complete customization of the application on the module, the SPWF04Sx software integrates a MicroPython
interpreter that provides the user with MicroPython standard libraries and a customized set of classes to export the specific
SPWF04Sx features.
The diagram below summarizes the possible integrations of an SPWF04Sx module in a target application.
Figure 1. SPWF04Sx user integration modes
This user manual is intended as a guide to the set of commands available on the UART or the SPI console. A description and
explanation of the configuration variables, status variables and asynchronous indication messages is available in the Appendix
of the manual.
This manual is not intended as a technical guide of Wi-Fi and TCP/IP, or other technologies available in the module.
UM2114 - Rev 3 - November 2018
For further information contact your local STMicroelectronics sales office.
www.st.com
Page 2
SPWF04Sx software architecture description
1SPWF04Sx software architecture description
The complete SW architecture of SPWF04S is shown in the diagram below.
Figure 2. SPWF04Sx software architecture
UM2114
A block diagram of the SPWF04Sx protocol stack is provided in Figure 3. SPWF04Sx protocol stack diagram.
UM2114 - Rev 3
page 2/66
Page 3
SPWF04Sx software architecture description
Figure 3. SPWF04Sx protocol stack diagram
UM2114
UM2114 - Rev 3
page 3/66
Page 4
2Interface and message types
As shown in Figure 1. SPWF04Sx user integration modes, the SPWF04Sx enables three options for integration of
the device in the final user application. Refer to the SPWF04Sx datasheet for information useful for
implementation, such as the pinout. The configuration variable, “console_enabled”, is used to define the module
interface to use.
•UART interface
“console_enabled=1”
The UART console provides a user-friendly interface built on a set of AT commands that allow an external
microcontroller connected to the SPWF04Sx UART to access the functions integrated in SPWF04Sx device.
UART is set as the module's default interface.
•SPI interface
“console_enabled=0”
The device can be connected as a slave to the SPI interface of an external microcontroller. An ad hoc SPI
protocol and corresponding packet format are defined.
•MicroPython scripting
"console_enabled=2” - to use Python together with AT commands over UART.
"console_enabled=3” - to use MicroPython only.
The device implements a scripting methodology based on an integrated MicroPython interpreter.
MicroPython scripts can map a target application, making it unnecessary to integrate the device with an
external processor.
The following four message types represent the type of data exchanged over the interfaces.
•Commands
Used to activate a feature defined within the stack. The list of commands supported is specified in
Table 1. SPWF04Sx commands.
•Command return messages
Synchronous messages that report the status of the execution of a command. The list of synchronous error
codes is reported in Section 8 in the Appendix.
•WINDs
Asynchronous messages reporting a network or radio status at the application level. The list of WIND
messages is reported in Section 8 in the Appendix.
•Data
Data sent to, or received (data payload) from, a remote device.
UM2114
Interface and message types
UM2114 - Rev 3
Table 1. SPWF04Sx commands
Command ID
Utils: commands for debugging and retrieving module status
0x01ATNull command
0x02AT+S.HELPHelp command
0x05AT+S.STSStatus configuration
0x35AT+S.PEERSPeers configuration
Management: commands for module management and configuration
0x03AT+S.RESETSW reset
0x04AT+S.PMSSet power mode
0x08AT+S.PYTHONEnter MicroPython execution
0x09AT+S.GCFGRead Configuration status
AT commandDescription
page 4/66
Page 5
Command IDAT commandDescription
0x0AAT+S.SCFGSet configuration variables
0x0BAT+S.WCFGSave configuration to Flash
0x0CAT+S.FCFGRestore factory configuration
0x57AT+S.FSWRITEFS update via serial UART/SPI
0x58AT+S.FSUPDATEFS download
0x56AT+S.FWUPDATEFW download
STM32 peripherals: commands to manage the peripherals and related values
0x13AT+S.GPIOCConfigure GPIO
0x14AT+S.GPIORRead GPIO
0x15AT+S.GPIOWWrite GPIO
0x16AT+S.DACDisable/Enable DAC
0x17AT+S.ADCRead ADC value
0x18AT+S.PWMSet PWM
0x11AT+S.TIMEGet/Set time
0x12AT+S.RANDOMProvide random number
File system management
0x21AT+S.FSMMount volume
0x22AT+S.FSUUmount/Erase volume
0x23AT+S.FSCCreate file, append data
0x25AT+S.FSDDelete file
0x26AT+S.FSRRename file
0x27AT+S.FSLList existing files
0x28AT+S.FSPPrint file content
0x29AT+S.HASHCompute digest
Security: commands to interact with the security features
0x42AT+S.SOCKQQuery a socket client for pending data
0x43AT+S.SOCKCClose a socket client
0x44AT+S.SOCKWWrite data to a socket server
0x45AT+S.SOCKRRead data from a socket client
0x46AT+S.SOCKLList opened socket clients
UM2114
Interface and message types
UM2114 - Rev 3
page 5/66
Page 6
Interface and message types
Command IDAT commandDescription
0x47AT+S.SOCKDONOpen a socket server
0x48AT+S.SOCKDQQuery socket server for pending data
0x49AT+S.SOCKDCClose a socket server
0x4AAT+S.SOCKDWWrite data to a socket server
0x4BAT+S.SOCKDRRead data from a socket server
0x4CAT+S.SOCKDLList bound socket clients
Web sockets
0x61AT+S.WSOCKONOpen a web socket client
0x62AT+S.WSOCKQQuery a web socket client for pending data
0x63AT+S.WSOCKCClose web socket client
0x64AT+S.WSOCKWWrite data to a web socket client
0x65AT+S.WSOCKRRead data from web socket client
0x66AT+S.WSOCKLList open web socket client
Trivial FTP
0x51AT+S.TFTPGETGet request to a TFTP server
0x52AT+S.TFTPPUTPut request to a TFTP server
SMTP
0x53AT+S.SMTPSend an email
HTTP
0x54AT+S.HTTPGETGet a request to an HTTP server
0x55AT+S.HTTPPOSTPost request to an HTTP server
0x59AT+S.INPUTSSIFill buffer for raw text input SSI
MQTT
0x5AAT+S.MQTTCONNMQTT connect
0x5BAT+S.MQTTSUBMQTT subscribe
0x5CAT+S.MQTTPUBMQTT publish
0x5DAT+S.MQTTUNSUBMQTT unsubscribe
0x5EAT+S.MQTTDISCMQTT disconnect
UM2114
UM2114 - Rev 3
page 6/66
Page 7
3AT 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>
AT-S.ERROR:<error-code>:<error-string>
UM2114
AT commands over the UART
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).
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:
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 Section 8 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 - Rev 3
page 7/66
Page 8
4SPI protocol
By setting to 0 the configuration variable "console_enabled", the module is enabled to use the SPI interface in
place of the UART.
The data transferred over the MISO and MOSI signals are packed using a well-defined API packet format as
represented below.
UM2114
SPI protocol
Figure 4. SPI packet formats
Table 2. KindOfEvent Byte SubField
Bits 0:3
Bits 4:7
Bits
Status variable wifi_state values range. Refer to
Table 8. Status variables.
Allowed values are:
•0x01 for common indications like WIND or action
confirmations
•0x02 for critical error notifications
•0x03 for incoming data sent over the SPI (in this case
normally data are filled into payload field)
Event type
Table 3. Indication number field
Event type Bits 4:7
0x01Refer to Table 14. WIND messages.
0x02
0x03Data payload.
Refer to Table 10. AT-S.ERROR:=ERROR ID= =ERROR
String=.
Indication number
Commands over the SPI have a max length of 512 bytes.
To map an AT command in the equivalent SPI command, the following procedure applies:
1.Use the corresponding CMD ID specified in Table 1. SPWF04Sx commands and fill the 4th bytes of the
master packet.
2.If optional parameters are available, count the number of comma-separated items after the “=” character and
with that number the 6th byte of the message. Starting from the 7th byte, start to write 1 byte containing the
field lengths and then copy the field bytes. Then continue with the remaining parameters.
UM2114 - Rev 3
page 8/66
Page 9
UM2114
SPI protocol
3.Once the full payload has been filled, calculate the full message payload lengths and accordingly fill bytes 1
and 2 in the SPI message packet request.
The SPWF04Sx supports the MicroPython modes represented in Figure 5. MicroPython modes. The configuration
variable “console_enabled” identifies the use of the console together with MicroPython. In detail:
•"console_enabled" set to 2: this setting allows using both AT commands over the UART and MicroPython
REPL shell.
•"console_enabled" set to 3: this setting allows only a MicroPython preloaded script to be executed. No
UART/SPI communication is allowed to/from a host processor.
Consequently, the following Python modes are defined:
•Python Interactive Console (REPL – Read Evaluation Print Loop). Mainly used for debugging purposes,
it is activated by the AT+S.Python (Python command) launched without parameters. The REPL is exited by
using a CTRL-D escape character.
•Run Time Script execution. Activated with the Python command, it allows to execute the script specified as
parameter. After script execution, control returns to the AT console.
•DefaultScript Hard Execution. By using the GPIO(8) set to high at boot time, or when "console_enabled" is
set to 3, the module automatically enters the execution of the script specified by the variable “python_script”.
This mode allows the use of the module without a connected host. Note that "console_enabled" is not
changed by GPIO(8) access: this means that on the subsequent reboot, accessing Python mode again will
require GPIO(8) to be high.
UM2114
MicroPython scripting
Figure 5. MicroPython modes
UM2114 - Rev 3
page 10/66
Page 11
6Command reference guide
This section details each of the SPWF04Sx commands listed in Table 1. SPWF04Sx commands, including a brief
description of its behavior and complete list of parameters. Examples and syntax are described in the “AT” format
introduced in Section 3 AT commands over the UART. The mapping mechanism described in Section 4 SPI
protocol is used to map the AT command in the packet format used by the SPI.
6.1AT
AT, by itself, is a null command that always returns an OK result code. It is useful for testing the module interface
for readiness.
Usage:
AT<cr>
UM2114
Command reference guide
Parameters:
None
6.2AT+S.HELP
AT+S.HELP prints the list of all the AT commands supported with a brief help text for each of them. Refer to
Table 1. SPWF04Sx commands for a complete list of the commands available.
Usage:
1) AT+S.HELP<cr>
2) AT+S.HELP=<keyword><cr>
Parameters:
<keyword>
Result:
to get the full list of commands
to get the list of commands containing the specified keyword
Specifies the name of a keyword
AT-S.Command:<command> -- <help>
<command>
<help>
6.3AT+S.STS
AT+S.STS displays the current values of all the status variables.
UM2114 - Rev 3
Specifies the command
Specifies the description of the command
page 11/66
Page 12
Usage:
UM2114
AT+S.PEERS
1) AT+S.STS<cr>
2) AT+S.STS=<variable><cr>
Parameters:
<variable>
Result:
AT-S.Var:<var>=<value>
<var>
<value>
6.4AT+S.PEERS
AT+S.PEERS displays the current values of the peer table. These values are useful to obtain additional
information about the module connected to the AP or about the client connected to the module when it is
configured in Mini AP mode.
Usage:
to get the full list of configuration variables
to get the value of the specified variable
Specifies the name of a variable. See Table 8. Status
variables for a list of the available status variables
Specifies the status variable name
Specifies the status variable value
1) AT+S.PEERS<cr>
2) AT+S.PEERS=<peer_number><cr>
3) AT+S.PEERS=<peer_number>,<peer_var><cr>
Parameters:
<peer_number>
<peer_var>
Result:
AT-S.Var:<id>.<var>=<value>
<id>
returns the list of peers variable
returns the list of peers variable for the peer_number peer
returns the specific value of a peer_variable
identifier of the peer
displays the current value of the specified peer variable. Refer
to Table 9. Peer variables in the Appendix for a complete list
of the peer variables
Specifies the peer number
UM2114 - Rev 3
page 12/66
Page 13
UM2114
AT+S.RESET
<var>
<value>
6.5AT+S.RESET
Command used to provide a SW reset to the module.
Usage:
AT+S.RESET<cr>
Parameters:
None
6.6AT+S.PMS
The SPWF04Sx features different power states as a consequence of the different operating modes of the radio
and the STM32 microcontroller. This command is used to manage the module power state.
The table that follows summarizes the power state conditions supported by the module. The values of the
variables affecting the output of the command are also reported in the following table.
1. Variables wifi_beacon_wakeup, wifi_operational_mode, and wifi_listen_interval, need to be set to the desired value.
2. The variable standby_time to be set to the desired value.
(2)
1RunPS or Fast PS
2StopPS or Fast PS
3StandbyOff
Rx Active
Tx Active
AT+S.SCFG=sleep_enabled,0
AT+S.SCFG=wifi_powersave,0
AT+S.SCFG=standby_enabled,0
AT+S.SCFG=sleep_enabled,0
AT+S.SCFG=standby_enabled,0
AT+S.SCFG=wifi_powersave,1
AT+S.SCFG=sleep_enabled,1
AT+S.SCFG=standby_enabled,0
AT+S.SCFG=wifi_powersave,1
AT+S.SCFG=standby_enabled,1
AT+S.SCFG=sleep_enabled,0
Usage:
AT+S.PMS=[<mode>]<cr>
UM2114 - Rev 3
Parameters:
page 13/66
Page 14
<mode>
6.7AT+S.PYTHON
The command has a Python script executed when the file name is specified or allows to enter a Python shell
when the option is not used.
Usage:
UM2114
AT+S.PYTHON
Default value: 0
Possible values:
•0 → active mode
•1 → powersave mode
•2 → stop mode
•3 → standby mode
1) AT+S.PYTHON<cr>
2) AT+S.PYTHON=<filename><cr>
Parameters:
<filename>
6.8AT+S.GCFG
This command lists all the configuration variables together with their current value.
Usage:
1) AT+S.GCFG<cr>
2) AT+S.GCFG=<cfg_var><cr>
Parameters:
to enter the MicroPython REPL shell.
to execute the specified script.
specifies the Python script to be executed. After the execution
of the script the command returns to the AT console.
to get the full list of configuration variables
to get the value of the specified variable
UM2114 - Rev 3
<cfg_var>
Result:
AT-S.Var:<var>=<value>
<var>
<value>
configuration variable. Refer to Table 7. Configuration
variables for a complete list of the configurable variables.
Specifies the configuration variable name
Specifies the configuration variable value
page 14/66
Page 15
6.9AT+S.SCFG
Command to set the value of the named configuration variable. The value is saved in the RAM until the command
AT+S.WCFG is used.
Usage:
AT+S.SCFG=<key>,<value><cr>
Parameters:
UM2114
AT+S.SCFG
<key>
<value>
6.10AT+S.WCFG
Command to save the configuration set to the Flash.
Usage:
AT+S.WCFG<cr>
Parameters:
None
6.11AT+S.FCFG
Command to restore the factory configuration variables from the Flash. It is mandatory to run a reset (HW or SW)
after a factory restore.
Usage:
variable to configure
value to be set
AT+S.FCFG<cr>
Note:HW factory restore of the variables is performed by pulling the pin GPIO0 high at power-up (until the
“+WIND:1:Poweron” indication is printed). In order to use the HW factory reset (GPIO0 enabled) and
FWUPDATE at the same time, see Section 6.13 AT+S.FSUPDATE.
Parameters:
None
6.12AT+S.FSWRITE
The command is used to update the external volume via serial interface.
Note:The HW flow control MUST be enabled in order to use the command via UART.
Usage:
UM2114 - Rev 3
page 15/66
Page 16
AT+S.FSWRITE=<length><cr>{data}
Parameters:
<length> Data length to send (in bytes)
6.13AT+S.FSUPDATE
To download an updated file system from the named host and path. The downloaded image overwrites the
existing one. In this case, the user needs to perform a backup of the current file system.
This command downloads an updated firmware image located at the named host and path. The downloaded
image is temporary stored in the internal Flash. The user should perform a procedure to save the content of the
file system that will be overwritten during the process.
Note:FWUPDATE can be invalidated by pulling GPIO0 high during the first reset after the execution of AT
+S.FWUPDATE command. In this case, the external filesystem is erased and the FW update is not performed.
Usage:
Note:The HW factory reset pin (GPIO0) must be tight low during F/W update. The HW factory reset can be used after
Command used to configure the function of the various GPIOs on the module. GPIOs can be configured as inputs
or outputs. When used as inputs, they generate an interrupt when the state changes that can be configured on
the signal edge.
Usage:
1) AT+S.GPIOC=<number>,out<cr>
2) AT+S.GPIOC=<number>,in,
[<interrupt>]<cr>
Parameters:
Default: /fw.fota. Document path and optional query
arguments. If a secure FOTA is required, the extension of the
file needs to be “.sfota”.
AT+S.GPIOR is used to read the value and the direction of a previously-configured GPIO.
Usage:
AT+S.GPIOR=<num><cr>
Parameters:
<num>
Result:
GPIO Number (see Datasheet)
Default: No interrupt (turn it off, if enabled). It can assume one
of the following values:
•R → Rising edge
•F → Falling edge
•B → Both rising and falling edges
specifies the GPIO to read
UM2114 - Rev 3
AT-S.Value:<num>:<level>:<direction>
page 17/66
Page 18
UM2114
AT+S.GPIOW
<num>
<level>
<direction>
6.17AT+S.GPIOW
AT+S.GPIOW is used to set the value of a previously-configured output GPIO.
Usage:
AT+S.GPIOW=<num>,<level><cr>
Parameters:
<num>
<level>
6.18AT+S.DAC
The DAC command enables DAC on GPIO15.
Usage:
Specifies the number of GPIO read
0 (low) or 1 (high)
0 (output pullup) or 1 (input)
specifies the GPIO to be set
specifies one possible value(0|1) for the specified GPIO.
AT+S.DAC=<value><cr>
Parameters:
<value>
6.19AT+S.ADC
AT+S.ADC returns ADC value on the selected GPIO. The value range is between 0 and 3300 mV with a
measurement accuracy of 10 mV.
Usage:
AT+S.ADC=<num><cr>
Parameters:
<num>
must be set in mV (between 1 and 3300). The value=0
disables DAC on GPIO15
specifies the GPIO to be used for conversion. Available
GPIOs are 0, 1 and 16
UM2114 - Rev 3
page 18/66
Page 19
Result:
AT-S.Value:<value>
UM2114
AT+S.PWM
<value>
6.20AT+S.PWM
The PWM command enables PWM on the selected GPIO, with a specified frequency and duty-cycle.
Usage:
AT+S.PWM=<num>,<frequency>[,<duty_cycle>]<cr>
Parameters:
<num>
<frequency>
<duty_cycle>
6.21AT+S.TIME
Command to get or set the time (date, time)
Usage:
Specifies the ADC value
specifies the GPIO to be used for PWM. Available GPIOs are
2 and 4
value between 1 and 10 kHz. The value=0 disables PWM
default: 50%. The value is in the 0 - 100 range.
1) AT+S.TIME<cr>
2) AT+S.TIME=<time>
Parameters:
<time>
Result:
AT-S.Date:<yy>.<mo>.<dd>:<day>
AT-S.Time:<hh>.<mi>.<ss>
<yy>
returns the current date in the format “ATS.Date:yy.mm.dd:nn” and the current time in the format “ATS.Time:hh:mm:ss”. The time refers to UTC format and must
be expressed as the time in seconds since 1970-Jan-01.
sets the time as specified by the parameter
value to set the time. The time refers to UTC format and it
must be expressed in seconds since 1970-Jan-01.
Specifies the year
UM2114 - Rev 3
page 19/66
Page 20
UM2114
AT+S.RANDOM
<mo>
<dd>
<day>
<hh>
<mi>
<ss>
6.22AT+S.RANDOM
Command that provides a random number generated by the peripheral integrated in the STM32.
Usage:
AT+S.RANDOM<cr>
Parameters:
None
Specifies the month
Specifies the day
Specifies the year of the week
Specifies the hours
Specifies the minutes
Specifies the seconds
Result:
AT-S.Number:<value>
<value>
6.23AT+S.FSC
This command has effect in the RAM memory volume and external SD card volume. The command creates a file
in the selected volume or appends the data following the command in case the file already exists. The space
available in the file system in RAM can be set using ramdisk_memsize configuration variable. Minimum size is 2
Kb, resulting in maximum 2 files.
Usage:
AT+S.FSC=<filename>,<datalen><cr>{data}
Parameters:
<filename>
<datalen>
Specifies the 32-bit random number
name of the file. Max size is 64 bytes
amount of space in bytes to allocate for the file
6.24AT+S.FSD
The command has effect in the RAM memory volume and external SD card volume. The command deletes an
existing file.
UM2114 - Rev 3
page 20/66
Page 21
Usage:
AT+S.FSD=<filename><cr>
Parameters:
UM2114
AT+S.FSR
<filename>
6.25AT+S.FSR
The command has effect in the RAM memory volume and external SD card volume. The command renames an
existing file.
Usage:
AT+S.FSR=<old_filename>,<new_filename><cr>
Parameters:
<old_filename>
<new_filename>
6.26AT+S.FSL
This command lists the existing filenames together with their prefix that indicates where they are stored and the
size.
name of the file to be deleted
filename to be renamed
new file name
UM2114 - Rev 3
X → External Flash(Volume ID:0)
E → User Flash (stored at STM32F439 address 0x08110000) (Volume ID:1)
D → RAM(Volume ID:2)
I → Application Flash (stored at STM32F439 address
0x08100000)
(Volume ID:3)
Note that Volume ID 3, Application Flash, when protected (app_fs status variable set to 2) does not show content
files.
Usage:
1) AT+S.FSL<cr>
2) AT+S.FSL=[<output_filename>]
print the list of the files on the std output
print the list of the files in the specified name
Parameters:
page 21/66
Page 22
UM2114
AT+S.FSP
<output_filename>
Result:
AT-S.File:<flag>\t<len>\t<name>
<flag>
<len>
<name>
6.27AT+S.FSP
This command prints the content of the specified file starting from the offset and for the specified length.
Usage:
AT+S.FSP=<filename>,[<offset>],[<len>]<cr>
Default:2:/dir.txt. When this option is specified, the output of
the command is saved in the named filename
X (External Flash) or E (User Flash) or D (RAM) or I
(Application Flash)
Specifies the file length
Specifies the file name
Note that Volume ID 1, Application Flash, when protected (app_fs status variable set to 2) does not allow print on
selected file.
Parameters:
<filename>
<offset>
<len>
6.28AT+S.FSM
The command is used to mount the selected volume.
Usage:
AT+S.FSM=[<volume>]<cr>
Parameters:
<volume> Default:0; Indicates the memory volume
6.29
AT+S.FSU
The command is used to umount/erase the user memory volumes.
Usage:
name of the file to be printed
Default Value:0; indicates the byte from where the file is
printed
Default Value: Filesize-Offset; indicates the number of bytes
that are printed
UM2114 - Rev 3
AT+S.FSU=[<volume>],[<erase>]<cr>
Parameters:
page 22/66
Page 23
UM2114
AT+S.HASH
<volume>
<erase>
6.30AT+S.HASH
The command is used to compute a message digest of a given file.
Usage:
AT+S.HASH=[<function>],<filename><cr>
Parameters:
<function>
<filename>
Result:
Default:0; Indicates the memory volume.
Default:0; when”1”, the specified volume is fully erased
Default:0; Indicates the selected hash function. Possible
values are 0: SHA1; 1: SHA224; 2: SHA256; 3: MD5
filename to be used
AT-S.SHA1:<digest> or
AT-S.SHA224:<digest> or
AT-S.SHA256:<digest> or
AT-S.MD5:<digest>
<digest>
6.31AT+S.WPAECERT
To manage WPA certificates in the module Flash memory.
Usage:
AT+S.WPAECERT=content,<option><cr>
AT+S.WPAECERT=<kind>,<size><cr>{data}
Parameters:
<option>
Specifies the digest of given file
to list or to remove certificates within the Flash
to load certificates/key within the module memory
When the value is equal to 1, the command lists the
certificates and key stored in the Flash memory. When the
value is equal to 2 the command removes certificates and
keys stored in the Flash.
UM2114 - Rev 3
page 23/66
Page 24
<kind>
<size>
6.32AT+S.TLSCERT
To Manage TLS certificates in the Module Memory. Note that if Flash is empty, the TLS layer will look for files in
the filesystem with the default names of “tls.cert” and “tls.key” for client certificate and key, while CA certificates
need filenames corresponding to their Subject Key Identifier (e.g.:
"C07A98688D89FBAB05640C117DAA7D65B8CACC4E.ca"). Note also that depending on the type of certificate
format loaded (DER or PEM), the subject key identifier is automatically found by the module itself. The “auth”
parameter is only required when loading PEM format.
Usage:
AT+S.TLSCERT=content,<option><cr>
AT+S.TLSCERT=<kind>,<size><cr>{data}
UM2114
AT+S.TLSCERT
Possible values are as follows:
•Ca → {data} correspond to the RADIUS CA
•Cert → {data} correspond to the SPWF04S certificate
•Key → {data} correspond to the SPWF04S key
Data size in bytes. Data can be transferred in PEM (textual) or
in DER (binary) format.
Parameters:
<option>
<kind>
<size>
6.33AT+S.WPS
Initiate a WPS exchange.
Usage:
AT+S.WPS=<mode><cr>
When the value is equal to 1, the command lists the
certificates and key stored in the Flash memory. When the
value is equal to 2, the command removes the certificates and
keys stored in the Flash.
Possible values are as follows:
•Ca → {data} correspond to the Peer CA
•Cert → {data} correspond to the SPWF04S certificate
•Key → {data} correspond to the SPWF04S key
•Auth → {data} peer’s CA Authority Key ID
Data can be transferred in PEM (textual) or in DER (binary)
format.
UM2114 - Rev 3
Parameters:
page 24/66
Page 25
<mode>
Result:
AT-S.Generated user PIN:<pin> or
AT-S.Generated random PIN:<pin>
UM2114
AT+S.WIFI
mode=0: emulates the push button as defined by the WPS
standard
mode=1: executes WPS PIN mode using the factory PIN of
the device (stored in the configuration variable wifi_wps_pin)
mode=2: executes WPS PIN mode using a random generated
PIN
<pin>
6.34AT+S.WIFI
AT+S.WIFI allows the radio to be enabled or disabled at run-time. Please note that the configuration variable
"wifi_mode" controls the state of the radio at power-up.
Usage:
AT+S.WIFI=<action><cr>
Parameters:
<action>
6.35AT+S.SCAN
AT+S.SCAN performs an immediate scan for available networks. The output reports the BSSID, SSID, the
network channel, signal strength (RSSI), AP capabilities and 802.11 options included security.
Specifies the 8-digit pin used for WPS exchange
can assume the values: 0: radio is off, 1: radio is on
Figure 6. AP capabilities list
UM2114 - Rev 3
Usage:
AT+S.SCAN=<filter>,[<filename>]<cr>
page 25/66
Page 26
Parameters:
UM2114
AT+S.SSIDTXT
<filter>
<filename>
6.36AT+S.SSIDTXT
AT+S.SSIDTXT allows to get/set the current value of the variables wifi_ssid and wifi_ssid_len as text strings
Usage:
AT+S.SSIDTXT<cr>
AT+S.SSIDTXT=<ssidtxt><cr>
Parameters:
<ssidtxt>
Result:
Range of possible values is: d → no filter, s → filter on ssid, m
→ filter on the mac
Default:std output. When specified, the output of the
command is saved in the <filename> file.
get the value of the variable wifi_ssid.
set the value of the variables wifi_ssid and wifi_ssid_len
SSID in textual format
AT-S.Network:<SSID>
<SSID>
6.37AT+S.PING
Send a single ICMP ECHO request to a specified remote host. When IPv6 is enabled, every network request for
name resolution will use IPv6 at the beginning. This means that WIND:24:IPv6 must be waited when ip_use_v6.
Usage:
AT+S.PING=[<counter>],[<size>],<hostname><cr>
Parameters:
<counter>
<size>
<hostname>
Specifies the SSID of current configured network
Default value:1. Number of echo requests to send
Default value:56 bytes. Highest size of the echo packet. Every
sent, or incoming, request will be truncated
Remote Host. DNS resolvable name or IP address
UM2114 - Rev 3
page 26/66
Page 27
6.38AT+S.SOCKON
To open a socket client. Up to 8 socket clients can be set simultaneously on the device. The command returns the
identifier to be used for operations on the socket.
Usage:
AT+S.SOCKON=<hostname>,<port>,<NULL>,<kind><cr>
Parameters:
UM2114
AT+S.SOCKON
<hostname>
<port>
<kind>
Result:
AT-S.On:<IP>:<id>
<IP>
<id>
6.39AT+S.SOCKQ
To query a socket client for pending data. The command returns the number of bytes that are waiting on the
socket.
Usage:
Remote Server. DNS resolvable name or IP address
TCP/UDP socket port
This parameter can assume the values:
•t → tcp
•u → udp
•s → TLS socket using <Hostname> as domain name.
•TLS Server Domain Name → Common name of the
server (URL or the CN field reported into server
certificate) for TLS socket
Specifies the server IP address
Specifies the socket client identifier
UM2114 - Rev 3
AT+S.SOCKQ=<id><cr>
Parameters:
<id>
Result:
Socket Client ID
page 27/66
Page 28
AT-S.Query:<len>
UM2114
AT+S.SOCKC
<len>
6.40AT+S.SOCKC
To close a socket client.
Usage:
AT+S.SOCKC=<id><cr>
Parameters:
<id>
Note: When a socket client receives an indication about socket server gone (only for TCP/TLS sockets,
WIND:58), the socket resource is not automatically cleared. Moreover, flushing pending data (using the AT
+S.SOCKR command) is mandatory before closing the socket connection (AT+S.SOCKC). If the buffer is not
empty, the “ERROR:Pending data” is raised.
6.41AT+S.SOCKW
To write data to a socket client. The host is expected to send <length> characters of data after the end of the
command.
Usage:
Specifies the number of bytes in socket client buffer
Defaut:0. Length (in bytes) of the buffer to read. The value 0
indicates to read the full buffer
<id>
<connected>
<kind>
<len>
<IP>
<port>
6.44AT+S.SOCKDON
To open a socket server. The device can manage up to 2 socket servers each supporting 8 socket clients. The
command returns the server socket ID to be used in the related commands.
Usage:
AT+S.SOCKDON=<port>,<kind><cr>
Parameters:
<port>
<kind>
Specifies the socket client identifier
Specifies whether socket client is connected to socket server
Specifies the kind of socket client
Specifies the number of bytes in socket client buffer
Specifies the server IP address
Specifies the client port
socket port
specifies the kind of socket as one of the following:
•t → tcp
•u → udp
•s1 → TLS socket with one-way authentication
•s2 → TLS socket with mutual authentication
UM2114 - Rev 3
page 29/66
Page 30
Result:
AT-S.On:<id>
UM2114
AT+S.SOCKDQ
<id>
6.45AT+S.SOCKDQ
To query a socket server for pending data.
Usage:
AT+S.SOCKDQ=<sid>,<cid><cr>
Parameters:
<sid>
<cid>
Result:
AT-S.Query:<len>
Specifies the socket server identifier
socket server identifier
socket client identifier
<len>
6.46AT+S.SOCKDC
To close a socket server or to disconnect a client.
Usage:
AT+S.SOCKDC=<sid>
AT+S.SOCKDC=<sid>[,<cid>]
Parameters:
<sid>
<cid>
Note: Flushing pending data (using the AT+S.SOCKDR command) is mandatory before closing the socket
connection (AT+S.SOCKDC). If the buffer is not empty, the “ERROR: Pending data” is raised.
Specifies the number of bytes in client buffer
to close the specified socket server (and disconnect all
clients)
to disconnect the specified client, if client_id is given. If not, all
clients are disconnected, and server is closed
socket server identifier
socket client identifier
UM2114 - Rev 3
page 30/66
Page 31
6.47AT+S.SOCKDW
To write data to a socket server.
Usage:
AT+S.SOCKDW=<sid>,<cid>,<len><cr>{data}
Parameters:
UM2114
AT+S.SOCKDW
<sid>
<cid>
<len>
6.48AT+S.SOCKDR
To read data from a socket server.
Usage:
AT+S.SOCKDR=<sid>,<cid>,[<len>]<cr>
Parameters:
<sid>
<cid>
<len>
6.49AT+S.SOCKDL
To list the bound socket client.
Usage:
socket server identifier
socket client identifier
length (in bytes) of the buffer to write that is sent after the
command.
socket server identifier
socket client identifier
Default:0. length (in bytes) of the buffer to read. The value=0
indicates to read the entire buffer.
To perform a single http get request to the named host and path.
Usage:
DNS resolvable Name or IP address of the remote host
Default is 25 (if TLS=0) or 465 (if TLS>0). Server port
Default:unsecured TLS Security option. 0 → unsecured, 5 →
SMTPS on port 465 if available, otherwise SMTP +
STARTTLS if available, otherwise no security, 8 → SMTP +
STARTTLS if available, otherwise the mail is not sent, 9 →
SMTPS on port 465 if available, otherwise SMTP +
STARTTLS if available, otherwise the mail is not sent.
User of the SMTP server
Password of the SMTP server
Default: nv_model used during Helo
Email address on the SMTP server
Email recipients. Multiple emails are separated by a
semicolon
A recipient can be just an email address, or be in the
extended format consisting of a name followed by a '<',
followed by the email address and terminated by a '>' (e.g.
"Nick <nick@name.xy>")
Default: none. Console. When specified the return data are
saved in a file
Default: none. Filename to transfer to the server. Please refer
to following table the right association between file extension
and HTTP Content-Type.
UM2114 - Rev 3
Table 5. Association between file extension and HTTP content-type
File extension
htmltext/html
fhtmltext/html
csstext/css
txttext/plain
xmltext/xml
xlstext/xls
gifimage/gif
jpgimage/jpg
bmpimage/bmp
Content-type
page 34/66
Page 35
pngimage/png
icoimage/x-icon
classapplication/x-java-applet
swfapplication/x-shockwave-flash
jsonapplication/json
woffapplication/font-woff
formapplication/x-www-form-urlencoded
unknown extensionapplication/x-raw-stuff
6.55AT+S.INPUTSSI
Fill buffer for raw text input SSI <!--|06|Input|index|-->. See AN4965 for details on the use of the SSI.
Usage:
AT+S.INPUTSSI=<length><cr>{data}
UM2114
AT+S.INPUTSSI
File extensionContent-type
Parameters:
<length>
Note: {data} used to fill the buffer must be properly set. The first byte is used as a token splitter; so use this
special character to fill the buffer with multiple tokens. Every token can be directly referred remotely by SSI
indexes contained inside the HTML page. For example: “|hello|world|” will create 2 tokens: "hello” accessed by
<!--|06|Input|0|-->, and “world” accessed by <!--|06|Input|1|-->.
6.56AT+S.MQTTCONN
To open a connection with an MQTT Broker. The command returns a local ID =0, used in the correspondent
commands. The device manages one MQTT connection at a time.
Default: 0. Values Range: 0 → at most once delivery; 1 → at
least one delivery; 2 → exactly one delivery
Default: 0. Possible values: 0 → do not retain, 1 → retain
MQTT message length
UM2114 - Rev 3
AT+S.MQTTDISC=0<cr>
Parameters:
page 36/66
Page 37
None
6.59AT+S.MQTTSUB
To subscribe topic to an MQTT broker.
Usage:
AT+S.MQTTSUB=0,<topic>,[<QoS>]<cr>
Parameters:
UM2114
AT+S.MQTTSUB
<topic>
<QoS>
6.60AT+S.MQTTUNSUB
To unsubscribe topic from an MQTT broker.
Usage:
AT+S.MQTTUNSUB=0,<topic><cr>
Parameters:
<topic>
6.61AT+S.WSOCKON
The module supports the usage of two web socket clients. The command returns the ID that is used in the
corresponding commands.
The MQTT layer is built on top of web sockets. This means that (when an MQTT broker has been connected
through AT+S.MQTTCONN) the total amount of available web sockets decreases to just 1. Note that it is not
possible to run another AT+S.WSOCKON to the same web socket server.
Usage:
Topic where the node subscribes
Default:0. Values Range: 0 → at most once delivery; 1 → at
least one delivery; 2 → exactly one delivery
To close a web socket client using a specific status code.
Usage:
AT+S.WSOCKC=<id>,[<status>]<cr>
Web socket client identifier
Specifies the number of bytes in Web Socket client buffer
UM2114 - Rev 3
Parameters:
page 38/66
Page 39
UM2114
AT+S.WSOCKW
<id>
<status>
Note: When a web socket client receives an indication about web socket server gone (WIND:89), the web socket
resource is not automatically cleared. Moreover, flushing pending data (using the AT+S.WSOCKR command) is
mandatory before closing the socket connection (AT+S.WSOCKC). If the buffer is not empty, the
“ERROR:Pending data” is raised.
Default:0; 0 → Normal Closure; 1 → Going Away; For a
complete list of the status values defined for the web socket,
refer to the related standard
Web socket client identifier
Default:0. 1 → Last frame flag
Default:0. 1 → Last frag flag
Default:0, textual. 1 → Binary flag
6.65AT+S.WSOCKR
To read data from a web socket client.
Usage:
AT+S.WSOCKR=<id>,[<len>]<cr>
Parameters:
<id>
<len>
6.66AT+S.WSOCKL
To list opened web socket clients.
Usage:
AT+S.WSOCKL<cr>
Web socket client identifier
Default 0. 0 value indicates read the full buffer
UM2114 - Rev 3
page 39/66
Page 40
Parameters:
None
Result:
AT-S.List:<id>:<connected>:<len>>:<port>
UM2114
AT+S.WSOCKL
<id>
<connected>
<len>
<port>
Specifies the Web Socket client identifier
Specifies wheter Web Socket client is connected to Web
socket server
Specifies the number of bytes in Web Socket client buffer
Specifies the local port
UM2114 - Rev 3
page 40/66
Page 41
7Technology partners
PartnerDevice descriptionPart number
MACRONIX8-Mbit CMOS Serial Flash memoryMX25L8006E
MACRONIX64-Mbit CMOS Serial Flash memoryMX25L6433F
UM2114
Technology partners
Table 6. Technology partners
UM2114 - Rev 3
page 41/66
Page 42
UM2114
Variables and values
8Variables and values
The following table lists the configuration variables together with their default values. The list of configuration
variables is generated by the command AT+S.GCFG.
Table 7. Configuration variables
Variable nameDefault valueTypeDescription
nv_manuf
nv_modelSPWF04SATEXT[32]Manufacturer Model String
nv_serial0517<11222TEXT[32]Manufacturer Serial Number
nv_wifi_macaddr00:80:E1:FA:12:34HEX[6]Manufacturer assigned 802.11 MAC Address
standby_time10INT
standby_enabled0INTEnable/disable the standby mode
sleep_enabled0INTEnable/Disable the sleep mode
etf_mode0INT
blink_led1INTManage led drive GPIO(10). 0-off 1-0n
ext_volume3INT
ramdisk_memsize16INT
aes128_key
user_descanonymousTEXT[16]Password used during remote configuration
python_script3:/uPython_test.pyTEXT[64]
python_memsize32INT
console_enabled1INT
console_speed115200INTSerial Port Speed: from 9600 to 921600.
Allows choosing Doze (11) or quiescent (12)
power device modes
Set the wakeup interval of the WLAN device,
from 1 to 255 if wifi_listen_interval = 0; from 1
to 65535 if wifi_listen_interval = 1
Beaconing interval in MiniAP mode, from 0 to
2^16-1
Define the wakeup mode (0 = sleep up to the
beacon_wakeup specified, 1 = sleep at least
to the beacon_wakeup specified)
Frame size over which RTS/CTS is used.
Limit:
from 0 to 3000
Can be get/set with the command AT
+S.SSIDTXT. Desired SSID specified in hex.
All 32 octets should be written. Note that
wifi_ssid_len must also be set.
Can be set with the command AT
+S.SSIDTXT.
Length of the actual SSID
in the 32 byte buffer
Maximum number of lost packets before
disassociation
Amount of frames stored for associated
powersaving STAs. 0=do not store frames,
1=store 1 frame
Whether or not to add the TIM information
element in miniAP beacons. 0=do not add,
1=add
Setting the scan process used during the
command AT+S.SCAN. set the channels
allowed for active scan (0 = always passive
scan, 1 = active scan only on channels
enabled by wifi_chan_activity2 status variable
[default], 2 = USA X10 [1-11], 3 = Canada
X20 [1-11], 4 = Europe ETSI X30 [1-13], 5 =
France X32 [10,11], 6 = Japan X40 [1-13], 7 =
Japan X41 [10,11,14]
UM2114
Variables and values
UM2114 - Rev 3
page 43/66
Page 44
UM2114
Variables and values
Variable nameDefault valueTypeDescription
Enable the 802.11n mode. The 11n data rates
wifi_ht_mode1INT
wifi_channelnum1INT
wifi_opr_rate_mask0x003FFFCFINT
wifi_bas_rate_mask0x0000000FINT
wifi_mode1INT
wifi_auth_type0INT
wifi_atim_window0INTReserved
wifi_powersave0INT
wifi_tx_power18INTTransmit power [from 0 to 18], in dBm
must be enabled with the wifi_opr_rate_mask
variable (i.e. wifi_opr_rate_mask=3FFF CF to
enable all the data rate supported)
Channel number to use for MiniAP operation.
The user must properly set the channel
number to not violate IEEE 802.11 Wi- Fi/
WLAN standards.
BIT0: 1 Mbps
BIT1: 2 Mbps
BIT2: 5.5 Mbps
BIT3: 11 Mbps
BIT6: 6 Mbps
BIT7: 9 Mbps
BIT8: 12 Mbps
BIT9: 18 Mbps
BIT10: 24 Mbps
BIT11: 36 Mbps
BIT12: 48 Mbps
BIT13: 54 Mbps
BIT14: MCS0 (6.5Mbps)
BIT15: MCS1 (13Mbps)
BIT16: MCS2 (19.5Mbps)
BIT17: MCS3 (26Mbps)
BIT18: MCS4 (39Mbps)
BIT19: MCS5 (52Mbps)
BIT20: MCS6 (58.5Mbps)
BIT21: MCS7 (65Mbps)
Basic data rate mask, 0x0000000f is
[1,2,5.5,11]
Radio mode.
0=IDLE
1=STA (Supported Security Modes: OPEN,
WEP OpenSystem, WEP SharedKey, WPA/
WPA2 - wifi_auth_type must be set to 0,
WPA-Enterprise)
ip_ipaddr192.168.0.50IPIP address for static usage (DHCP off)
ip_netmask255.255.255.0IPIP netmask for static usage (DHCP off)
ip_gw192.168.0.1IPIP default gateway for static usage (DHCP off)
ip_dns1208.67.222.222IP
ip_dns2208.67.220.220IP
ip_local0:0:0:0:0:0:0:0IPv6IPv6 unique local address
ip_dns1v60:0:0:0:0:0:0:0IPv6
ip_dns2v60:0:0:0:0:0:0:0IPv6
ip_dhcp_timeout20INT
ip_ntp_server1ptbtime1.ptb.deTEXT[32]Primary NTP server (IPv4)
ip_ntp_server2ntp0.ipv6.fau.deTEXT[32]
Heap size dedicated to every socket
connection in unit of 1500 byte
Percentage of ip_sock_memsize used to
allow +WIND:55 and +WIND:88 indications
IP address renew of the
peers in MiniAP mode
(default: 120 sec)
Mask for filtering of mac address during the
association process. The IP is not released to
not selected mac address
Number of allowed clients. IP not released
beyond this number
Scan from remote port enabler. 0=do not
allow; 1=allow
DHCP Server Enable. To be Used in MiniAP
mode. 0=off;1=on
Domain name in Mini AP mode. If the AP
domain name is not quickly opened, it’s
suggested to turn off an eventual proxy server
(check the connection settings of the device
or the browser preferences). Please be sure
to provide a standard extension (.net, .com,
etc.)
Default homepage opening the
ip_apdomainname in miniAP
IP Primary DNS server for static usage
(DHCP off)
IP Secondary DNS server for static usage
(DHCP off)
IPv6 Primary DNS server for static usage
(DHCP off)
IPv6 Secondary DNS server for static usage
(DHCP off)
DHCP client timeout, in
seconds
Secondary NTP server (IPv4 when
ip_use_v6=0, IPv6 when ip_use_v6=1)
UM2114 - Rev 3
page 46/66
Page 47
UM2114
Variables and values
Variable nameDefault valueTypeDescription
ip_ntp_refresh3600INTRefresh time interval
ip_ntp_startup1INTNTP enabler at the startup. 0→off; 1→on
ip_mdns_domain_nameSPWF04S-DefaultTEXT[32]MDNS domain name
ip_mdns_device_name_ttl120INTMDN Time To Live
ip_mdns_services_name
ip_mdns_services_prot_http._tcp _tftp._udpTEXT[64]Services protocol list separated by space
ip_mdns_services_keysdev1 dev2TEXT[32]Services keys list separated by space
ip_mdns_services_valsnumber1 number2TEXT[32]Services values list separated by space
ip_mdns_services_port80 69INTServices ports list separated by space
ip_mdns_services_ttl120 60INTServices ttl list separated by space
ip_mdns_startup01:01HEX[2]
SPWF04S-WebSrv
SPWF04S-TFTPSrv
TEXT[64]
The following table lists the status variables together with their associated values. The list of status variables is
generated by the command AT+S.STS.
Services list separated by space (max two
services)
Services enabler at the startup separated by
space
Table 8. Status variables
Status variableValueNote
build170216-fd39c59-SPWF04SSW Build Version
fw_version1.0.0SW Major Version
boot_version1.0Boot Version
var_version1Variable List version
free_heap55200Current free heap space
min_heap52576Minimum free heap space thus far
system_time1467386876Current Time in UTC format in sec
system_uptime1780System Running Time in sec
system_sleeptime0System Sleeping time in seconds
H/W reported reason for last reset
0 = POWER_ON
reset_reason2
startup0Failure reasons at the boot time (see wind:7 description)
random_number3725839442Random Number generated by the random generator with the AT+S.RANDOM command
gpio_enable0x0000Interrupt-enabled GPIO bitmask, expressed in HEX
app_fs1
user_fs0User Flash. 0→ FS not mounted; 1→ mounted
extvol_fs0Ext. Storage. 0 → FS not mounted; 1 → mounted
nv_power_cycles5Number of executed power-on
1 = WATCHDOG
2 = SOFT RESET
3 = LOW POWER
4 = HW RESET
App Flash. 0 → FS not mounted; 1→ mounted; 2 → mounted and protected. Application
Filesystem can be protected through “__LOCKED__” file insert.
UM2114 - Rev 3
page 47/66
Page 48
Status variableValueNote
nv_wdog_resets0Number of reset due to watchdog
nv_reset_cycles43Number of reset cycles
0= Hardware power up
1=Hardware failure
2=Radio task terminated by user
3=Radio idle
4=Scan in progress
wifi_state10
wifi_own_macaddr00:80:E1:FA:12:34Mac address
wifi_bssid00:18:F8:3C:D9:18BSSID of current association
wifi_aid0Association ID of current association
wifi_channelnum11Current radio channel number
wifi_sup_rate_mask 0x003FFFCFRadio: supported data rate mask
wifi_bas_rate_mask 0x0000000FAP reported: basic data rate mask
wifi_chan_activity0x00003FFF
wifi_max_tx_power 18max allowed transmit power for the defined regdomain
wifi_gf_mode0Greenfield (high throughput) mode
wifi_reg_countryITCurrent regulatory domain
wifi_dtim_period1AP reported DTIM period (used in STA mode)
wifi_num_assoc1Number of the client associated to the module
ip_from_AutoIP0Indicates if the IP derives from AutoIP
ip_ipaddr192.168.121.184Current IP address
ip_netmask255.255.252.0Current IP netmask
ip_gw192.168.123.20Current IP default gateway
ip_dns1192.168.123.20Current IP Primary DNS server
ip_dns2192.168.123.20Current IP Secondary DNS server
ip_linklocalfe80:0:0:0:280:e1ff:fefa:1234 Current IPv6 linklocal
ip_localfec0:0:0:0:280:e1ff:fefa:1234 Current IPv6 local
ip_dns1v60:0:0:0:0:0:0:0Current IPv6 Primary DNS Server
ip_dns2v60:0:0:0:0:0:0:0Current IPv6 Secondary DNS server
5=Scan complete
6=Join in progress
7=Joined
8=Access point started
9=802.11 handshake complete
10=Ready to transmit data (i.e. “Link Up”)
Channels where we are allowed to transmit.
Channel mask. i.e. 0x00003FFF → from channel 0 to channel 13
UM2114
Variables and values
UM2114 - Rev 3
The following table lists the peer variables together with their associated values. The list of peer variables is
generated by the command AT+S.PEERS.
page 48/66
Page 49
Variables and values
Table 9. Peer variables
Peers variablesValueNote
AT-S.Var:n.<var> where n:0=mode connected to STA; n between 1 to 5=id of the connected client
link_id0Identifier of the client
0 = Hardware Power Up
1 = HW link initialization
2 = Client Link identifier allocated
state4
addr02:62:1F:51:8F:0BMAC address of the client
last_rx14Timestamp of last received packet
last_tx14Timestamp of last transmitted packet
rx_drops0Count of frames dropped during reception
tx_drops0Count of frames dropped during transmission
rx_pkts22Count of received frames
tx_pkts24Count of transmitted frames
tx_errs0Count of errors detected during frame transmit
rate_mask0x00003FCFAP reported Operational data rate mask
cur_rate_idx3Most significant byte of the rate_mask
cur_rate_ok3Counter to perform rate step up
cur_rate_fail0Counter to perform rate step down
tx_consec_fail0Counter to perform disassociation
rx_seqnum0x000031F0Sequence number of last RX directed frame
rx_seqnum_mc0x00002780Sequence number of last RX multicast frame
rx_rssi-51Signal strength of last received packet
rx_rateidx13Rate index of last received packet
setprot3Bitmask to indicate protection for TX (bit 1) and/or RX (bit 0) IEEE 802.11 frames
listen_interval0AP reported listen interval
capinfo0x00000411Information about the AP capabilities
3 = Authenticated
4 = Associated
5 = Peer lost beacons
6 = Peer in power save state
UM2114
UM2114 - Rev 3
page 49/66
Page 50
9Synchronous errors and WIND messages
Synchronous errors
The following tables list the synchronous errors, each specified with its ID. The tables also show the errors that
are specific to an HTTP client connection. They are characterized by the prefix AT-S.
Table 10. AT-S.ERROR:=ERROR ID= =ERROR String=
ERROR IDERROR string
1"Command not found"
2"Missing argument(s)"
3Reserved
4"Variable not found"
5Reserved
6"Too many argument(s)"
7"Invalid argument(s)"
8"Invalid value"
9Reserved
10Reserved
11Reserved
12Reserved
13Reserved
14Reserved
15Reserved
16"Cannot switch to Python shell"
17"Radio enabled"
18"Radio not running"
19"Direction must be 'in' or 'out'"
20"Invalid GPIO Num (0-15)"
21"Cannot use GPIO6 when sleep_enabled"
22"Cannot use interrupt. Reserved for WPS feature"
55"Pending Data"%u:%u:%u:%uServer ID, Client ID, Received bytes, cumulative bytes
56"Input to remote"%uInput ID
57"Output from remote"%u:%sReceived message length, message
58"Socket Closed"%u:%u
“WiFi Unhandled
Management”
%02xReceived Frame
Failure Reason. Range Values.
1.Shown when WPA Supplicant was not able to start
2.Shown when WPA Supplicant was not able to
create peer table
Client ID
Closure Reason. Values range
0.Shown when remote TCP sent a FIN
1.Shown when Remote TCP sent a RST, or did not rely
to FINACK
2.Shown when too many retransmissions have occurred
3.Shown when network layer has broken
4.Shown when a timeout occurred
5.Shown when ICMP Destination Unreachable was
received
Only printed when
buffer for input request
is empty. Buffer is filled
and cleared by AT
+S.INPUTSSI
command
Maximum allowed
length is 128. Every
message longer than
128 will be truncated.
Use multipart/formdata webserver
capability to send more
than 128 bytes. Refer
to AN4965 "WebServer
on SPWF04S module
AT+S.SOCKC/AT
+S.SOCKDC needs to
be called to flush the
buffer and clear the
socket state
Figure 6. AP capabilities list ................................................................. 25
UM2114 - Rev 3
page 65/66
Page 66
UM2114
IMPORTANT NOTICE – PLEASE READ CAREFULLY
STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and improvements to ST
products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST
products are sold pursuant to ST’s terms and conditions of sale in place at the time of order acknowledgement.
Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of
Purchasers’ products.
No license, express or implied, to any intellectual property right is granted by ST herein.
Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.
ST and the ST logo are trademarks of ST. All other product or service names are the property of their respective owners.
Information in this document supersedes and replaces information previously supplied in any prior versions of this document.