2
Interface and message types
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
.
•
Command return messages
Synchronous messages that report the status of the execution of a command. The list of synchronous error
codes is reported in
in the Appendix.
•
WINDs
Asynchronous messages reporting a network or radio status at the application level. The list of WIND
messages is reported in
•
Data
Data sent to, or received (data payload) from, a remote device.
Table 1.
SPWF04Sx commands
Command ID
AT command
Description
Utils: commands for debugging and retrieving module status
0x01
AT
Null command
0x02
AT+S.HELP
Help command
0x05
AT+S.STS
Status configuration
0x35
AT+S.PEERS
Peers configuration
Management: commands for module management and configuration
0x03
AT+S.RESET
SW reset
0x04
AT+S.PMS
Set power mode
0x08
AT+S.PYTHON
Enter MicroPython execution
0x09
AT+S.GCFG
Read Configuration status
UM2114
Interface and message types
UM2114
-
Rev 3
page 4/66