![]() |
Back to main page |
---|
1. Introduction
This article introduces the AT command set and how to use it. The command set includes: basic AT commands, Wi-Fi® function AT commands, TCP/IP toolbox AT commands, and Bluetooth® LE-related AT commands.
1.1. AT command types
There are three types of AT command.
- Query command
- Format:
AT+<x>?
- Description: Retrieves the current value of a parameter.
- Format:
- Set command
- Format:
AT+<x>=<···>
- Description: Sets user-defined parameters to specified values.
- Format:
- Execute command
- Format:
AT+<x>
- Description: Executes the function associated with a variable parameter, enforcing immutability within the module.
- Format:
Note:
- Not every AT command has all three types mentioned above.
- Currently, only strings and integers are supported as input parameters in AT commands.
- Angle brackets
< >
designate parameters that cannot be omitted. - Square brackets
[ ]
designate optional parameters that can be omitted. The default value of the parameter will be used instead when you omit it. - If the parameter you want to omit is followed by another parameter, you must use a comma to indicate it. For example:
AT+CWJAP="ssid","password",,1
. - String values need to be enclosed in double quotation marks, such as:
AT+CWSAP="AP-NAME","12345678"
. - Each AT command should not exceed 256 bytes in length.
- AT commands end with a new line (CR-LF), so the serial tool should be set to New Line Mode.
- The parameter storage in AT commands is implemented using the EasyFlash library.
1.2. AT message types
There are two types of AT messages returned from the AT command port: AT response messages and AT message reports.
1.2.1. AT response messages
Each AT command input returns response messages to inform the sender of the result of the AT command. The last message of a response will always be either "OK" or "ERROR".
Response | Description |
---|---|
OK | AT command processed successfully and returned OK |
ERROR | AT command error or an error occurred during execution |
SEND OK | Data has been sent to the protocol stack |
SEND FAIL | An error occurred while sending the data to the protocol stack |
SEND CANCELLED | Cancel sending data in Wi-Fi normal transmission mode |
+<Command Name>:...
|
Response to the sender that describes AT command process results in detail |
1.2.2. Event reports
AT modem will report important state changes or messages to the host. They are asynchronous and may be un-solicited
Event Report | Description |
---|---|
ready | The AT firmware is ready |
busy p... | Busy processing. The system is handling the previous command and cannot accept new input |
ERR CODE:<0x%08x> | Error code for different commands |
+CW:CONNECTING | Wi-Fi station interface is connecting to an AP |
+CW:CONNECTED | Wi-Fi station interface has connected to an AP |
+CW:ERROR,<reason_code> | Wi-Fi station interface connection to AP failed (<reason_code>: failure reason, optional) |
+CW:GOTIP | Wi-Fi station interface has obtained the IPv4 address |
+CW:DISCONNECTED | Wi-Fi station interface has disconnected from an AP |
+CW:STA_CONNECTED <sta_mac> | A station has connected to the Wi-Fi softAP interface of AT (<sta_mac>: MAC address) |
+CW:STA_DISCONNECTED <sta_mac> | A station has disconnected from the Wi-Fi softAP interface of AT (<sta_mac>: MAC address) |
+CW:DIST_STA_IP <sta_mac>,<sta_ip> | The Wi-Fi softAP interface of AT assigns an IP address to the station (<sta_mac>, <sta_ip>) |
+CWLAP:<ecn>,<ssid>,<rssi>,<mac>,<channel>,... | Wi-Fi scan beacon information of nearby access points |
+CW:SCAN_DONE | Wi-Fi scan completed |
+CWSTATE:<state>,"<ssid>" | Wi-Fi state change (<state>: 0=idle, 1=connecting, 2=connected, 3=disconnected, 4=error) |
+CWJAP:"<ssid>","<bssid>",<channel>,<rssi>,<authmode> | Wi-Fi join AP result |
+CWRECONNCFG:<interval>,<repeat> | Wi-Fi reconnect configuration |
+CWLAPOPT:<show_hidden>,<max>,<min>,<sort>,<filter> | Wi-Fi scan options |
+CWSAP:"<ssid>","<pwd>",<channel>,<authmode>,... | SoftAP configuration |
+CWLIF:<ip>,<mac> | List of stations connected to the SoftAP |
+CWDHCP:<state> | DHCP state |
+CWDHCPS:<lease_time>,<start_ip>,<stop_ip> | DHCP server configuration |
+CWAUTOCONN:<state> | Auto-connect state |
+CIPSTAMAC:"<mac>" | Station MAC address |
+CIPAPMAC:"<mac>" | SoftAP MAC address |
+CIPSTA:<item>:"<value>" | Station IP/gateway/netmask/IPv6 |
+CIPAP:<item>:"<value>" | SoftAP IP/gateway/netmask/IPv6 |
+CWAPPROTO:<proto> | SoftAP protocol |
+CWSTAPROTO:<proto> | Station protocol |
+CWHOSTNAME:<hostname> | Hostname |
+CWCOUNTRY:<policy>,"<country>" | Country configuration |
+CWEVT:<enable> | Wi-Fi event enable |
+CWANTENABLE:<dyn>,<stat>,<pin> | Antenna configuration |
+CWANT:<ant> | Current antenna |
+CWANTNUM:<num> | Antenna count |
+CWNETMODE:<mode> | Network mode |
+CIP[:<conn_id>],CONNECTED | A network connection of which ID is <conn_id> is established (ID=0 by default) |
+CIP[:<conn_id>],DISCONNECTED | A network connection of which ID is <conn_id> ends (ID=0 by default) |
+LINK_CONN:<status_type>,<link_id>,<ip_type>,... | Detailed connection info for TCP/UDP/SSL |
+CIPSTATUS:<link_id>,"<type>",... | Connection status |
+CIPSTART:<link_id>,"<type>",... | Start connection |
+CIPERROR:<link_id>,<error_code> | Network connection error |
+CIPRECV:<link_id>,<length> | Data received in passive mode |
+CIPSEND:<link_id>,<length> | Data sent in passive mode |
+CIPSENDL:<sent_length>,<recv_length> | Data send progress in Passthrough Mode |
+CIPSENDLCFG:<report_size>,<transmit_size> | Passthrough send config |
false> | Data info mode |
+CIPEVT:<enable> | Network event enable |
+CIPMUX:<mode> | Multiplex mode |
+CIPRECVMODE:<mode> | Passive receive mode |
+CIPRECVBUF:<size> | Passive receive buffer size |
+CIPRECVLEN:<link_id>,<size> | Passive receive data length |
+CIPSERVER:<enable>,<port>,"<type>",... | Server config |
+CIPSERVERMAXCONN:<maxconn> | Maximum server connections |
+CIPSSLCSNI[:<link_id>],<sni> | SSL SNI configuration |
+CIPSSLCPSK[:<link_id>],"<psk>","<hint>" | SSL PSK configuration |
+CIPSTO:<timeout> | Server timeout |
+CIPSNTPCFG:<enable>,<timezone>,... | SNTP configuration |
+CIPSNTPTIME:<time> | SNTP time |
+CIPSNTPINTV:<interval> | SNTP interval |
+CIPRECONNINTV:<interval> | Reconnect interval |
TIMEOUT | Ping result |
+GET_CLOCK:<source> | Clock source |
+TWT:ACTIVE:<s>,<t>,<e>,<n>,<m>,<type> | TWT active information |
+TWT:INACTIVE | TWT inactive |
+SYSRAM:<free>,<lwip> | System RAM information |
+SYSMSG:<byte> | System message configuration |
+SYSTIMESTAMP:<timestamp> | System timestamp |
+SYSLOG:<enable> | System log enable |
+SYSSTORE:<enable> | System store enable |
+TEMP:<temp> | Temperature |
+IOIN=<pin>:<value> | IO input value |
+PART:<idx>,<type>,"<name>",<addr>,<size>,<used>,<total> | Partition information |
+OTASTART:<flag> | OTA start |
+FS:READ,<size>,<data> | File read |
+FS:SIZE,<size> | File size |
+FS:LIST | File list |
+GMACSLOT[0-2]:<mac> | MAC slot information |
+VBAT:<vbat_mv> | Battery voltage |
+IPD [<link_id>,]<length>[,"<remote_ip>",<remote_port>],... | Data received from the network. Format depends on AT+CIPMUX, AT+CIPRECVTYPE, AT+CIPDINFO |
+MQTT:CONNECTED,<linkid> | MQTT has connected to Brokers |
+MQTT:DISCONNECTED,<linkid> | MQTT has been disconnected from Brokers |
+MQTT:SUBRECV,<linkid>,<topic_length>,... | MQTT message received on subscribed topic |
+MQTTUSERCFG:<linkid>,<scheme>,... | MQTT user config |
+MQTTCLIENTID:<linkid>,"<client_id>" | MQTT client ID |
+MQTTUSERNAME:<linkid>,"<username>" | MQTT username |
+MQTTPASSWORD:<linkid>,"<password>" | MQTT password |
+MQTTCONNCFG:<linkid>,<keepalive>,... | MQTT connection config |
+MQTTSUB:<linkid>,<msg_id>,<topic>,<qos> | MQTT subscribe |
+MQTTSUB:ALREADY_SUBSCRIBE | Already subscribed |
+MQTTUNSUB:NO_UNSUBSCRIBE | No unsubscribe |
+MQTTSNI:<linkid>,<sni> | MQTT SNI |
Data in Passthrough Mode | In Passthrough Mode, data has been received from the network or Bluetooth |
SEND CANCELLED | Cancel sending data in Wi-Fi normal transmission mode |
+BLE:CONNECTED:<idx>,"<addr>" | A Bluetooth LE connection established (<idx>: connection index, <addr>: MAC address) |
+BLE:DISCONNECTED:<idx>,"<addr>" | A Bluetooth LE connection ends |
+BLE:CONNPARAM:<idx>,<interval>,... | Bluetooth LE connection parameters update |
+BLE:SCAN:<addr>,<rssi>,... | Bluetooth LE scan information of nearby devices |
+BLE:DATALENUPDATED:<idx>,<tx_octets>,... | Bluetooth LE data length updated |
+BLE:PASSKEYDISPLAY:<passkey> | Bluetooth pairing passkey display |
+BLE:PASSKEYCONFIRM:<addr>PASSKEY:<passkey> | Bluetooth pairing passkey confirm (<addr>: MAC address, <passkey>: 6-digit passkey) |
+BLE:PASSKEYENTRY:<addr> | Bluetooth pairing passkey entry (<addr>: MAC address) |
+BLE:PAIRCANNELED:<addr> | Bluetooth pairing canceled (<addr>: MAC address) |
+BLE:PAIRINGCONFIRM:<addr> | Bluetooth pairing confirm (<addr>: MAC address) |
+BLE:PAIRINGCOMPLETED:<bonded> BTADDR: <addr> LTK: <ltk> | Bluetooth pairing completed (<bonded>: Bonded/Paired, <addr>: MAC address, <ltk>: LTK) |
+BLE:PAIRINGFAILED:<addr> | Bluetooth pairing failed (<addr>: MAC address) |
+BLESECGETLTKLIST:BONDADDR<addr>LTK:<ltk> | Bluetooth LTK list (<addr>: MAC address, <ltk>: LTK) |
+BLE:GATTWRITE:<idx>,<srv_idx>,<char_idx>,<len>,<data> | Bluetooth GATT write |
+BLE:GATTREAD:<idx>,<srv_idx>,<char_idx>,<len> | Bluetooth GATT read |
+BLE:INDICATION:<status>,<srv_idx>,<char_idx> | Bluetooth indication |
+BLE:NOTIFICATION:<status>,<srv_idx>,<char_idx> | Bluetooth notification |
+BLE:NOTIDATA:<status>,<srv_idx>,<char_idx> | Bluetooth notification data |
+BLE:SRV:<idx>,<srv_idx>,<uuid>,<type>,<start_handle>,... | Bluetooth service info |
+BLE:SRVCHAR:<idx>,<srv_idx>,<char_idx>,<uuid>,... | Bluetooth characteristic info |
+BLE:MTUSIZE:<idx>,<mtu> | Bluetooth MTU size |
+BLE:IAS:<hex> | Bluetooth Immediate Alert Service |
+BLEINIT:<role> | Bluetooth init role |
+BLEADDR:"<addr>" | Bluetooth address |
+BLENAME:<name> | Bluetooth name |
+BLESCANPARAM:<interval>,<window>,... | Bluetooth scan params |
+BLEADVPARAM:<interval_min>,<interval_max>,... | Bluetooth adv params |
+BLECONN:<idx>,"<addr>" | Bluetooth connection |
+BLECONNPARAM:<idx>,<interval>,<latency>,... | Bluetooth connection params |
+BLEGATTSSRV:<idx>,"<uuid>",<type>,<uuid_type> | Bluetooth GATT server service |
+BLEGATTSCHAR:<idx>,<srv_idx>,"<uuid>",<prop>,... | Bluetooth GATT server char |
+BLETXPWR:<pwr> | Bluetooth TX power |
+BLESECPARAM:<param> | Bluetooth security param |
+BLEBASLEVEL:<level> | Bluetooth battery level |
+QUITT | AT quits from the Wi-Fi Passthrough Mode |
Note:
- Format:
id
,<length>
,<data>
- If
AT+CIPMUX=0
,AT+CIPRECVTYPE=0
, andAT+CIPDINFO=1
, the output format is:+IPD:<length>,"<remote_ip>",<remote_port>,<data>
- If
AT+CIPMUX=1
,AT+CIPRECVTYPE=<link_id>,0
, andAT+CIPDINFO=1
, the output format is:+IPD:<link_id>,<length>,"<remote_ip>",<remote_port>,<data>
- Field descriptions:
link_id
: Connection IDlength
: Length of the dataremote_ip
: Remote IP addressremote_port
: Remote port numberdata
: Actual data content
- For SSL connections in passive receive mode (
AT+CIPRECVTYPE=1
), thelength
returned by the AT command may not match the actual readable SSL data length. This is because the AT command prioritizes the readable data length at the SSL layer. If the SSL layer has no readable data (for example, length is 0), the AT command will return the readable data length from the socket layer instead.
2. Basic AT commands
Command | Description |
---|---|
AT | Test AT startup |
AT+GMR | View version information |
AT+CMD? | List all AT commands and types supported in current firmware |
AT+RST | Restart the module |
AT+RESTORE | Reset |
ATE | Configure AT commands echoing |
AT+SYSRAM? | Query current remaining heap size and lwip remaining heap size |
AT+SYSMSG? | Query/Set system prompt information |
AT+SYSLOG? | Enable or disable the AT error code prompt |
AT+SYSSTORE? | Query/Set parameter store mode |
AT+TEMP? | Query the temperature of the chip |
AT+EFUSE-W | eFuse write operation |
AT+EFUSE-R | eFuse read operation |
AT+EFUSE-CFM | eFuse write confirmation will directly write into eFuse |
AT+FLASH-W | Flash write operation |
AT+FLASH-R | Flash read operation |
AT+FLASH-E | Flash erase operation |
AT+IOPUPD | Initialize GPIO pins as pull-up/pull-down mode |
AT+IOOUT | Set GPIO output high/low level |
AT+IOIN | Query/Set GPIO in the input mode |
AT+IORST | Reset a GPIO's analog input mode |
AT+PART | Get information about the partitions |
AT+OTASTART | Start OTA transmission |
AT+OTASEND | Send OTA data |
AT+OTAFIN | OTA transmission completed |
AT+FS | Filesystem Operations |
AT+GMAC | Query the MAC addresses of 3 slots in eFuse |
AT+PN | Query the part number |
AT+VBAT | Query the voltage value at the supply pin (unit: mV) |
AT+MINIDUMP | Dump minidump binary by hex |
AT+EFUSE-W-HEX | eFuse write operation with hexadecimal data |
AT+EFUSE-R-HEX | eFuse read operation with hexadecimal data |
AT+FLASH-W-HEX | Flash write operation with hexadecimal data |
AT+FLASH-R-HEX | Flash read operation with hexadecimal data |
2.1. Basic AT command description
2.1.1. AT
Function: Test AT startup.
2.1.1.1. Execute command
Command
AT
Response
OK
2.1.2. AT+GMR
Function: View version.
2.1.2.1. Execute command
Command
AT+GMR
Response
<AT version info> <macsw version info> <phyrf version info> <bthost version info> <btblecontroller version info> <SDK version info> <compile time> OK
2.1.2.2. Parameters
- <AT version info>: AT version information
- <macsw version info>: macsw component version information
- <phyrf version info>: phyrf component version information
- <bthost version info>: bthost component version information
- <btblecontroller version info>: btblecontroller component version information
- <SDK version info>: SDK version information
- <compile time>: Compile time
2.1.2.3. Example
Command
AT+GMR
Response
AT version:1.0.0.1(Apr 30 2025 11:47:03) component_version_macsw_1.6.38 lib_version_phyrf_00f7ad715 component_version_btble_1.8.25 lib_version_btblecontroller_1.6.89 component_version_sdk_2.0.75 compile time:Apr 30 2025 11:46:58 OK
2.1.3. AT+RST
Function: Restart the module.
2.1.3.1. Execute command
Command
AT+RST
Response
OK
2.1.4. AT+RESTORE
Function: Restore factory settings.
2.1.4.1. Execute command
Command
AT+RESTORE
Response
OK
2.1.5. AT+CMD?
Function: List all AT commands and types supported in current firmware.
2.1.5.1. Query command
Command
AT+CMD?
Response
+CMD:<index>,<AT command name>,<support test command>,<support Query command>,<support Set command>,<support Execute command> OK
2.1.5.2. Parameters
- <index>: AT command sequence number.
- <AT command name>: AT command name.
- <support test command>: 0 means not supported, 1 means supported.
- <support Query command>: 0 means not supported, 1 means supported.
- <support Set command>: 0 means not supported, 1 means supported.
- <support Execute command>: 0 means not supported, 1 means supported.
2.1.5.3. Example
AT+CMD? +CMD:0,\"AT\",0,0,0,1 +CMD:1,\"AT+RST\",0,0,0,1 +CMD:2,\"AT+GMR\",0,0,0,1 +CMH:3,\"AT+CMD\",0,1,0,0 +CMD:4,\"ATE0\",0,0,0,1 +CMD:5,\"ATE1\",0,0,0,1 +CMD:6,\"AT+RESTORE\",0,0,0,1 +CMD:7,\"AT+SLEEP\",0,1,1,0 OK
2.1.6. ATE
Function: Configure AT Commands Echoing.
2.1.6.1. Execute command
Command
ATE0
or
ATE1
Response
OK
2.1.6.2. Parameters
- ATE0: Switch echo off.
- ATE1: Switch echo on.
2.1.7. AT+SYSRAM?
Function: Query current remaining Heap Size and lwip remaining Heap Size.
2.1.7.1. Query command
Command
AT+SYSRAM?
Response
+SYSRAM:<remaining RAM size>,<lwip heap size> OK
2.1.7.2. Parameters
- <remaining RAM size>: current system remaining heap size. Unit: byte.
- <lwip heap size>: current lwip remaining heap size. Unit: byte.
2.1.7.3. Example
AT+SYSRAM? +SYSRAM:148408,84044 OK
2.1.8. AT+SYSMSG?
Function: Query/Set system prompt information.
2.1.8.1. Query command
Function
Query the current system prompt information state.
Command
AT+SYSMSG?
Response
+SYSMSG:<state> OK
2.1.8.2. Set command
Function
Configure system prompt information.
Command
AT+SYSMSG=<state>
Response
OK
2.1.8.3. Parameter
- <state>:
Bit0: Prompt when quitting Wi-Fi Passthrough Mode.
- 0: Print no prompt when quitting Wi-Fi Passthrough Mode.
- 1: Print
+QUITT
when quitting Wi-Fi Passthrough Mode.
Bit1: Connection prompt information type.
- 0: Use simple prompt information, such as
+CIP:XX,CONNECTED
. - 1: Use detailed prompt information, such as
+LINK_CONN:status_type,link_id,ip_type,terminal_type,remote_ip,remote_port,local_port
.
- 0: Use simple prompt information, such as
Bit2: Connection status prompt for Wi-Fi Passthrough Mode, Bluetooth LE SPP and Bluetooth SPP.
- 0: Print no prompt information.
- 1: Print one of the following prompt information when Wi-Fi, socket, Bluetooth LE or Bluetooth status is changed:
- "+CIP:CONNECTED\r\n" or the message prefixed with "+LINK_CONN:" - "+CIP:DISCONNECTED\r\n" - "+CW:CONNECTING\r\n" - "+CW:CONNECTED\r\n" - "+CW:GOTIP\r\n" - "+CW:ERROR\r\n" - "+CW:DISCONNECTED\r\n" - "+CW:SCAN_DONE\r\n" - the message prefixed with "+CW:STA_CONNECTED" - the message prefixed with "+CW:STA_DISCONNECTED" - the message prefixed with "+CW:DIST_STA_IP" - the message prefixed with "+CW:SCAN_DONE" - the message prefixed with "+BLECONN" - the message prefixed with "+BLEDISCONN"
Note:
- The configuration changes will be saved in the easyflash area if
AT+SYSSTORE=1
. - If you set Bit0 to 1, it will prompt "+QUITT" when you quit Wi-Fi Passthrough Mode.
- If you set Bit1 to 1, it will impact the of command AT+CIPSTART and AT+CIPSERVER. It will supply "+LINK_CONN:status_type,link_id,ip_type,terminal_type,remote_ip,remote_port,local_port" instead of "+CIP:XX,CONNECTED"
2.1.8.4. Example
// print no prompt info when quitting Wi-Fi Passthrough Mode // print detailed connection prompt info // print no prompt info when the connection status is changed AT+SYSMSG=2
2.1.9. AT+SYSLOG?
Function: Enable or disable the AT error code prompt.
2.1.9.1. Query command
Function
Query whether the AT error code prompt is enabled or not.
Command
AT+SYSLOG?
Response
+SYSLOG:<status> OK
2.1.9.2. Set command
Function
Enable or disable the AT error code prompt.
Command
AT+SYSLOG=<status>
Response
OK
2.1.9.3. Parameter
- <status>: enable or disable
- 0: disable
- 1: enable
2.1.9.4. Example
// enable AT error code prompt AT+SYSLOG=1 OK AT+FAKE ERR CODE:0x01090000 ERROR
// disable AT error code prompt AT+SYSLOG=0 OK AT+FAKE // No `ERR CODE:0x01090000` ERROR
- Error Code Format: A 32-bit hexadecimal value structured as:
- Category: bits 32–24 (stationary value 0x01)
- Subcategory: bits 23–16 (error type)
- Extension: bits 15–0
- Error Types:
AT_SUB_OK
:0x00
— OKAT_SUB_COMMON_ERROR
:0x01
— ReservedAT_SUB_NO_TERMINATOR
:0x02
— Terminator character not found (rn expected)AT_SUB_NO_AT
:0x03
— Starting AT not found (or entered as at, At, or aT)AT_SUB_PARA_LENGTH_MISMATCH
:0x04
— Parameter length mismatchAT_SUB_PARA_TYPE_MISMATCH
:0x05
— Parameter type mismatchAT_SUB_PARA_NUM_MISMATCH
:0x06
— Parameter number mismatchAT_SUB_PARA_VALUE_INVALID
:0x07
— Parameter value is out of rangeAT_SUB_PARA_PARSE_FAIL
:0x08
— Failed to parse parameterAT_SUB_UNSUPPORT_CMD
:0x09
— Command not supportedAT_SUB_CMD_EXEC_FAIL
:0x0A
— Command execution failedAT_SUB_CMD_PROCESSING
:0x0B
— Previous command is still processingAT_SUB_CMD_OP_ERROR
:0x0C
— Command operation type errorAT_SUB_NO_MEMORY
:0x0D
— Memory allocation errorAT_SUB_NO_RESOURCE
:0x0E
— Resource allocation errorAT_SUB_TIMEOUT
:0x0F
— Operation timed outAT_SUB_NOT_ALLOWED
:0x10
— Operation not allowedAT_SUB_NOT_INIT
:0x11
— Operation not initializedAT_SUB_IO_ERROR
:0x12
— Device I/O errorAT_SUB_OP_ADDR_ERROR
:0x13
— Operation address errorAT_SUB_HANDLE_INVALID
:0x14
— Invalid handle for operation
2.1.10. AT+SYSSTORE?
Function: Query/Set parameter store mode.
2.1.10.1. Query command
Function
Query the AT parameter store mode.
Command
AT+SYSSTORE?
Response
+SYSSTORE:<store_mode> OK
2.1.10.2. Set command
Command
AT+SYSSTORE=<store_mode>
Response
OK
2.1.10.3. Parameter
- <store_mode>:
- 0: command configuration is not stored into flash.
- 1: command configuration is stored into flash. (Default)
Note:
- This command affects Set commands only. Query commands are always fetched from RAM.
2.1.10.4. Examples
AT+SYSSTORE=0 AT+CWMODE=1 // Not stored into flash AT+CWJAP="test","1234567890" // Not stored into flash AT+SYSSTORE=1 AT+CWMODE=3 // Stored into flash AT+CWJAP="test","1234567890" // Stored into flash
2.1.11. AT+TEMP?
Function: Query the temperature of the chip.
2.1.11.1. Query command
Function
Query the AT parameter store mode.
Command
AT+TEMP?
Response
+TEMP:<temperature> OK
2.1.11.2. Parameter
- <temperature>: The temperature of the chip (Unit:°C).
2.1.12. AT+EFUSE-W
Function: eFuse write operation. The data will be written into the eFuse after the write confirmation operation is performed.
2.1.12.1. Set command
Command
AT+EFUSE-W=<nbytes>,<addr>
Response
OK >
This response indicates that AT is ready for receiving serial data. You should enter the data and when the data length reaches the <nbytes>
value, the transmission of data starts.
If the connection cannot be established or is disrupted during data transmission, the system returns:
ERROR
If the data has been successfully sent to the protocol stack (It does not mean that the data has been sent to the opposite end), the system returns:
SEND OK
2.1.12.2. Parameter
- <nbytes>: The number of bytes to be written needs to be aligned to 4 bytes. Maximum: 8192 bytes.
- <addr>: This is the address of eFuse , it needs to be filled in as a string.
2.1.13. AT+EFUSE-R
Function: eFuse read operation.
2.1.13.1. Set command
Function
Read the content of the eFuse at the specified address.
Command
AT+EFUSE-R=<nbytes>,<addr>,<reload>
Response
+EFUSE-R:<nbytes>,[data] OK
Note:
- Among these parameters, 'nbytes' and 'addr' are mandatory inputs, while others are optional.
- The number of bytes read needs to be aligned to 4 bytes, with a maximum length of 8192 bytes.
2.1.13.2. Example
Command
AT+EFUSE-R=4,"0x1c"
Response
+EFUSE-R:<nbytes>,[data] OK
2.1.13.3. Parameter
- <nbytes>: The number of bytes to be read.
- <addr>: This is the address of eFuse, it needs to be filled in as a string.
- <reload>: The read operation reload from the eFuse address.
- 0: Indicates no reloading, the read data may be from the eFuse backup area.
- 1: Indicates reloading.
2.1.13.4. Example
// read eFuse cmd AT+EFUSE-R=4,"0x1c" // Response +EFUSE-R:1234 OK // write eFuse cmd AT+EFUSE-W=4,"0x1c" // Response OK // write data aaaa // Response SEND OK // read eFuse cmd AT+EFUSE-R=4,"0x1c" // Response +EFUSE-R:4,aaaa OK // read eFuse cmd AT+EFUSE-R=4,"0x1c",1 // Response +EFUSE-R:0000 OK
2.1.14. AT+EFUSE-CFM
Function: eFuse write confirmation operation.
2.1.14.1. Set command
Function
eFuse write confirmation will directly write into eFuse.
Command
AT+EFUSE-CFM
Response
OK
2.1.14.2. Example
// write eFuse cmd AT+EFUSE-W=4,"0x1c" // Response OK // write data aaaa // Response SEND OK // write eFuse confirmation cmd AT+EFUSE-CFM // Response OK // read eFuse cmd AT+EFUSE-R=4,"0x1c" // Response +EFUSE-R:aaaa OK
2.1.15. AT+FLASH-W
Function: Flash write operation.
2.1.15.1. Set command
Command
AT+FLASH-W=<nbytes>,<addr>
Response
OK >
This response indicates that AT is ready for receiving serial data. You should enter the data, and when the data length reaches the <nbytes>
value, the transmission of data starts.
If the connection cannot be established or is disrupted during data transmission, the system returns:
ERROR
If the data has been successfully sent to the protocol stack (It does not mean that the data has been sent to the opposite end), the system returns:
SEND OK
2.1.15.2. Parameter
- <nbytes>: The number of bytes to be written. Maximum: 8192 bytes.
- <addr>: This is the address of Flash, it needs to be filled in as a string.
2.1.16. AT+FLASH-R
Function: Flash read operation.
2.1.16.1. Set command
Function
Read the content of the Flash at the specified address.
Command
AT+FLASH-R=<nbytes>,<addr>
Response
+FLASH-R:[data] OK
2.1.16.2. Example
// flash read cmd AT+FLASH-R=4,"0x210000" // Response +FLASH-R:ffff OK
2.1.16.3. Parameter
- <nbytes>: The number of bytes to be read.
- <addr>: This is the address of Flash, it needs to be filled in as a string.
2.1.17. AT+FLASH-E
Function: Flash erase operation.
2.1.17.1. Set command
Function
Erase the content of the Flash at the specified address.
Command
AT+FLASH-E=<nbytes>,<addr>
Response
OK
2.1.17.2. Example
// flash erase cmd AT+FLASH-E=4096,"0x210000" // Response OK
2.1.17.3. Parameter
- <nbytes>: The number of bytes to be erase.
- <addr>: This is the address of Flash, it needs to be filled in as a string.
2.1.18. AT+IOPUPD
Function: Initialize GPIO pins as pull-up/pull-down mode.
2.1.18.1. Set command
Command
AT+IOPUPD=<pin>,<state>
Response
OK
2.1.18.2. Example
// Initialize GPIO cmd AT+IOPUPD=15,1 //Response OK
2.1.18.3. Parameter
- <pin>: The pin numbers for ST67W611M1.
- <state>: Requires initialization as pull-up, pull-down or float.
- 0: float.
- 1: Pull-up.
- 2: Pull-down.
2.1.19. AT+IOOUT
Function: Set the GPIO output to high/low level.
2.1.19.1. Set command
Command
AT+IOOUT=<pin>,<state>
Response
OK
2.1.19.2. Example
// Set GPIO cmd AT+IOOUT=15,1 //Response OK
2.1.19.3. Parameter
- <pin>: The pin numbers for ST67W611M1.
- <state>: The GPIO output to high/low level.
- 0: low level.
- 1: high level.
2.1.20. AT+IOIN
Function: Query/Set the GPIO input mode.
2.1.20.1. Set command
Command
AT+IOIN=<pin>,<pull_state>
Response
OK
2.1.20.2. Query command
Command
AT+IOIN=<pin>?
Response
+IOIN=<pin>:<state> OK
2.1.20.3. Example
// Set GPIO input cmd AT+IOIN=15 //Response OK // Query GPIO input state AT+IOIN=15? //Response +IOIN=15:1 OK
2.1.20.4. Parameter
- <pin>: The pin numbers for ST67W611M1.
- <state>: Requires initialization as pull-up, pull-down or float.
- 0: float.
- 1: Pull-up.
- 2: Pull-down.
2.1.21. AT+IORST
Function: Restore GPIO to floating input state.
2.1.21.1. Set command
Command
AT+IORST=<pin>
Response
OK
2.1.21.2. Example
// Reset GPIO cmd AT+IORST=15 //Response OK
2.1.21.3. Parameter
- <pin>: The pin numbers for ST67W611M1.
2.1.22. AT+PART
Function: Get information about the partitions.
2.1.22.1. Query command
Command
AT+PART?
Response
+PART:<active_idx>,<age>,<"name">,<addr0>,<addr1>,<len0>,<len1> +PART:<active_idx>,<age>,<"name">,<addr0>,<addr1>,<len0>,<len1> ... OK
2.1.22.2. Example
// Reset GPIO cmd AT+PART? //Response +PART=0,0," Boot2",0x00000000,0x00000000,57344,0 +PART=0,0," FW",0x00010000,0x00210000,2097152,1474560 +PART=0,0," mfg",0x00210000,0x00000000,1474560,0 +PART=0,0," media",0x00378000,0x00000000,462848,0 +PART=0,0," PSM",0x003e9000,0x00000000,32768,0 OK
2.1.22.3. Parameter
<active_idx>:
- 0: The current active partition index is 0.
- 1: The current active partition index is 1.
<age>: The number of updates for this partition. For example, when the "FW" partition is updated via OTA, the age will increase with each OTA update.
<name>: The partition name.
<addr0>: The address of partition index 0.
<addr1>: The address of partition index 1.
<len0>: The length of partition index 0.
<len1>: The length of partition index 1.
2.1.23. AT+OTASTART
Function: Start OTA transmission.
2.1.23.1. Set command
Command
AT+OTASTART=<enable>
2.1.23.2. Parameter
<enable>:
- 0: Terminate OTA transmission.
- 1: Start OTA transmission.
Response
ERROR
or
OK
2.1.24. AT+OTASEND
Send OTA data. This command will write the data to the OTA partition in real time and perform validation.
2.1.24.1. Set command
Command
AT+OTASEND=<length>
Response
OK >
The symbol > indicates that AT is ready for receiving serial data, and you can enter the data now. When the requirement of message length determined by the parameter <length> is met, the transmission starts.
If the transmission is successful, AT returns:
SEND OK
Otherwise, it returns:
SEND FAIL
2.1.24.2. Parameters
- <length>: OTA data length. The maximum length is equal to the system allocable heap size.
2.1.25. AT+OTAFIN
Function: Verify and reboot from another partition.
2.1.25.1. Set command
Command
AT+OTAFIN
Response
If the OTA has already written to the corresponding partition and verified the integrity successfully, and is about to reboot, return:
OK
If the reboot fails, return:
ERROR
2.1.26. AT+FS
Function: Filesystem operations.
2.1.26.1. Set command
Command
AT+FS=<type>,<operation>,<filename>[,<offset>][,<length>]
Response
OK
2.1.26.2. Parameters
<type>: only LittleFS is currently supported.
- 0: LittleFS
<operation>:
- 0: delete file.
- 1: create file.
- 2: write file.
- 3: read file.
- 4: query the size of the file.
- 5: list files in a specific directory. Only root directory is currently supported.
<filename>: the file name that needs to be operated on.
<offset>: apply to writing and reading operations only.
<length>: data length, applying to writing and reading operations only.
2.1.26.3. Example
// Query the list of files in the current directory '.' AT+FS=0,5,"." // Response +FS:LIST . .. ca_1.crt ca_1.key ca_2.crt ca_2.key client_1.crt client_1.key client_2.crt client_2.key server_1.crt server_1.key server_2.crt server_2.key OK
2.1.27. AT+GMAC
Function: Query the MAC addresses of 3 slots in eFuse.
2.1.27.1. Query command
Command
AT+GMAC?
Response
+GMACSLOT0:<mac_addr> +GMACSLOT1:<mac_addr> +GMACSLOT2:<mac_addr> OK
2.1.27.2. Parameters
- <mac_addr>: MAC address in eFuse.
2.1.27.3. Example
// Query the MAC addresses of 3 slots in eFuse. AT+GMAC? // Response +GMACSLOT0:9c:b7:93:0c:c1:26 +GMACSLOT1:00:00:00:00:00:00 +GMACSLOT2:00:b7:00:00:00:00 OK
2.1.28. AT+PN
Function: Query the part number.
2.1.28.1. Query command
Command
AT+PN?
Response
+PN:<pn_num> OK
2.1.28.2. Parameters
- <pn_num>: The part number in eFuse.
2.1.28.3. Example
AT+PN? // Response +PN:CP90-79196-2 OK
2.1.29. AT+VBAT
Function: Query the voltage value at the supply pin.
2.1.29.1. Query command
Command
AT+VBAT?
Response
+VBAT:<vbat_val> OK
2.1.29.2. Parameters
- <vbat_val>: The voltage value at the supply pin (unit: mV).
2.1.29.3. Example
AT+VBAT? // Response +VBAT:3326 OK
2.1.30. AT+MINIDUMP
Function: Dump minidump partition by hex, run 'xxd -r -p hex.output crash.bin', refer examples/crash/README_v1.md to use crash.bin
2.1.30.1. Query command
Command
AT+MINIDUMP
Response
hex dump ...... OK
2.1.30.2. Parameters
- None
2.1.30.3. Example
AT+MINIDUMP // Response hex dump ...... OK
2.1.31. AT+EFUSE-W-HEX
Function: Write data to eFuse in hexadecimal format. The input data is a hex string, which is converted to binary and written to the specified address. Data is word-aligned (4 bytes), and confirmation (AT+EFUSE-CFM) is required after writing.
2.1.31.1. Setup command
Command
AT+EFUSE-W-HEX=<nbytes>,"<address>" // Followed by sending the hex string data (length = nbytes * 2)
Response
OK Recv <X> hex chars SEND OK
2.1.31.2. Parameters
- <nbytes>: Number of bytes to write (1 to 8192).
- <address>: Starting address in hexadecimal format (for example, "0x1c").
2.1.31.3. Example
AT+EFUSE-W-HEX=10,"0x2c" // Send hex string: 01020304050607080910 // Response OK Recv 20 hex chars SEND OK
2.1.32. AT+EFUSE-R-HEX
Function: Read data from eFuse in hexadecimal format. The output is the hex string representation of the read binary data.
2.1.32.1. Setup command
Command
AT+EFUSE-R-HEX=<nbytes>,"<address>"
Response
+EFUSE-R-HEX:<nbytes>,<hex data> OK
2.1.32.2. Parameters
- <nbytes>: Number of bytes to read (1 to 8192).
- <address>: Starting address in hexadecimal format (for example, "0x1c").
2.1.32.3. Example
AT+EFUSE-R-HEX=10,"0x2c" // Response +EFUSE-R-HEX:10,01020304050607080910 OK
2.1.33. AT+FLASH-W-HEX
Function: Write data to flash in hexadecimal format. The input data is a hex string, which is converted to binary and written to the specified address.
2.1.33.1. Setup command
Command
AT+FLASH-W-HEX=<nbytes>,"<address>" // Followed by sending the hex string data (length = nbytes * 2)
Response
OK Recv <X> hex chars SEND OK
2.1.33.2. Parameters
- <nbytes>: Number of bytes to write (1 to 8192).
- <address>: Starting address in hexadecimal format (for example, "0x210000").
2.1.33.3. Example
AT+FLASH-W-HEX=10,"0x210000" // Send hex string: 01020304050607080910 // Response OK Recv 20 hex chars SEND OK
2.1.34. AT+FLASH-R-HEX
Function: Read data from flash in hexadecimal format. The output is the hex string representation of the read binary data.
2.1.34.1. Setup command
Command
AT+FLASH-R-HEX=<nbytes>,"<address>"
Response
+FLASH-R-HEX:<nbytes>,<hex data> OK
2.1.34.2. Parameters
- <nbytes>: Number of bytes to read (1 to 8192).
- <address>: Starting address in hexadecimal format (for example, "0x210000").
2.1.34.3. Example
AT+FLASH-R-HEX=10,"0x210000" // Response +FLASH-R-HEX:10,01020304050607080910 OK
3. Wi-Fi AT commands
Instruction | Description |
---|---|
AT+WIFISP | Query/Set enable/disable WLAN radio |
AT+CWMODE | Set Wi-Fi mode |
AT+CWNETMODE | Query device to work in NCP/RCP mode. |
AT+CWSTATE | Query the Wi-Fi state and Wi-Fi information |
AT+CWJAP | Connect to AP |
AT+CWRECONNCFG | Query/Set the Wi-Fi reconnecting configuration |
AT+CWLAPOPT | Set AT+CWLAP command scan result attributes |
AT+CWLAP | Scan nearby AP |
AT+CWQAP | Disconnect AP |
AT+CWSAP | Query/Set the configuration of a SoftAP |
AT+CWLIF | Obtain IP address of the station that connects to a SoftAP |
AT+CWQIF | Disconnect stations from a SoftAP |
AT+CWDHCP | Enable/disable DHCP |
AT+CWDHCPS | Query/Set the IP addresses allocated by a SoftAP DHCP server |
AT+CWAUTOCONN | Set up automatic reconnection |
AT+CIPSTAMAC | Query/Set the MAC address of an station |
AT+CIPAPMAC | Query/Set the MAC address of a SoftAP |
AT+CIPSTA | Query/Set the IP address of an station |
AT+CIPAP | Query/Set the IP address of a SoftAP |
AT+CWHOSTNAME | Query/Set the host name of an station |
AT+CWCOUNTRY | Query/Set the Wi-Fi Country Code |
AT+CWMONITOR | Set Wi-Fi to enter monitor mode |
AT+CWSTAPROTO | Query/Set the 802.11 b/g/n/ax Protocol Standard of Station Mode |
AT+CWAPPROTO | Query/Set the 802.11 b/g/n/ax Protocol Standard of SoftAP Mode |
AT+WPS | Enable the WPS function. |
AT+CWANTENABLE | Enable/Disable Antenna Diversity Function. |
AT+CWANTNUM | Get the maximum number of antennas for the current device. |
AT+CWANT | Set/Query the currently used antenna. |
3.1. Wi-Fi AT commands
3.1.1. AT+WIFISP
Function: Query/Set enable/disable WLAN radio.
3.1.1.1. Query command
Function
Query the WLAN radio enablement status.
Command
AT+WIFISP?
Response
+WIFISP:<enable> OK
3.1.1.2. Set command
Function
Enable/disable WLAN radio.
Command
AT+WIFISP=<enable>
Response
OK
3.1.1.3. Parameters
- <enable>:
- 0: Disable WLAN radio.
- 1: Enable WLAN radio.
3.1.2. AT+CWMODE
Function: Query/set Wi-Fi mode.
3.1.2.1. Query command
Function
Query the Wi-Fi mode of devices.
Command
AT+CWMODE?
Response
+CWMODE:<mode> OK
3.1.2.2. Set command
Function
Set the Wi-Fi mode of devices.
Command
AT+CWMODE=<mode>[,<auto_connect>]
Response
OK
3.1.2.3. Parameters
- <mode>:
- 0: Null mode. Wi-Fi RF will be disabled.
- 1: Station mode.
- 2: SoftAP mode.
- 3: SoftAP+Station mode.
- <auto_connect>: Enable or disable automatic connection to an AP when you change the mode of the device from the SoftAP mode or null mode to the station mode. Default: 1. If you omit the parameter, the default value will be used, i.e. automatically connecting to an AP.
- 0: The device will not automatically connect to an AP.
- 1: The device will automatically connect to an AP if the configuration to connect to the AP has already been saved in flash before.
Note:
- The configuration changes will be saved in the easyflash area if AT+SYSSTORE=1.
- SoftAP+Station mode requires AP and STA to be on the same channel
3.1.2.4. Example
AT+CWMODE=1
3.1.3. AT+CWNETMODE
Function: Query device working in NCP/RCP mode.
3.1.3.1. Query command
Function
Query whether the device is operating in NCP/RCP mode.
Command
AT+CWNETMODE?
Response
+CWNETMODE:<netmode> OK
3.1.3.2. Parameters
- <netmode>:
- 0: RCP mode.
- 1: NCP mode.
Note:
- When the device is in LWIP on host mode, all network, HTTP, and MQTT-related AT commands become invalid.
3.1.4. AT+CWSTATE
Function: Query the Wi-Fi state and Wi-Fi information.
3.1.4.1. Query command
Function
Query the Wi-Fi state and Wi-Fi information of devices.
Command
AT+CWSTATE?
Response
+CWSTATE:<state>,<"ssid"> OK
3.1.4.2. Parameters
- <state>: current Wi-Fi state.
- 0: station has not started any Wi-Fi connection.
- 1: station has connected to an AP, but does not get an IPv4 address yet.
- 2: station has connected to an AP, and got an IPv4 address.
- 3: station is in Wi-Fi connecting or reconnecting state.
- 4: station is in Wi-Fi disconnected state.
- <"ssid">: the SSID of the target AP.
Note:
- When station is not connected to an AP, it is recommended to use this command to query Wi-Fi information; after station is connected to an AP, it is recommended to use AT+CWJAP to query Wi-Fi information.
3.1.5. AT+CWJAP
Function: Connect to an AP.
3.1.5.1. Query command
Function
Query the AP to which the Station is already connected.
Command
AT+CWJAP?
Response
+CWJAP:<ssid>,<bssid>,<channel>,<rssi>,<wep_en> OK
3.1.5.2. Set command
Function
Connect an station to a targeted AP.
Command
AT+CWJAP=[<ssid>],[<pwd>][,<bssid>][,<wep_en>]
Note:
- Among these parameters, 'ssid' and 'pwd' are mandatory inputs, while others are optional
Response
+CW:CONNECTED +CW:GOTIP OK
or
+CW:CONNECTING OK +CW:ERROR,<reason_code>
or
+CWJAP:<error code> ERROR
3.1.5.3. Execute command
Function
Connect an station to a targeted AP with last Wi-Fi configuration.
Command
AT+CWJAP
Response
+CW:CONNECTED +CW:GOTIP OK
or
+CWJAP:<error code> ERROR
3.1.5.4. Parameters
- <ssid>: the SSID of the target AP.
- Escape character syntax is needed if SSID or password contains special characters, such
,
,"
, or\\
.
- Escape character syntax is needed if SSID or password contains special characters, such
- <pwd>: password, MAX: 64-byte ASCII.
- <bssid>: the MAC address of the target AP. It cannot be omitted when multiple APs have the same SSID.
- <channel>: channel.
- <rssi>: signal strength.
- <wep_en>: Is the connected AP using WEP encryption?
- 0: Not WEP encryption.
- 1: It's WEP encryption.
- <error code>: (for reference only)
- 1: connection timeout.
- 2: wrong password.
- 3: cannot find the target AP.
- 4: connection failed.
- others: unknown error occurred.
- <reason_code>:
- 1: Failure to allocate memory for transmitting an authentication frame.
- 2: Authentication process failed.
- 3: The authentication algorithm was not accepted or failed.
- 4: Failure to allocate memory for transmitting an association frame.
- 5: Association process with the access point failed.
- 6: Deauthentication by the access point occurred when not connected.
- 7: Deauthentication by the access point occurred while connected.
- 8: A timeout occurred during the 4-way handshake, likely due to PSK (Pre-Shared Key) issues.
- 9: Failed to transmit a deauthentication frame during the 4-way handshake.
- 10: Failed to allocate memory for a deauthentication frame during the 4-way handshake.
- 11: Timeout waiting for authentication or association response.
- 12: No BSSID or channel found during the scan process.
- 13: Failed to create a channel context when attempting to join a network.
- 14: Failure to join a network.
- 15: Failed to add a station (STA) to the network.
- 16: Beacon loss occurred, potentially leading to disconnection.
- 17: The network security settings do not match.
- 18: An error occurred due to an incorrect WEP key length.
- 19: User-initiated disconnection with deauthentication.
- 20: User-initiated disconnection without sending a deauthentication frame.
- 21: Disconnection occurred because the firmware failed to send a power-save null frame.
- 22: Traffic loss was detected.
- 23: Switching to a new channel failed.
- 24: Confirmation of authentication or association response failed.
- 25: Reassociation process is starting.
Note:
- The configuration changes will be saved in the easyflash area if AT+SYSSTORE=1.
- This command requires Station mode to be enabled.
- The parameter
<reconn_interval>
of this command is the same as<interval_second>
of the command AT + CWRECONNCFG . Therefore, if you omit<reconn_interval>
when running this command, the interval between Wi-Fi reconnections will use the default value 1. - If the
<ssid>
and<password>
parameter are omitted, AT will use the last configuration. - Execute command has the same maximum timeout to Setup command. The default value is 15 seconds, but you can change it by setting the parameter
<jap_timeout>
.
3.1.5.5. Example
// If the target AP's SSID is "abc" and the password is "0123456789", the command should be: AT+CWJAP="abc","0123456789" // If the target AP's SSID is "ab\,c" and the password is "0123456789"\", the command should be: AT+CWJAP="ab\\\,c","0123456789\"\\" // If multiple APs all have the SSID of "abc", the target AP can be found by BSSID: AT+CWJAP="abc","0123456789","ca:d7:19:d8:a6:44" // If at is required that connect to a AP by protected management frame, the command should be: AT+CWJAP="abc","0123456789",,,,,,,3
3.1.6. AT+CWRECONNCFG
Function: Query/Set the Wi-Fi reconnecting configuration.
3.1.6.1. Query command
Function
Query the configuration of Wi-Fi reconnect.
Command
AT+CWRECONNCFG?
Response
+CWRECONNCFG:<interval_second>,<repeat_count> OK
3.1.6.2. Set command
Function
Set the configuration of Wi-Fi reconnect.
Command
AT+CWRECONNCFG=<interval_second>,<repeat_count>
Response
OK
3.1.6.3. Parameters
- <interval_second>: the interval between Wi-Fi reconnections. Unit: second. Default: 0. Maximum: 7200.
- 0: The station will not reconnect to the AP when disconnected.
- [1,7200]: The station will reconnect to the AP at the specified interval when disconnected.
- <repeat_count>: the number of attempts the device makes to reconnect to the AP. This parameter only works when the parameter
<interval_second>
is not 0. Default: 0. Maximum: 1000.- 0: The station will always try to reconnect to AP.
- [1,1000]: The station will attempt to reconnect to AP for the specified times.
3.1.6.4. Example
// The station tries to reconnect to AP at the interval of one second for 100 times. AT+CWRECONNCFG=1,100 // The station will not reconnect to AP when disconnected. AT+CWRECONNCFG=0,0
- The parameter
<interval_second>
of this command is the same as the parameter[<reconn_interval>]
of the command AT+CWJAP. - This command works for passive disconnection from APs, Wi-Fi mode switch, and Wi-Fi auto connect after power on.
3.1.7. AT+CWLAPOPT
Function: Set the configuration for the command AT+CWLAP.
3.1.7.1. Set command
Command
AT+CWLAPOPT=<sort_enable>,<print mask>[,<rssi filter>][,<authmode mask>][,<max_count>]
Response
OK
or
ERROR
3.1.7.2. Parameters
- <sort_enable>: Enable/Disable sorting scan results by RSSI (default sorting).
- <print mask>: determine whether the following parameters are shown in the result of AT+CWLAP. Default: 0x7FF. If you set them to 1, it means showing the corresponding parameters; if you set them as 0, it means NOT showing the corresponding parameters.
- bit 0: determine whether <ecn> will be shown.
- bit 1: determine whether <ssid> will be shown.
- bit 2: determine whether <rssi> will be shown.
- bit 3: determine whether <mac> will be shown.
- bit 4: determine whether <channel> will be shown.
- bit 5: determine whether <freq_offset> will be shown.
- bit 6: determine whether <freqcal_val> will be shown.
- bit 7: determine whether <pairwise_cipher> will be shown.
- bit 8: determine whether <group_cipher> will be shown.
- bit 9: determine whether <bgn> will be shown.
- bit 10: determine whether <wps> will be shown.
- [<rssi filter>]: determine whether the result of the command AT+CWLAP will be filtered according to
rssi filter
. In other words, the result of the command will NOT show the APs whose signal strength is belowrssi filter
. Unit: dBm. Default: –100. Range: [–100,40]. - [<authmode mask>]: determine whether APs with the following authmodes are shown in the result of AT+CWLAP. Default: 0xFFFF. If you set
bit x
to 1, the APs with the corresponding authmode will be shown. If you setbit x
to 0, the APs with the corresponding authmode will NOT be shown;- bit 0: determine whether APs with
OPEN
authmode will be shown. - bit 1: determine whether APs with
WEP
authmode will be shown. - bit 2: determine whether APs with
WPA_PSK
authmode will be shown. - bit 3: determine whether APs with
WPA2_PSK
authmode will be shown. - bit 4: determine whether APs with
WPA_WPA2_PSK
authmode will be shown. - bit 5: determine whether APs with
WPA2_ENTERPRISE
authmode will be shown. - bit 6: determine whether APs with
WPA3_PSK
authmode will be shown. - bit 7: determine whether AP with
WPA2_WPA3_PSK
authmode will be shown.
- bit 0: determine whether APs with
- [<max_count>]: The maximum number of Wi-Fi networks scanned is 50 by default, meaning the CWLAP command response can include up to 50 scanned results. Range: (0,50].
3.1.7.3. Example
// The first parameter is 1, meaning that the result of the command AT+CWLAP will be ordered according to RSSI; // The second parameter is 31, namely 0x1F, meaning that the corresponding bits of <print mask> are set to 1. All parameters will be shown in the result of AT+CWLAP. AT+CWLAPOPT=1,31 AT+CWLAP // Just show the AP which authmode is OPEN AT+CWLAPOPT=1,31,-100,1 AT+CWLAP
3.1.8. AT+CWLAP
Function: List available APs.
3.1.8.1. Set command
Function
Query the APs with specified parameters, such as the SSID, MAC address, or channel.
Command
AT+CWLAP=[<scan_type>,<ssid>,<mac>,<channel>,<scan_time_min>,<scan_time_max>]
3.1.8.2. Execute command
Function
List all available APs.
Command
AT+CWLAP
Response
+CWLAP:<ecn>,<ssid>,<rssi>,<mac>,<channel>,<freq_offset>,<freqcal_val>,<pairwise_cipher>,<group_cipher>,<bgn>,<wps> OK
3.1.8.3. Parameters
- <ecn>: encryption method.
- 0: OPEN
- 1: WEP
- 2: WPA_PSK
- 3: WPA2_PSK
- 4: WPA_WPA2_PSK
- 5: WPAx_ENTERPRISE
- 6: WPA3_PSK
- 7: WPA2_WPA3_PSK
- <scan_type>: Wi-Fi scan type:
- 0: active scan
- 1: passive scan
- <ssid>: string parameter showing SSID of the AP.
- <rssi>: signal strength.
- <mac>: string parameter showing MAC address of the AP.
- <channel>: channel.
- <scan_time_min>: the minimum active scan time per channel. Unit: millisecond. Range [0,1500]. If the scan type is passive, this parameter is invalid.
- <scan_time_max>: the maximum active scan time per channel. Unit: millisecond. Range [0,1500]. If this parameter is 0, the firmware will use the default time: 120 ms for active scan; 360 ms for passive scan.
- <freq_offset>: frequency offset (reserved item).
- <freqcal_val>: frequency calibration value (reserved item).
- <pairwise_cipher>: pairwise cipher type.
- 0: None
- 1: WEP40
- 2: WEP104
- 3: TKIP
- 4: CCMP
- 5: TKIP and CCMP
- 6: AES-CMAC-128
- 7: Unknown
- <group_cipher>: group cipher type, same enumerated value to
<pairwise_cipher>
. - <bgn>: 802.11 b/g/n. If the corresponding bit is 1, the corresponding mode is enabled; if the corresponding bit is 0, the corresponding mode is disabled.
- bit 0: bit to identify if 802.11b mode is enabled or not
- bit 1: bit to identify if 802.11g mode is enabled or not
- bit 2: bit to identify if 802.11n mode is enabled or not
- bit 3: bit to identify if 802.11ax mode is enabled or not
- <wps>: wps flag.
- 0: WPS disabled
- 1: WPS enabled
3.1.8.4. Example
AT+CWLAP=0,"Wi-Fi","ca:d7:19:d8:a6:44",6,0,400,1000 // Search for APs with a designated SSID: AT+CWLAP=0,"Wi-Fi"
3.1.9. AT+CWQAP
Function: Disconnect from an AP.
3.1.9.1. Execute command
Command
AT+CWQAP=[<restore>]
Response
OK
Command
AT+CWQAP
Response
OK
3.1.9.2. Parameters
- Optional <restore>: flag to erase the saved SSID and password information.
- 0: Do not erase the saved SSID and password information (default).
- 1: Erase the saved SSID and password information.
3.1.10. AT+CWSAP
Function: Query/Set the configuration of a SoftAP.
3.1.10.1. Query command
Function
Query the configuration parameters of a SoftAP.
Command
AT+CWSAP?
Response
+CWSAP:<ssid>,<pwd>,<channel>,<ecn>,<max conn>,<ssid hidden> OK
3.1.10.2. Set command
Function
Set the configuration of a SoftAP.
Command
AT+CWSAP=<ssid>,<pwd>,<chl>,<ecn>[,<max conn>][,<ssid hidden>]
Response
OK
3.1.10.3. Parameters
- <ssid>: string parameter showing SSID of the AP.
- <pwd>: string parameter showing the password. Length: 8 ~ 64 bytes ASCII.
- <channel>: channel ID.
- <ecn>: encryption method; WEP is not supported.
- 0: OPEN
- 2: WPA_PSK
- 3: WPA2_PSK
- 4: WPA3_PSK
- [<max conn>]: maximum number of stations that SoftAP can connect. Range: [1,4].
- [<ssid hidden>]:
- 0: broadcasting SSID (default).
- 1: not broadcasting SSID.
Note
- This command works only when AT+CWMODE=2 or AT+CWMODE=3.
- The configuration changes will be saved in the easyflash area if AT+SYSSTORE=1.
3.1.11. AT+CWLIF
Function: Obtain IP address of the station that connects to a SoftAP.
3.1.11.1. Execute command
Command
AT+CWLIF
Response
+CWLIF:<ip addr>,<mac> OK
3.1.11.2. Parameters
- <ip addr>: IP address of the station that connects to the SoftAP.
- <mac>: MAC address of the station that connects to the SoftAP.
3.1.11.3. Note
- This command cannot get a static IP. It works only when DHCP of both the SoftAP and the connected station are enabled.
3.1.12. AT+CWQIF
Function: Disconnect stations from a SoftAP.
3.1.12.1. Execute command
Function
Disconnect all stations that are connected to the SoftAP.
Command
AT+CWQIF
Response
OK
3.1.12.2. Set command
Function
Disconnect a specific station from the SoftAP.
Command
AT+CWQIF=<mac>
3.1.12.3. Example
AT+CWQIF="18:b9:05:ed:59:cc"
Response
OK
3.1.12.4. Parameter
- <mac>: MAC address of the station to disconnect.
3.1.13. AT+CWDHCP
Function: Enable/Disable DHCP.
3.1.13.1. Query command
Command
AT+CWDHCP?
Response
<state>
3.1.13.2. Set command
Function
Enable/disable DHCP.
Command
AT+CWDHCP=<operate>,<mode>
Response
OK
3.1.13.3. Parameters
- <operate>:
- 0: disable
- 1: enable
- <mode>:
- Bit0: Station DHCP
- Bit1: SoftAP DHCP
- <state>: the status of DHCP
- Bit0:
- 0: Station DHCP is disabled.
- 1: Station DHCP is enabled.
- Bit1:
- 0: SoftAP DHCP is disabled.
- 1: SoftAP DHCP is enabled.
- Bit0:
Notes:
- The configuration changes will be saved in the easyflash area if AT+SYSSTORE=1.
- This Set command correlates with the commands that set static IP, such as AT+CIPSTA and AT+CIPAP:
- If DHCP is enabled, static IP address will be disabled;
- If static IP address is enabled, DHCP will be disabled;
- The last configuration overwrites the previous configuration.
3.1.13.4. Example
// Enable Station DHCP. If the last DHCP mode is 2, the current DHCP mode will be 3. AT+CWDHCP=1,1 // Disable SoftAP DHCP. If the last DHCP mode is 3, the current DHCP mode will be 1. AT+CWDHCP=0,2
3.1.14. AT+CWDHCPS
Function:Query/Set the IP addresses allocated by a SoftAP DHCP server.
3.1.14.1. Query command
Command
AT+CWDHCPS?
Response
+CWDHCPS=<lease time>,<start IP>,<end IP> OK
3.1.14.2. Set command
Function
Set the IP address range of the SoftAP DHCP server.
Command
AT+CWDHCPS=<enable>,<lease time>,<start IP>,<end IP>
Response
OK
3.1.14.3. Parameters
- <enable>:
- 1: Enable DHCP server settings. The parameters below have to be set.
- 0: Disable DHCP server settings and use the default IP address range.
- <lease time>: lease time. Unit: minute. Range [1,2880].
- <start IP>: start IP address of the IP address range that can be obtained from SoftAP DHCP server.
- <end IP>: end IP address of the IP address range that can be obtained from SoftAP DHCP server.
Notes:
- The configuration changes will be saved in the easyflash area if AT+SYSSTORE=1.
- This AT command works only when both SoftAP and DHCP server are enabled for devices.
- The IP address should be in the same network segment as the IP address of SoftAP.
3.1.14.4. Example
AT+CWDHCPS=1,3,"192.168.4.10","192.168.4.15" AT+CWDHCPS=0 // Disable the settings and use the default IP address range.
3.1.15. AT+CWAUTOCONN
Function: Automatically connect to an AP when powered on
3.1.15.1. Set command
Command
AT+CWAUTOCONN=<enable>
Response
OK
3.1.15.2. Parameters
- <enable>:
- 1: Enable automatic connection to an AP when powered on. (Default)
- 0: Disable automatic connection to an AP when powered on.
3.1.15.3. Note
- The configuration changes will be saved in the easyflash area.
3.1.15.4. Example
AT+CWAUTOCONN=1
3.1.16. AT+CIPSTAMAC
Function: Query/Set the MAC address of a ST67W611M1 station
3.1.16.1. Query command
Function
Query the MAC address of the Station.
Command
AT+CIPSTAMAC?
Response
+CIPSTAMAC:<mac> OK
3.1.16.2. Set command
Function
Set the MAC address of an station.
Command
AT+CIPSTAMAC=<mac>
Response
OK
3.1.16.3. Parameters
- <mac>: string parameter showing MAC address of an station.
Notes:
- The configuration changes will be saved in the easyflash area if AT+SYSSTORE=1.
- The MAC address of SoftAP is the same as Station, and when Station MAC is set, SoftAP's MAC will also be automatically updated.
- Bit 0 of the MAC address CANNOT be 1. For example, a MAC address can be "1a:…" but not "15:…".
- FF:FF:FF:FF:FF:FF and 00:00:00:00:00:00 are invalid MAC address and cannot be set.
3.1.16.4. Example
AT+CIPSTAMAC="1a:fe:35:98:d3:7b"
3.1.17. AT+CIPAPMAC
Function: Query/Set the MAC address of a SoftAP
3.1.17.1. Query command
Function
Query the MAC address of the SoftAP.
Command
AT+CIPAPMAC?
Response
+CIPAPMAC:<mac> OK
3.1.17.2. Set command
Function
Set the MAC address of the SoftAP.
Command
AT+CIPAPMAC=<mac>
Response
OK
3.1.17.3. Parameters
- <mac>: string parameter showing MAC address of the SoftAP.
Notes:
- The configuration changes will be saved in the easyflash area if AT+SYSSTORE=1.
- The MAC address of SoftAP is the same as Station, and when SoftAP MAC is set, Station's MAC will also be automatically updated.
- Bit 0 of the MAC address CANNOT be 1. For example, a MAC address can be "18:…" but not "15:…".
- FF:FF:FF:FF:FF:FF and 00:00:00:00:00:00 are invalid MAC and cannot be set.
3.1.17.4. Example
AT+CIPAPMAC="18:fe:35:98:d3:7b"
3.1.18. AT+CIPSTA
Function: Query/Set the IP address of a station
3.1.18.1. Query command
Function
Query the IP address of the station.
Command
AT+CIPSTA?
Response
+CIPSTA:ip:<"ip"> +CIPSTA:gateway:<"gateway"> +CIPSTA:netmask:<"netmask"> +CIPSTA:ip6ll:<"ipv6 addr"> +CIPSTA:ip6gl:<"ipv6 addr"> OK
3.1.18.2. Set command
Function
Set the IPv4 address of the station.
Command
AT+CIPSTA=<"ip">[,<"gateway">,<"netmask">,<"dns">]
Response
OK
3.1.18.3. Parameters
- <"ip">: string parameter showing the IPv4 address of the station.
- <"gateway">: gateway.
- <"netmask">: netmask.
- <”ipv6 addr”>: string parameter showing the IPv6 address of the ST67W611M1 station.
Notes:
- For the Query command, only when the station is connected to an AP or the static IP address is configured can its IP address be queried.
- The configuration changes will be saved in the easyflash area if AT+SYSSTORE=1.
- The Set command correlates with the commands that set DHCP, such as AT+CWDHCP.
- If static IP address is enabled, DHCP will be disabled;
- If DHCP is enabled, static IP address will be disabled;
- The last configuration overwrites the previous configuration.
3.1.18.4. Example
AT+CIPSTA="192.168.6.100","192.168.6.1","255.255.255.0"
3.1.19. AT+CIPAP
Function: Query/Set the IP address of a SoftAP
3.1.19.1. Query command
Function
Query the IP address of the SoftAP.
Command
AT+CIPAP?
Response
+CIPAP:ip:<"ip"> +CIPAP:gateway:<"gateway"> +CIPAP:netmask:<"netmask"> OK
3.1.19.2. Set command
Function
Set the IPv4 address of the SoftAP.
Command
AT+CIPAP=<"ip">[,<"gateway">,<"netmask">]
Response
OK
3.1.19.3. Parameters
- <"ip">: string parameter showing the IPv4 address of the SoftAP.
- <"gateway">: gateway.
- <"netmask">: netmask.
Notes:
- The configuration changes will be saved in the easyflash area if AT+SYSSTORE=1.
- The Set command correlates with the commands that set DHCP, such as AT+CWDHCP.
- If static IP address is enabled, DHCP will be disabled;
- If DHCP is enabled, static IP address will be disabled;
- The last configuration overwrites the previous configuration.
3.1.19.4. Example
AT+CIPAP="192.168.5.1","192.168.5.1","255.255.255.0"
3.1.20. AT+CWHOSTNAME
Function: Query/Set the host name of an station
3.1.20.1. Query command
Function
Query the host name of station.
Command
AT+CWHOSTNAME?
Response
+CWHOSTNAME:<hostname> OK
3.1.20.2. Set command
Function
Set the host name of station.
Command
AT+CWHOSTNAME=<hostname>
Response
OK
If the Station mode is not enabled, the command will return:
ERROR
3.1.20.3. Parameters
- <hostname>: the host name of the station. Maximum length: 32 bytes.
3.1.20.4. Note
- The configuration changes are not saved in the flash.
3.1.20.5. Example
AT+CWMODE=3 AT+CWHOSTNAME="my_test"
3.1.21. AT+CWCOUNTRY
Function: Query/Set the Wi-Fi country code
3.1.21.1. Query command
Function
Query Wi-Fi country code information.
Command
AT+CWCOUNTRY?
Response
+CWCOUNTRY:<country_policy>,<country_code> OK
3.1.21.2. Set command
Function
Set the Wi-Fi country code information.
Command
AT+ CWCOUNTRY=<country_policy>,<country_code>
Response
OK
3.1.21.3. Parameters
- <country_policy>:
- 0: will change the county code to be the same as the AP that the device is connected to.
- 1: the country code will not change, always be the one set by command.
- <country_code>: country code. Maximum length: 3 characters.
3.1.21.4. Note
- The configuration changes are not saved in the flash.
3.1.21.5. Example
AT+CWMODE=3 AT+CWCOUNTRY=1,"CN"
3.1.22. AT+CWMONITOR
Function: Set Wi-Fi to enter monitor mode
3.1.22.1. Set command
Function
Set Wi-Fi to enter monitor mode.
Command
AT+CWMONITOR=<enable>,<channel>,[<min_pkg_len>],[<max_pkg_len>]
Response
OK +CWMONITOR,<channel>,<pkg_len>:<data> ...
3.1.22.2. Parameters
- <enable>:
- 0: Stop the monitor mode.
- 1: Set Wi-Fi to enter monitor mode.
- <channel>: Channels that need to be monitored.
- <min_pkg_len>: Filter and receive packets with the minimum length.
- <max_pkg_len>: Filter and receive packets with the maximum length.
- <pkg_len>: Received packet length.
- <data>: Received raw data packet, displayed in hexadecimal format.
3.1.22.3. Note
- The monitored channel needs to be within the channel range set by the AT+CWCOUNTRY.
3.1.22.4. Example
AT+CWMONITOR=1,6 OK +CWMONITOR,6,177:xxxxxxxxxxxxxx ...
3.1.23. AT+CWSTAPROTO
Function: Query/Set the 802.11 b/g/n/ax protocol standard of station mode
3.1.23.1. Query command
Function
Query the 802.11 b/g/n/ax protocol standard of station mode.
Command
AT+CWSTAPROTO?
Response
+CWSTAPROTO:<protocol> OK
3.1.23.2. Set command
Function
Set the 802.11 b/g/n/ax protocol standard of station mode.
Command
AT+CWSTAPROTO=<protocol>
Response
OK
3.1.23.3. Parameters
- <enable>:
- bit0: 802.11b protocol standard.
- bit1: 802.11g protocol standard.
- bit2: 802.11n protocol standard.
- bit3: 802.11ax protocol standard.
3.1.23.4. Note
- It will only take effect on the next connection.
- By default, PHY mode of ST67W611M1 is 802.11bgn/ax mode.
3.1.23.5. Example
AT+CWSTAPROTO=1 OK AT+CWMODE=1 OK AT+CWJAP="SSID","12345678" ...
3.1.24. AT+CWAPPROTO
Query/Set the 802.11 b/g/n/ax protocol standard of softAP mode
3.1.24.1. Query command
Function
Query the 802.11 b/g/n/ax protocol standard of softAP mode.
Command
AT+CWAPPROTO?
Response
+CWAPPROTO:<protocol> OK
3.1.24.2. Set command
Function
Set the 802.11 b/g/n/ax protocol standard of softAP mode.
Command
AT+CWAPPROTO=<protocol>
Response
OK
3.1.24.3. Parameters
- <enable>:
- bit0: 802.11b protocol standard.
- bit1: 802.11g protocol standard.
- bit2: 802.11n protocol standard.
- bit3: 802.11ax protocol standard.
3.1.24.4. Note
- It will only take effect on the next connection.
- By default, PHY mode of ST67W611M1 is 802.11bgn/ax mode.
3.1.24.5. Example
AT+CWAPPROTO=1 OK AT+CWMODE=2 OK AT+CWSAP="AP_SSID","12345678",1,3,10,0 ...
3.1.25. AT+WPS
Enable the WPS function
3.1.25.1. Set command
Function
Enable the WPS function.
Command
AT+WPS=<enable>[,<auth floor>]
Response
OK
3.1.25.2. Parameters
- <enable>:
- 1: Enable WPS (Wi-Fi Protected Setup) that uses PBC (Push Button Configuration) mode.
- 0: Disable WPS that uses PBC mode.
- <auth floor>:
- 0: Auth open(Default).
- 1: Auth WEP.
- 2: Auth WPA PSK.
- 3: Auth WPA2 PSK.
- 4: Auth WPA/WPA2 PSK.
Notes:
- WPS can only be used when the ST67W611M1 station is enabled.
- WPS does not support WEP (Wired-Equivalent Privacy) encryption.
3.1.25.3. Example
AT+CWMODE=1 OK AT+WPS=1 OK ...
3.1.26. AT+CWANTENABLE
Enable/Disable Antenna Diversity Function.
3.1.26.1. Query command
Function
Query whether the antenna diversity function is enabled.
Command
AT+CWANTENABLE?
Response
+CWANTENABLE:<dynamic_enable>,<static_enable>,<pin> OK
3.1.26.2. Set command
Function
Enable Antenna Diversity Function.
Command
AT+CWANTENABLE=<dynamic_enable>,<static_enable>[,<pin>]
Response
OK
3.1.26.3. Parameters
- <dynamic_enable>:
- 1: Enable Dynamic Antenna Diversity Function.
- 0: Disable Dynamic Antenna Diversity Function.
- <static_enable>:
- 1: Enable Static Antenna Diversity Function.
- 0: Disable Static Antenna Diversity Function.
- <pin>: Pin Number.
3.1.26.4. Example
AT+CWANTENABLE=1,1,0 OK AT+RST OK AT+CWMODE=1 OK AT+CWJAP="SSID","password" OK ...
3.1.26.5. Note
- This parameter takes effect after a restart.
3.1.27. AT+CWANTNUM
Get the maximum number of antennas for the current device.
3.1.27.1. Query command
Function
Get the maximum number of antennas for the current device.
Command
AT+CWANTNUM?
Response
+CWANTNUM:<numbers> OK
3.1.28. AT+CWANT
Set/Query the currently used antenna.
3.1.28.1. Query command
Function
Query the currently used antenna.
Command
AT+CWANT?
Response
+CWANT:<ant_id> OK
3.1.28.2. Set command
Function
Enable Automatic Antenna Diversity Function.
Command
AT+CWANT=<ant_id>
Response
OK
3.1.28.3. Parameters
- <ant_id>:
- Antenna Number ID.
3.1.28.4. Example
AT+CWANT=1 OK AT+CWANT=0 OK
4. TCP/IP AT commands
Instruction | Description |
---|---|
AT+CIPV6 | Enable/disable the network of Internet Protocol Version 6 (IPv6) |
AT+CIFSR | Obtain the local IP address and MAC address |
AT+CIPDOMAIN | Resolve a Domain Name |
AT+CIPDNS | Query/Set DNS Server Information |
AT+CIPSTATE | Obtain the TCP/UDP/SSL connection information |
AT+CIPRECVBUF | Query/Set the TCP/UDP/SSL receive buffer size |
AT+CIPSTART | Establish TCP connection, UDP transmission, or SSL connection |
AT+CIPSTARTEX | Establish TCP connection, UDP transmission, or SSL connection with an automatically assigned ID |
AT+CIPTCPOPT | Query/Set the socket options |
AT+CIPCLOSE | Close TCP/UDP/SSL connection |
AT+CIPSEND | Send data in the normal transmission mode or Wi-Fi Passthrough Mode |
AT+CIPSENDL | Send long data in parallel in the normal transmission mode |
AT+CIPSENDLCFG | Set the configuration for the command AT+CIPSENDL |
AT+CIPSENDEX | Send data in the normal transmission mode in expanded ways |
AT+CIPDINFO | Set "+IPD" message mode |
AT+CIPMUX | Enable/disable the multiple connections mode |
AT+CIPSERVER | Delete/create a TCP/SSL server |
AT+CIPSERVERMAXCONN | Query/Set the maximum connections allowed by a server |
AT+CIPSTO | Query/Set the local TCP Server Timeout |
AT+SAVETRANSLINK | Set whether to enter Wi-Fi Passthrough Mode on power-up |
AT+CIPSNTPCFG | Query/Set the time zone and SNTP server |
AT+CIPSNTPTIME | Query the SNTP time |
AT+CIPSNTPINTV | Query/Set the SNTP time synchronization interval |
AT+CIPRECONNINTV | Query/Set the TCP/UDP/SSL reconnection interval for the Wi-Fi Passthrough Mode |
AT+CIPRECVMODE | Query/Set socket receiving mode |
AT+CIPRECVDATA | Obtain socket data in passive receiving mode |
AT+CIPRECVLEN | Obtain socket data length in passive receiving mode |
AT+PING | Ping the remote host |
AT+CIPEVT | Turn on or off the event message notification prefixed with +CIP. |
AT+CWEVT | Turn on or off the event message notification prefixed with +CW. |
AT+CIPSSLCCONF | Query/Set SSL Clients. |
AT+CIPSSLCSNI | Query/Set SSL Client Server Name. |
AT+CIPSSLCALPN | Query/Set SSL Client Application Layer Protocol Negotiation (ALPN). |
AT+CIPSSLCPSK | Query/Set SSL Client Pre-shared Key (PSK) in string format. |
AT+CIPSSLCPSKHEX | Query/Set SSL Client Pre-shared Key (PSK) in hexadecimal format. |
AT+IPERF | Test throughput of the ST67W611M1 in standalone mode. |
AT+IPERFSTOP | Stop test throughput of the ST67W611M1. |
4.1. TCP/IP AT commands
4.1.1. AT+CIPV6
Function: Enable/disable the network of Internet Protocol Version 6 (IPv6).
4.1.1.1. Query command
Function
Query whether IPv6 is enabled.
Command
AT+CIPV6?
Response
+CIPV6:<enable> OK
4.1.1.2. Set command
Function
Enable/Disable IPv6 network.
Command
AT+CIPV6=<enable>
Response
OK
4.1.1.3. Parameters
<enable>: status of IPv6 network. Default: 0.
- 0: disable IPv6 network.
- 1: enable IPv6 network.
4.1.2. AT+CIFSR
Function: Obtain the Local IP address and MAC address.
4.1.2.1. Execute command
Command
AT+CIFSR
Response
// AP mode // AT+CWMODE=2 +CIFSR:APIP,<"APIP"> +CIFSR:APIP6LL,<"APIP6LL"> +CIFSR:APMAC,<"APMAC"> // STA mode // AT+CWMODE=1 +CIFSR:STAIP,<"STAIP"> +CIFSR:STAIP6LL,<"STAIP6LL"> +CIFSR:STAIP6GL,<"STAIP6GL"> +CIFSR:STAMAC,<"STAMAC"> OK
4.1.2.2. Parameters
- <"APIP">: IPv4 address of Wi-Fi softAP interface
- <”APIP6GL”>: Global IPv6 address of Wi-Fi softAP interface
- <"APMAC">: MAC address of Wi-Fi softAP interface
- <"STAIP">: IPv4 address of Wi-Fi station interface
- <”STAIP6LL”>: Linklocal IPv6 address of Wi-Fi station interface
- <”STAIP6GL”>: Global IPv6 address of Wi-Fi station interface
- <"STAMAC">: MAC address of Wi-Fi station interface
4.1.3. AT+CIPDOMAIN
Function: Resolve a domain name.
4.1.3.1. Set command
Command
AT+CIPDOMAIN=<"domain name">[,<ip network>]
Response
+CIPDOMAIN:<"IP address"> OK
4.1.3.2. Parameter
- <"domain name">: the domain name.
- <ip network>: preferred IP network. Default: 1.
- 1: preferred resolution of IPv4 address
- 2: resolve IPv4 address only
- 3: resolve IPv6 address only
- <"IP address">: the resolved IPv4 address or IPv6 address.
4.1.3.3. Example
AT+CWMODE=1 // set the station mode AT+CWJAP="SSID","password" // access to the internet AT+CIPDOMAIN="www.google.com" // Domain Name Resolution function // Domain Name Resolution Function for IPv4 address only AT+CIPDOMAIN="www.google.com",2 // Domain Name Resolution Function for IPv6 address only AT+CIPDOMAIN="www.google.com",3
4.1.4. AT+CIPDNS
Function: Set/Query the current DNS server information.
4.1.4.1. Query command
Function
Query the current DNS server information.
Command
AT+CIPDNS?
Response
+CIPDNS:<enable>[,<"DNS IP1">][,<"DNS IP2">][,<"DNS IP3">] OK
4.1.4.2. Set command
Function
Set DNS server information.
Command
AT+CIPDNS=<enable>[,<"DNS IP1">][,<"DNS IP2">][,<"DNS IP3">]
Response
OK
or
ERROR
4.1.4.3. Parameter
- <enable>: the domain name.
- 0: Enable automatic DNS server settings from DHCP. The DNS will be restored to 208.67.222.222 and 8.8.8.8.
- Only when the ST67W611M1 station completes the DHCP process, the DNS server of the ST67W611M1 station could be updated.
- 1: Enable manual DNS server settings. If you do not set a value for <DNS IPx>, it will use 208.67.222.222 and 8.8.8.8 by default.
- 0: Enable automatic DNS server settings from DHCP. The DNS will be restored to 208.67.222.222 and 8.8.8.8.
- <”DNS IP1”>: the first DNS server IP address. For the Set command, this parameter only works when you set <enable> to 1, i.e. enable manual DNS settings. If you set <enable> to 1 and a value for this parameter, the ST67W611M1-AT will return this parameter as the current DNS setting when you run the Query command.
- <”DNS IP2”>: the second DNS server IP address. For the Set command, this parameter only works when you set <enable> to 1, i.e. enable manual DNS settings. If you set <enable> to 1 and a value for this parameter, the ST67W611M1-AT will return this parameter as the current DNS setting when you run the Query command.
- <”DNS IP3”>: the third DNS server IP address. For the Set command, this parameter only works when you set <enable> to 1, i.e. enable manual DNS settings. If you set <enable> to 1 and a value for this parameter, the ST67W611M1-AT will return this parameter as the current DNS setting when you run the Query command.
Notes:
- The configuration changes will be saved in the NVS area if AT+SYSSTORE=1.
- The three parameters cannot be set to the same server.
- When <enable> is set to 1, the DNS server may change according to the configuration of the router which the ST67W611M1 is connected to.
4.1.4.4. Example
AT+CIPDNS=0 AT+CIPDNS=1,"114.114.114.114"
4.1.5. AT+CIPSTATE
Function: Obtain the TCP/UDP/SSL Connection Information.
4.1.5.1. Query command
Command
AT+CIPSTATE?
Response
When there is a connection, AT returns:
+CIPSTATE:<link ID>,<"type">,<"remote IP">,<remote port>,<local port>,<tetype> OK
When there is no connection, AT returns:
OK
4.1.5.2. Parameters
- <link ID>: ID of the connection (0~4), used for multiple connections.
- <"type">: string parameter showing the type of transmission: "TCP", "TCPv6", "UDP", "UDPv6", "SSL", or "SSLv6".
- <"remote IP">: string parameter showing the remote IPv4 address.
- <remote port>: the remote port number.
- <local port>: the local port number.
- <tetype>:
- 0: ST67W611M1 runs as a client.
- 1: ST67W611M1 runs as a server.
4.1.6. AT+CIPRECVBUF
Function: Query/Set the TCP/UDP/SSL receive buffer size.
4.1.6.1. Set command
Command
// Single connection (AT+CIPMUX=0): AT+CIPRECVBUF=<size> // Multiple connection (AT+CIPMUX=1): AT+CIPRECVBUF=<linkid>,<size>
Response
This command needs to be used when there is no connection with this ID; otherwise, it will return an ERROR.
+CIPRECVBUF OK
4.1.6.2. Parameters
- <linkid>: ID of the connection (0~4), used for multiple connections.
- <size>: Set the size of the buffer, unit bytes.
4.1.6.3. Query command
Command
// Single connection (AT+CIPMUX=0): AT+CIPRECVBUF? // Multiple connection (AT+CIPMUX=1): AT+CIPRECVBUF=<linkid>?
Response
Returns the buffer size for the specified link ID. The default buffer size is 2920 bytes.
+CIPRECVBUF:<size> OK
4.1.7. AT+CIPSTART
Function: Establish TCP connection, UDP transmission, or SSL connection.
4.1.7.1. Establish TCP connection
4.1.7.1.1. Set command
Command
// Single connection (AT+CIPMUX=0): AT+CIPSTART=<"type">,<"remote host">,<remote port>[,<keep_alive>][,<"local IP">][,<timeout>] // Multiple Connections (AT+CIPMUX=1): AT+CIPSTART=<link ID>,<"type">,<"remote host">,<remote port>[,<keep_alive>][,<"local IP">][,<timeout>]
Response
For single connection, it returns:
+CIP:CONNECTED OK
For multiple connections, it returns:
+CIP:<link ID>,CONNECTED OK
4.1.7.1.2. Parameters
- <link ID>: ID of network connection (0~4), used for multiple connections.
- <"type">: string parameter showing the type of transmission: "TCP","TCPv6","UDP","UDPv6","SSL","SSLv6". Default: "TCP".
- <"remote host">: IPv4/IPv6 address, or domain name of remote host. The maximum length is 64 bytes. If you need to use a domain name and the length of the domain name exceeds 64 bytes, use the AT+CIPDOMAIN command to obtain the IP address corresponding to the domain name, and then use the IP address to establish a connection.
- <remote port>: the remote port number.
- <keep_alive>: It configures the SO_KEEPALIVE option for socket. Unit: second.
- Range: [0,7200].
- 0: disable keep-alive function (default).
- 1 ~ 7200: enable keep-alive function. TCP_KEEPIDLE value is <keep_alive>, TCP_KEEPINTVL value is 1, and TCP_KEEPCNT value is 3.
- This parameter of this command is the same as the
<keep_alive>
parameter of AT+CIPTCPOPT command. It always takes the value set later by either of the two commands. If it is omitted or not set, the last configured value is used by default.
- Range: [0,7200].
- <"local IP">: the local IPv4 address or IPv6 address that the connection binds. This parameter is useful when you are using multiple network interfaces or multiple IP addresses. By default, it is disabled. If you want to use it, you should specify it first. Null is also valid.
- <timeout>: Command timeout. Unit: milliseconds. Default value: 10000. Range: [0,20000]. When set to 0, the command timeout depends on the network and lwIP protocol stack; when set to a non-zero value, the command will return within the specified timeout.
Notes:
- To establish a TCP connection based on an IPv6 network, do as follows:
- Make sure that the AP supports IPv6
- Set AT+CIPV6=1
- Obtain an IPv6 address through the AT+CWJAP command
- (Optional) Check whether ST67W611M1 has obtained an IPv6 address using the AT+CIPSTA? command
4.1.7.1.3. Example
AT+CIPSTART="TCP","192.168.101.110",1000 AT+CIPSTART="TCP","192.168.101.110",2500,60 AT+CIPSTART="TCP","192.168.101.110",1000,,"192.168.101.100" AT+CIPSTART="TCPv6","test-ipv6.com",80 AT+CIPSTART="TCPv6","fe80::860d:8eff:fe9d:cd90",1000,,"fe80::411c:1fdb:22a6:4d24"
4.1.7.1.4. Query command
Command
AT+CIPSTART?
Response
For single connection, it returns:
+CIPSTART:<link ID>,<"type">,<"ip">,<remote_port>,<local_port>,<tetype> OK
4.1.7.2. Parameters
- <link ID>: ID of the connection (0~4), used for multiple connections.
- <"type">: string parameter showing the type of transmission: "TCP", "TCPv6", "UDP", "UDPv6", "SSL", or "SSLv6".
- <"remote IP">: string parameter showing the remote IPv4 address.
- <remote port>: the remote port number.
- <local port>: the local port number.
- <tetype>:
- 0: ST67W611M1 runs as a client.
- 1: ST67W611M1 runs as a server.
4.1.8. AT+CIPSTARTEX
Function: Establish TCP connection, UDP transmission, or SSL connection with an Automatically Assigned ID.
This command is similar to AT+CIPSTART except that you do not need to assign an ID by yourself in multiple connections mode (AT+CIPMUX=1). The system will assign an ID to the new connection automatically.
4.1.9. [Data Mode Only] +++ : Exit from Data Mode
4.1.9.1. Special Execute command
Function
Exit from Data Mode and enter the Command Mode.
Command
// Only for data mode +++
Notes:
- This special execution command consists of three identical
+
characters (0x2b ASCII), and no CR-LF appends to the command tail. - Make sure there is more than 20 ms interval before the first
+
character, more than 20 ms interval after the third+
character, less than 20 ms interval among the three+
characters. Otherwise, the+
characters will be sent out as normal data. - This command returns no reply.
- Please wait for at least one second before sending the next AT command.
4.1.10. AT+CIPTCPOPT
Function: Query/Set the socket options.
4.1.10.1. Query command
Function
Query current socket options.
Command
AT+CIPTCPOPT?
Response
+CIPTCPOPT:<link_id>,<so_linger>,<tcp_nodelay>,<so_sndtimeo>,<keepalive> OK
4.1.10.2. Set command
Command
// Single TCP connection (AT+CIPMUX=0): AT+CIPTCPOPT=[<so_linger>],[<tcp_nodelay>],[<so_sndtimeo>],[<keepalive>] // Multiple TCP Connections (AT+CIPMUX=1): AT+CIPTCPOPT=<link ID>,[<so_linger>],[<tcp_nodelay>],[<so_sndtimeo>],[<keepalive>]
Response
OK
or
ERROR
4.1.10.3. Parameters
- <link_id>: ID of the connection (0 ~ max). For multiple connections, if the value is max, it means all connections. By default, max is 5.
- <so_linger>: configure the
SO_LINGER
options for the socket (refer to SO_LINGER description). Unit: second. Default: -1.- = -1: off
- = 0: on, linger time = 0
- > 0: on, linger time = <so_linger>
- <tcp_nodelay>: configure the
TCP_NODELAY
option for the socket (refer to TCP_NODELAY description). Default: 0.- 0: disable TCP_NODELAY
- 1: enable TCP_NODELAY
- <so_sndtimeo>: configure the
SO_SNDTIMEO
option for socket (refer to SO_SNDTIMEO description). Unit: millisecond. Default: 0. - <keepalive>: It configures the SO_KEEPALIVE option for socket. Unit: second.
- Range: [0,7200].
- 0: disable keep-alive function (default).
- 1 ~ 7200: enable keep-alive function. TCP_KEEPIDLE value is <keepalive>, TCP_KEEPINTVL value is 1, and TCP_KEEPCNT value is 3.
- This parameter of this command is the same as the
<keepalive>
parameter of AT+CIPTCPOPT command. It always takes the value set later by either of the two commands. If it is omitted or not set, the last configured value is used by default. Setting a low keepalive value in low-power mode will result in increased power consumption.
- Range: [0,7200].
Notes:
- Before configuring these socket options, make sure you fully understand the function of them and the possible impact after configuration.
- The SO_LINGER option is not recommended to be set to a large value. For example, if you set SO_LINGER value to 60, then AT+CIPCLOSE command will block for 60 seconds if ST67W611M1 cannot receive TCP FIN packet from the remote TCP peer due to network issues, so ST67W611M1 is unable to respond to any other AT commands. Therefore, it is recommended to keep the default value of the SO_LINGER option.
- The TCP_NODELAY option is used for situations with small throughput but high real-time requirements. If this option is enabled, LwIP will speed up TCP transmission, but in a poor network environment, the throughput will be reduced due to retransmission. Therefore, it is recommended to keep the default value of the TCP_NODELAY option.
- The SO_SNDTIMEO option is used for situations where the keepalive parameter is not configured in AT+CIPSTART command. After this option is configured, AT+CIPSEND , AT+CIPSENDL , and AT+CIPSENDEX commands will exit within this timeout, regardless of whether data are sent successfully or not. Here, SO_SNDTIMEO is recommended to be set to 5 ~ 10 seconds.
- The SO_KEEPALIVE option is used for actively and regularly detecting whether the connection is disconnected. It is generally recommended to configure this option when AT is used as a TCP server. After this option is configured, additional network bandwidth will be cost. Recommended value of SO_KEEPALIVE should be not less than 60 seconds. Setting a low keepalive value in low-power mode will result in increased power consumption.
4.1.11. AT+CIPCLOSE
Function: Close TCP/UDP/SSL connection.
4.1.11.1. Set command
Function
Close TCP/UDP/SSL connection in the multiple connections mode.
Command
AT+CIPCLOSE=<link ID>
Response
<link ID>,CLOSED OK
4.1.11.2. Execute command
Function
Close TCP/UDP/SSL connection in the single connection mode.
AT+CIPCLOSE
Response
CLOSED OK
4.1.11.3. Parameter
- <link ID>: ID of the connection that you want to close. If you set it to 5, all connections will be closed.
4.1.12. AT+CIPSEND
Function: Send data in the normal transmission mode or Wi-Fi Passthrough Mode
4.1.12.1. Set command
Function
Set the data length to be send in the normal transmission mode. If the length of data you need to send exceeds 8192 bytes, please use the AT+CIPSENDL command.
Command
// Single connection: (AT+CIPMUX=0) AT+CIPSEND=<length> // Multiple connections: (AT+CIPMUX=1) AT+CIPSEND=<link ID>,<length> // Remote host and port can be set for UDP transmission: AT+CIPSEND=[<link ID>,]<length>[,<"remote host">,<remote port>]
Response
OK >
This response indicates that AT is ready for receiving serial data. You should enter the data, and when the data length reaches the <length>
value, the transmission of data starts.
If the connection cannot be established or is disrupted during data transmission, the system returns:
ERROR
If the data has been successfully sent to the protocol stack (It does not mean that the data has been sent to the opposite end), the system returns:
SEND OK
4.1.12.2. Execute command
Function
Enter the Wi-Fi Passthrough Mode.
Command
AT+CIPSEND
Response
OK >
or
ERROR
Enter the Wi-Fi Passthrough Mode. The ST67W611M1 can receive 8192 bytes and send 2920 bytes at most each time. If the data received by ST67W611M1 reaches or exceeds 2920 bytes, the data will be immediately sent in chunks of 2920 bytes. Otherwise, it will wait for 20 milliseconds before being sent (You can configure this interval using AT+TRANSINTVL command). When a single packet containing +++ is received, the ST67W611M1 will exit the data sending mode under the Wi-Fi Passthrough Mode. Please wait for at least one second before sending the next AT command.
This command can only be used for single connection in the Wi-Fi Passthrough Mode. For UDP Wi-Fi passthrough, the <mode>
parameter has to be 0 when using AT+CIPSTART.
4.1.12.3. Parameters
- <link ID>: ID of the connection (0~4), for multiple connections.
- <length>: data length. Maximum: 8192 bytes.
- <"remote host">: IPv4 address, or domain name of remote host. It can be set in UDP transmission.
- <remote port>: the remote port number.
Notes:
- You can use AT+CIPTCPOPT command to configure socket options for each TCP connection. For example, setting <so_sndtimeo> to 5000 will enable TCP send operation to return results within 5 seconds, regardless of success or failure. This can save the time that the MCU waits for AT command response.
4.1.13. AT+CIPSENDL
Function: Send long data in parallel in the Normal Transmission Mode.
4.1.13.1. Set command
Function
In the Normal Transmission Mode, set the data length to be sent, and then send data to remote host in parallel (the AT command port receives data in parallel with the AT sending data to the remote host). You can use the AT+CIPSENDLCFG command to configure this command. If the length of data you need to send is less than 8192 bytes, you also can use the AT+CIPSEND command.
Command
// Single connection: (AT+CIPMUX=0) AT+CIPSENDL=<length> // Multiple connections: (AT+CIPMUX=1) AT+CIPSENDL=<link ID>,<length> // Remote host and port can be set for UDP transmission: AT+CIPSENDL=[<link ID>,]<length>[,<"remote host">,<remote port>]
Response
OK >
This response indicates that AT enters the Data Mode and AT command port is ready to receive data. You can enter the data now. Once the port receives data, it will be pushed to underlying protocol stack and the transmission starts.
If the transmission starts, the system reports message according to AT+CIPSENDLCFG configuration:
+CIPSENDL:<had sent len>,<port recv len>
If the transmission is cancelled by +++ command, the system returns:
SEND CANCELLED
If not all the data has been sent out, the system finally returns:
SEND FAIL
If the data has been successfully sent to the protocol stack (It does not mean that the data has been sent to the opposite end), the system finally returns:
SEND OK
When the connection is disconnected, you can send +++ command to cancel the transmission, then the ST67W611M1 will exit from the Data Mode, otherwise, the Data Mode will not end until the AT command port receives all the data of the specified <length>
.
4.1.13.2. Parameters
- <link ID>: ID of the connection (0~4), for multiple connections.
- <length>: data length. Maximum: 2 31 - 1 bytes.
- <"remote host">: IPv4 address, or domain name of remote host. It can be set in UDP transmission.
- <remote port>: the remote port number.
- <had sent len>: the length of data successfully sent to the underlying protocol stack.
- <port recv len>: data length received by AT command port.
Notes:
- It is recommended to use UART flow control, because if the UART receives data at a faster rate than the network sends, data loss may occur.
- You can use AT+CIPTCPOPT command to configure socket options for each TCP connection. For example, setting <so_sndtimeo> to 5000 will enable TCP send operation to return results within 5 seconds, regardless of success or failure. This can save the time that the MCU waits for AT command response.
4.1.14. AT+CIPSENDLCFG
Function: Set the configuration for the command AT+CIPSENDL.
4.1.14.1. Query command
Function
Query the configuration of AT+CIPSENDL
Command
AT+CIPSENDLCFG?
Response
+CIPSENDLCFG:<report size>,<transmit size> OK
4.1.14.2. Set command
Function
Set the configuration of AT+CIPSENDL.
Command
AT+CIPSENDLCFG=<report size>[,<transmit size>]
Response
OK
4.1.14.3. Parameters
- <report size>: report block size for AT+CIPSENDL. Default: 1024. Range: [100,2 20]. For example, set
<report size>
to 100,<had sent len>
report sequence in the response of AT+CIPSENDL will be (100, 200, 300, 400, ...). The final<had sent len>
report is always equal to the data length that had been sent out. - <transmit size>: transmit block size of AT+CIPSENDL. It specifies the size of the data block sent to the underlying protocol stack. Default: 2920. Range: [100,2920]. If the data received by ST67W611M1 reaches or exceeds
<transmit size>
bytes, the data will be immediately sent in chunks of<transmit size>
bytes. Otherwise, it will wait for 20 milliseconds before being sent (You can configure this interval using AT+TRANSINTVL command).
4.1.14.3.1. Note
- For devices with small throughput but high real-time requirements, it is recommended to set a smaller
<transmit size>
. It is also recommended to setTCP_NODELAY
by AT+CIPTCPOPT command. - For devices with large throughput, it is recommended to set a larger
<transmit size>
.
4.1.15. AT+CIPSENDEX
Function: Send data in the Normal Transmission Mode in expanded Ways.
4.1.15.1. Set command
Function
Set the data length to be send in Normal Transmission Mode, or use \0
(0x5c, 0x30 ASCII) to trigger data transmission.
Command
// Single connection: (AT+CIPMUX=0) AT+CIPSENDEX=<length> // Multiple connections: (AT+CIPMUX=1) AT+CIPSENDEX=<link ID>,<length> // Remote host and port can be set for UDP transmission: AT+CIPSENDEX=[<link ID>,]<length>[,<"remote host">,<remote port>]
Response
OK >
This response indicates that AT is ready for receiving data. You should enter the data of designated length. When the data length reaches the <length>
value, or when the string \0
appears in the data, the transmission starts.
If the connection cannot be established or gets disconnected during transmission, the system returns:
ERROR
If the data has been successfully sent to the protocol stack (It does not mean that the data has been sent to the opposite end), the system returns:
Recv <length> bytes SEND OK
4.1.15.2. Parameters
- <link ID>: ID of the connection (0~4), for multiple connections.
- <length>: data length. Maximum: 8192 bytes.
- <"remote host">: IPv4 address, or domain name of remote host. It can be set in UDP transmission.
- <remote port>: remote port can be set in UDP transmission.
Notes:
- When the requirement of data length is met, or when the string
\0
(0x5c, 0x30 in ASCII) appears, the transmission of data starts. Go back to the normal command mode and wait for the next AT command. - If the data contains the
\<any>
, it means that drop backslash symbol and only use<any>
character. - When sending
\0
, please use a backslash to escape it as\\0
. - You can use AT+CIPTCPOPT command to configure socket options for each TCP connection. For example, setting <so_sndtimeo> to 5000 will enable TCP send operation to return results within 5 seconds, regardless of success or failure. This can save the time that the MCU waits for AT command response.
4.1.16. AT+CIPDINFO
Function: Set "+IPD" Message Mode.
4.1.16.1. Query command
Command
AT+CIPDINFO?
Response
+CIPDINFO:true OK
or
+CIPDINFO:false OK
4.1.16.2. Set command
Command
AT+CIPDINFO=<mode>
Response
OK
4.1.16.3. Parameters
- <mode>:
- 0: does not show the remote host and port in "+IPD" messages.
- 1: show the remote host and port in "+IPD" messages.
4.1.16.4. Example
AT+CIPDINFO=1
4.1.17. AT+CIPMUX
Function: Enable/disable multiple connections.
4.1.17.1. Query command
Function
Query the connection type.
Command
AT+CIPMUX?
Response
+CIPMUX:<mode> OK
4.1.17.2. Set command
Function
Set the connection type.
Command
AT+CIPMUX=<mode>
Response
OK
4.1.17.3. Parameter
- <mode>: connection mode. Default: 0.
- 0: single connection.
- 1: multiple connections.
Notes:
- This mode can only be changed after all connections are disconnected.
- If you want to set the single connection mode when the TCP/SSL server is running, you should delete the server first. (AT+CIPSERVER=0).
4.1.17.4. Example
AT+CIPMUX=1
4.1.18. AT+CIPSERVER
Function: Delete/create a TCP/SSL Server.
4.1.18.1. Query command
Function
Query the TCP/SSL server status.
Command
AT+CIPSERVER?
Response
+CIPSERVER:<mode>[,<port>,<"type">][,<CA enable>][,<keepalive>] OK
4.1.18.2. Set command
Command
AT+CIPSERVER=<mode>[,<param2>][,<"type">][,<CA enable>][,<keepalive>]
Response
OK
4.1.18.3. Parameters
- <mode>:
- 0: delete a server.
- 1: create a server.
- <param2>: It means differently depending on the parameter
<mode>
:
* If
<mode>
is 1,<param2>
represents the port number. Default: 333.
- If
<mode>
is 0,<param2>
represents whether the server closes all connections. Default: 0.
- 0: shutdown the server and keep existing connections.
- 1: shutdown the server and close all connections.
- <"type">: server type: "TCP", "TCPv6", "SSL", or "SSLv6". Default: "TCP".
- <CA enable>:
- 0: disable CA.
- 1: enable CA.
- <keepalive>: It configures the SO_KEEPALIVE option for socket. Unit: second.
- Range: [0,7200].
- 0: disable keep-alive function (default).
- 1 ~ 7200: enable keep-alive function. TCP_KEEPIDLE value is <keepalive>, TCP_KEEPINTVL value is 1, and TCP_KEEPCNT value is 3.
- This parameter of this command is the same as the
<keepalive>
parameter of AT+CIPTCPOPT command. It always takes the value set later by either of the two commands. If it is omitted or not set, the last configured value is used by default. Setting a low keepalive value in low-power mode will result in increased power consumption.
- Range: [0,7200].
Notes:
- A TCP/SSL server can only be created when multiple connections are activated (AT+CIPMUX=1).
- A server monitor will be created automatically when the server is created. Only one server can be created at most.
- When a client is connected to the server, it will take up one connection and be assigned an ID.
- Parameters
<\"type\">
and<CA enable>
must be omitted when delete a server.
4.1.18.4. Example
// To create a TCP server AT+CIPMUX=1 AT+CIPSERVER=1,80 // To create an SSL server AT+CIPMUX=1 AT+CIPSERVER=1,443,"SSL",1 // To delete an server and close all clients AT+CIPSERVER=0,1
4.1.19. AT+CIPSERVERMAXCONN
Function: Query/Set the maximum connections allowed by a Server.
4.1.19.1. Query command
Function
Obtain the maximum number of clients allowed to connect to the TCP/SSL server.
Command
AT+CIPSERVERMAXCONN?
Response
+CIPSERVERMAXCONN:<num> OK
4.1.19.2. Set command
Function
Set the maximum number of clients allowed to connect to the TCP/SSL server.
Command
AT+CIPSERVERMAXCONN=<num>
Response
OK
4.1.19.3. Parameter
- <num>: the maximum number of clients allowed to connect to the TCP/SSL server. Range: [1,5]. For how to change the upper limit of this range, please refer to the description of the
<link ID>
parameter of the AT+CIPSTART command.
4.1.19.4. Note
- You should call the command
AT+CIPSERVERMAXCONN=<num>
before creating a server.
4.1.19.5. Example
AT+CIPMUX=1 AT+CIPSERVERMAXCONN=2 AT+CIPSERVER=1,80
4.1.20. AT+CIPSTO
Function: Query/Set the local TCP/SSL Server timeout.
4.1.20.1. Query command
Function
Query the local TCP/SSL server timeout.
Command
AT+CIPSTO?
Response
+CIPSTO:<time> OK
4.1.20.2. Set command
Function
Set the local TCP/SSL server timeout.
Command
AT+CIPSTO=<time>
Response
OK
4.1.20.3. Parameter
- <time>: local TCP/SSL server timeout. Unit: second. Range: [0,7200].
Notes:
- When a TCP/SSL client does not communicate with the ST67W611M1 server within the
<time>
value, the server will terminate this connection. - If you set
<time>
to 0, the connection will never timeout. This configuration is not recommended. - When the client initiates a communication with the server or the server initiate a communication with the client within the set time, the timer will restart. After the timeout expires, the client is closed.
- Setting this parameter while in low-power mode will lead to increased power draw.
4.1.20.4. Example
AT+CIPMUX=1 AT+CIPSERVER=1,1001 AT+CIPSTO=10
4.1.21. AT+SAVETRANSLINK
Function: Set whether to enter Wi-Fi Passthrough Mode on power-up.
4.1.21.1. For TCP/SSL Single Connection
4.1.21.1.1. Set command
Command
AT+SAVETRANSLINK=<mode>,<"remote host">,<remote port>[,<"type">,<keep alive>]
Response
OK
4.1.21.1.2. Parameters
- <mode>:
- 0: ST67W611M1 will NOT enter Wi-Fi Passthrough Mode on power-up.
- 1: ST67W611M1 will enter Wi-Fi Passthrough Mode on power-up.
- <"remote host">: string parameter showing the IPv4 address or domain name of remote host.
- <remote port>: the remote port number.
- <"type">: string parameter showing the type of transmission: "TCP", "TCPv6", "SSL", or "SSLv6". Default: "TCP".
- <keep alive>: TCP keep-alive interval. Default: 0.
- 0: disable the keep-alive function.
- 1 ~ 7200: detection interval. Unit: second.
Notes:
- This command will save the Wi-Fi Passthrough Mode configuration in the easyflash area. If
<mode>
is set to 1, ST67W611M1 device will enter the Wi-Fi Passthrough Mode in any subsequent power cycles. The configuration will take effect after ST67W611M1 reboots. - As long as the remote host and port are valid, the configuration will be saved in flash.
4.1.21.1.3. Example
AT+SAVETRANSLINK=1,"192.168.6.110",1002,"TCP" AT+SAVETRANSLINK=1,"www.google.com",443,"SSL" AT+SAVETRANSLINK=1,"240e:3a1:2070:11c0:55ce:4e19:9649:b75",8080,"TCPv6" AT+SAVETRANSLINK=1,"240e:3a1:2070:11c0:55ce:4e19:9649:b75",8080,"SSLv6"
4.1.21.2. For UDP Transmission
4.1.21.2.1. Set command
Command
AT+SAVETRANSLINK=<mode>,<"remote host">,<remote port>,[<"type">,<local port>]
Response
OK
4.1.21.2.2. Parameters
- <mode>:
- 0: ST67W611M1 will NOT enter Wi-Fi Passthrough Mode on power-up.
- 1: ST67W611M1 will enter Wi-Fi Passthrough Mode on power-up.
- <"remote host">: string parameter showing the IPv4 address or domain name of remote host.
- <remote port>: the remote port number.
- <"type">: string parameter showing the type of transmission: "UDP" or "UDPv6". Default: "TCP".
- <local port>: local port when UDP Wi-Fi passthrough is enabled on power-up.
4.1.21.2.3. Example
AT+SAVETRANSLINK=1,"192.168.6.110",1002,"UDP",1005 AT+SAVETRANSLINK=1,"240e:3a1:2070:11c0:55ce:4e19:9649:b75",8081,"UDPv6",1005
4.1.22. AT+CIPSNTPCFG
Function: Query/Set the Time Zone and the SNTP Server.
4.1.22.1. Query command
Command
AT+CIPSNTPCFG?
Response
+CIPSNTPCFG:<enable>,<timezone>,<SNTP server1>[,<SNTP server2>,<SNTP server3>] OK
4.1.22.2. Set command
Command
AT+CIPSNTPCFG=<enable>,<timezone>[,<SNTP server1>,<SNTP server2>,<SNTP server3>]
Response
OK
4.1.22.3. Parameters
- <enable>: configure the SNTP server:
- 1: the SNTP server is configured.
- 0: the SNTP server is not configured.
- <timezone>: support the following two formats:
- The first format range is [-12,14]. It marks most of the time zones by offset from Coordinated Universal Time (UTC) in whole hours (UTC–12:00 to UTC+14:00).
- The second format is
UTC offset
. TheUTC offset
specifies the time value you must add to the UTC time to get a local time value. It has syntax like[+|-][hh]mm
. This is negative if the local time zone is on the west of the Prime Meridian and positive if it is on the east. The hour (hh) must be between -12 and 14, and the minute(mm) between 0 and 59. For example, if you want to set the timezone to New Zealand (Chatham Islands) which is inUTC+12:45
, you should set the parameter<timezone>
to1245
. Please refer to UTC offset wiki for more information.
- [<SNTP server1>]: the first SNTP server.
- [<SNTP server2>]: the second SNTP server.
- [<SNTP server3>]: the third SNTP server.
4.1.22.4. Note
- If the three SNTP servers are not configured, one of the following default servers will be used: "cn.ntp.org.cn", "ntp.sjtu.edu.cn", and "us.pool.ntp.org".
- For the Query command,
<timezone>
parameter in the response may be different from the<timezone>
parameter in Set command. Because the<timezone>
parameter supports the secondUTC offset
format, for example, setAT+CIPSNTPCFG=1,015
, for Query command, ST67W611M1-AT ignores the leading zero of the<timezone>
parameter, and the valid value is15
. It does not belong to the first format, so it is parsed according to the secondUTC offset
format, that is,UTC+00:15
, that is,timezone
is 0 in the response.
4.1.22.5. Example
// Enable SNTP server, set timezone to New York of the United States (UTC–05:00) AT+CIPSNTPCFG=1,-5,"0.pool.ntp.org","time.google.com" or AT+CIPSNTPCFG=1,-500,"0.pool.ntp.org","time.google.com" // Enable SNTP server, set timezone to New Zealand (Chatham Islands, UTC+12:45) AT+CIPSNTPCFG=1,1245,"0.pool.ntp.org","time.google.com"
4.1.23. AT+CIPSNTPTIME
Function: Query the SNTP Time.
4.1.23.1. Query command
Command
AT+CIPSNTPTIME?
Response
+CIPSNTPTIME:<asctime style time> OK
4.1.23.2. Note
- The asctime style time is defined at asctime man page.
- When ST67W611M1 enters Light-sleep or Deep-sleep mode and then wakes up, the system time may become inaccurate. It is recommended to resend the AT+CIPSNTPCFG command to obtain the new time from the NTP server.
4.1.23.3. Example
AT+CWMODE=1 AT+CWJAP="AP_TEST","1234567890" AT+CIPSNTPCFG=1,-5,"0.pool.ntp.org","time.google.com" AT+CIPSNTPTIME? +CIPSNTPTIME:Tue Oct 19 17:47:56 2021 OK or AT+CWMODE=1 AT+CWJAP="AP_TEST","1234567890" AT+CIPSNTPCFG=1,530 AT+CIPSNTPTIME? +CIPSNTPTIME:Tue Oct 19 15:17:56 2021 OK
4.1.24. AT+CIPSNTPINTV
Function: Query/Set the SNTP time synchronization interval.
4.1.24.1. Query command
Command
AT+CIPSNTPINTV?
Response
+CIPSNTPINTV:<interval second> OK
4.1.24.2. Set command
Command
AT+CIPSNTPINTV=<interval second>
Response
OK
4.1.24.3. Parameters
- <interval second>: the SNTP time synchronization interval. Unit: second. Range: [15,4294967].
Notes:
- It configures interval for synchronization, which means that it sets interval how often ST67W611M1 connects to NTP servers to get new time.
4.1.24.4. Example
AT+CIPSNTPCFG=1,-5,"0.pool.ntp.org","time.google.com" OK // synchronize SNTP time every hour AT+CIPSNTPINTV=3600 OK
4.1.25. AT+CIPRECONNINTV
Function: Query/Set the TCP/UDP/SSL reconnection Interval for the Wi-Fi Passthrough Mode.
4.1.25.1. Query command
Function
Query the automatic connect interval for the Wi-Fi Passthrough Mode.
Command
AT+CIPRECONNINTV?
Response
+CIPRECONNINTV:<interval> OK
4.1.25.2. Set command
Function
Set the automatic reconnecting interval when TCP/UDP/SSL transmission breaks in the Wi-Fi Passthrough Mode.
Command
AT+CIPRECONNINTV=<interval>
Response
OK
4.1.25.3. Parameter
- <interval>: the duration between automatic reconnections. Unit: 100 milliseconds. Default: 1. Range: [1,36000].
4.1.25.4. Note
- The configuration changes will be saved in the easyflash area if AT+SYSSTORE=1 .
4.1.25.5. Example
AT+CIPRECONNINTV=10
4.1.26. AT+CIPRECVMODE
Function: Query/Set Socket Receiving Mode.
4.1.26.1. Query command
Function
Query the socket receiving mode.
Command
AT+CIPRECVMODE?
Response
+CIPRECVMODE:<mode> OK
4.1.26.2. Set command
Command
AT+CIPRECVMODE=<mode>
Response
OK
4.1.26.3. Parameter
<mode>: the receive mode of socket data. Default: 0.
- 0: active mode. ST67W611M1-AT will send all the received socket data instantly to the host MCU with the header “+IPD”. (The socket receive window is 2920 bytes by default. The maximum valid bytes sent to MCU is 2920 bytes each time.)
- 1: passive mode. ST67W611M1-AT will keep the received socket data in an internal buffer (socket receive window, 2920 bytes by default), and wait for the host MCU to read. If the buffer is full, the socket transmission will be blocked for TCP/SSL connections, or data will be lost for UDP connections.
4.1.26.4. Note
The configuration can not be used in the Wi-Fi Passthrough Mode. If it is a UDP transmission in passive mode, data will be lost when the buffer is full.
When ST67W611M1-AT receives socket data in passive mode, it will prompt the following messages in different scenarios:
For multiple connections mode (AT+CIPMUX=1), the message is +IPD:<link ID>,<len>.
For single connection mode (AT+CIPMUX=0), the message is +IPD:<len>.
<len> is the total length of socket data in the buffer.
You should read data by running AT+CIPRECVDATA once there is a +IPD reported. Otherwise, the next +IPD will not be reported to the host MCU until the previous +IPD has been read.
When the connection is disconnected, the cache will be cleared.
4.1.26.5. Example
AT+CIPRECVMODE=1
4.1.27. AT+CIPRECVDATA
Obtain socket data in passive receiving mode.
4.1.27.1. Set command
Command
// Single connection: (AT+CIPMUX=0) AT+CIPRECVDATA=<len> // Multiple connections: (AT+CIPMUX=1) AT+CIPRECVDATA=<link_id>,<len>
Response
+CIPRECVDATA:<actual_len>,<data> OK
4.1.27.2. Parameter
- <mode>: the receive mode of socket data. Default: 0.
- <link_id>: connection ID in multiple connections mode.
- <len>: the max value is 0x7fffffff. If the actual length of the received data is less than len, the actual length will be returned.
- <actual_len>: length of the data you actually obtain.
- <data>: the data you want to obtain.
4.1.27.3. Example
AT+CIPRECVMODE=1 // For example, if host MCU gets a message of receiving 100-byte data in connection with No.0, // the message will be "+IPD:0,100". // Then you can read those 100-byte data by using the command below. AT+CIPRECVDATA=0,100
4.1.28. AT+CIPRECVLEN
Function: Obtain Socket Data Length in Passive Receiving Mode.
4.1.28.1. Query command
Function
Query the length of the entire data buffered for the connection.
Command
AT+CIPRECVLEN?
Response
// Single connection: (AT+CIPMUX=0) +CIPRECVLEN:<data length of link> OK // Multiple connections: (AT+CIPMUX=1) +CIPRECVLEN:<data length of link0>,<data length of link1>,<data length of link2>,<data length of link3>,<data length of link4> OK
4.1.28.2. Note
- For SSL connections, the data length returned by ST67W611M1-AT may be less than the actual data length.
4.1.28.3. Example
AT+CIPRECVLEN? // Multiple connections: (AT+CIPMUX=1) +CIPRECVLEN:100,0,0,0,0, // Single connection: (AT+CIPMUX=0) +CIPRECVLEN:100 OK
4.1.29. AT+PING
Function: Ping the Remote Host.
4.1.29.1. Set command
Function
Ping the remote host.
Command
AT+PING=<"host"> AT+PING=<"host">,[<len>,<count>,<interval>]
Response
+PING:<time> OK
or
+PING:TIMEOUT // at returns this response only when the domain name resolution failure or ping timeout +PING:TIMEOUT // AT returns this response only when the domain name resolution fails or ping times out ERROR
4.1.29.2. Parameters
- <"host">: String parameter showing the host IPv4 or IPV6 address or domain name.
- <len>: the length of the ping packet. Unit: byte. Range: (0,65535).
- <count>: the count of the ping packet.
- <interval>: the interval between ping packets. Unit: millisecond. Range: (0,65535).
- <time>: the response time of ping. Unit: millisecond. Range: (0,1000).
Notes:
- If the remote host is a domain name string, ping will first resolve the domain name (IPv4 address preferred) from DNS (domain name server) and then ping the remote IP address.
4.1.29.3. Example
AT+PING="192.168.1.1" AT+PING="www.google.com" AT+PING="192.168.1.1",64,8,500 // China Future Internet Engineering Center AT+PING="240c::6666"
4.1.30. AT+CIPEVT
Function: Turn on or off the event message notification prefixed with +CIP.
4.1.30.1. Set command
Function
Turn on or off the event message notification prefixed with +CIP.
Command
AT+CIPEVT=<enable>
Response
+CIPEVT OK
4.1.30.2. Parameters
<enable>: Turn on or off the event message notification prefixed with +CIP.
- 1: Enable printing of "+CIP" events.
- 0: Disable printing of "+CIP" events.
4.1.30.3. Query command
Function
Query event message notifications with prefix+CIP.
Command
AT+CIPEVT?
Response
+CIPEVT:<enable> OK
4.1.31. AT+CWEVT
Function: Turn on or off the event message notification prefixed with +CW.
4.1.31.1. Set command
Function
Turn on or off the event message notification prefixed with +CW.
Command
AT+CWEVT=<enable>
Response
+CWEVT OK
4.1.31.2. Parameters
<enable>: Turn on or off the event message notification prefixed with +CW.
- 1: Enable printing of "+CW" events.
- 0: Disable printing of "+CW" events.
4.1.31.3. Query command
Function
Query event message notifications with prefix+CW.
Command
AT+CWEVT?
Response
+CWEVT:<enable> OK
4.1.32. AT+CIPSSLCCONF
Function: Query/Set SSL Clients.
4.1.32.1. Query command
Function
Query the configuration of each connection where the ST67W611M1 runs as an SSL client.
Command
AT+CIPSSLCCONF?
Response
+CIPSSLCCONF:<linkid>,<auth_mode>,"<cert_name>","<key_name>","<ca_name>" OK
4.1.32.2. Set command
Command
// Single connection: (AT+CIPMUX=0) AT+CIPSSLCCONF=<auth_mode>[,"<cert_name>"][,"<key_name>"][,"<ca_name>"] // Multiple connections: (AT+CIPMUX=1) AT+CIPSSLCCONF=<linkid>,<auth_mode>[,"<cert_name>"][,"<key_name>"][,"<ca_name>"]
Response
OK
4.1.32.3. Parameters
<linkid>: ID of the connection (0~4), used for multiple connections.
<auth_mode>:
- 0: no authentication. In this case <pki_number> and <ca_number> are not required.
- 1: the client provides the client certificate for the server to verify.
- 2: the client loads CA certificate to verify the server’s certificate.
- 3: mutual authentication.
<cert_name>: The file name of the certificate.
<key_name>: The file name of the private key.
<ca_name>: The file name of CA used by the client to verify the server.
4.1.32.4. Example
// Single connection: (AT+CIPMUX=0) AT+CIPSSLCCONF=3,"client_1.crt","client_1.key","ca_1.crt" // No auth (AT+CIPMUX=1) AT+CIPSSLCCONF=0,0 // Client auth (AT+CIPMUX=1) AT+CIPSSLCCONF=0,1,"client_1.crt","client_1.key","" // Server auth (AT+CIPMUX=1) AT+CIPSSLCCONF=0,2,"","","ca_1.crt" // Both auth (AT+CIPMUX=1) AT+CIPSSLCCONF=0,3,"client_1.crt","client_1.key","ca_1.crt"
Notes:
- If you want this configuration to take effect immediately, run this command before establishing an SSL connection.
- When downloading AT firmware, it is necessary to download the littlefs file system, and the default file system is mounted to /lfs.
- If you need to dynamically modify the certificate content, you can refer to the command:`AT+FS_`.
- If <auth_mode> is configured to 2 or 3, in order to check the server certificate validity period, make sure ST67W611M1 has obtained the current time before sending the AT+CIPSTART command. (You can send AT+CIPSNTPCFG command to configure SNTP and obtain the current time, and send AT+CIPSNPTIME? command to query the current time.)
4.1.33. AT+CIPSSLCSNI
Function: Query/Set SSL Client Server Name Indication (SNI).
4.1.33.1. Query command
Function
Query the SNI configuration of each connection.
Command
// Single connection: (AT+CIPMUX=0) AT+CIPSSLCSNI? // Multiple connections: (AT+CIPMUX=1) AT+CIPSSLCSNI=<linkid>?
Response
+CIPSSLCSNI:<link ID>,<"sni"> OK
4.1.33.2. Set command
Command
// Single connection: (AT+CIPMUX=0) AT+CIPSSLCSNI=<"sni"> // Multiple connections: (AT+CIPMUX=1) AT+CIPSSLCSNI=<link ID>,<"sni">
Response
OK
4.1.33.3. Parameters
- <linkid>: ID of the connection (0~4), used for multiple connections.
- *; <”sni”>: the Server Name Indication in ClientHello, this parameter is used to verify the Common Name in the certificate sent by the server.
- The maximum length of sni is 64 bytes.
Notes:
- If you want this configuration to take effect immediately, run this command before establishing an SSL connection.
- When downloading AT firmware, it is necessary to download the romfs file system, and the default file system is mounted to /romfs.
4.1.34. AT+CIPSSLCALPN
Function: Query/Set SSL Client Application Layer Protocol Negotiation (ALPN).
4.1.34.1. Query command
Function
Query the ALPN configuration of each connection where the ST67W611M1 runs as an SSL client.
Command
AT+CIPSSLCALPN?
Response
+CIPSSLCALPN:<link ID>[,<"alpn">][,<"alpn">][,<"alpn">] OK
4.1.34.2. Set command
Command
// Single connection: (AT+CIPMUX=0) AT+CIPSSLCALPN=<counts>[,<"alpn">][,<"alpn">][,<"alpn">] // Multiple connections: (AT+CIPMUX=1) AT+CIPSSLCALPN=<link ID>,<counts>[,<"alpn">][,<"alpn">][,<"alpn">]
Response
OK
4.1.34.3. Parameters
<linkid>: ID of the connection (0~4), used for multiple connections.
<counts>: the number of ALPNs. Range: [0,5].
- 0: clean the ALPN configuration.
- [1,5]: set the ALPN configuration.
<"alpn">: A string parameter showing the ALPN in ClientHello. The maximum length of alpn is limited by the command length.
Notes:
- If you want this configuration to take effect immediately, run this command before establishing an SSL connection.
4.1.35. AT+CIPSSLCPSK
Function: Query/Set SSL Client Pre-shared Key (PSK) in String Format.
4.1.35.1. Query command
Function
Query the PSK configuration of each connection where the ST67W611M1 runs as an SSL client.
Command
// Single connection: (AT+CIPMUX=0) AT+CIPSSLCPSK? // Multiple connections: (AT+CIPMUX=1) AT+CIPSSLCPSK=<linkid>?
Response
+CIPSSLCPSK:<link ID>,<"psk">,<"hint"> OK
4.1.35.2. Set command
Command
// Single connection: (AT+CIPMUX=0) AT+CIPSSLCPSK=<"psk">,<"hint"> // Multiple connections: (AT+CIPMUX=1) AT+CIPSSLCPSK=<link ID>,<"psk">,<"hint">
Response
OK
4.1.35.3. Parameters
- <linkid>: ID of the connection (0~4), used for multiple connections.
- <"psk">: The pre-shared key in string format. Maximum length: 32. Please use AT+CIPSSLCPSKHEX command if your <"psk"> parameter contains 0 characters.
- <"hint">: The pre-shared key identity. Maximum length: 32.
Notes:
- If you want this configuration to take effect immediately, run this command before establishing an SSL connection.
4.1.36. AT+CIPSSLCPSKHEX
Function: Query/Set SSL Client Pre-shared Key (PSK) in Hexadecimal Format.
4.1.36.1. Query command
Function
Query the PSK configuration in hexadecimal format of each connection where the ST67W611M1 runs as an SSL client.
Command
// Single connection: (AT+CIPMUX=0) AT+CIPSSLCPSKHEX? // Multiple connections: (AT+CIPMUX=1) AT+CIPSSLCPSKHEX=<linkid>?
Response
+CIPSSLCPSKHEX:<link ID>,<"psk">,<"hint"> OK
4.1.36.2. Set command
Command
// Single connection: (AT+CIPMUX=0) AT+CIPSSLCPSKHEX=<"psk">,<"hint"> // Multiple connections: (AT+CIPMUX=1) AT+CIPSSLCPSKHEX=<link ID>,<"psk">,<"hint">
Response
OK
4.1.36.3. Parameters
- <linkid>: ID of the connection (0~4), used for multiple connections.
- <"psk">: The pre-shared key in string format. Maximum length: 32. Please use AT+CIPSSLCPSKHEX command if your <"psk"> parameter contains 0 characters.
- <"hint">: The pre-shared key identity. Maximum length: 32.
Notes:
- Similar to the AT+CIPSSLCPSK command, this command also sets or queries the SSL Client PSK, but its <"psk"> is in hexadecimal format rather than in string format. So, 0 in the <"psk"> parameter means 00.
4.1.36.4. Example
// Single connection: (AT+CIPMUX=0), pre-shared key is "psk", pre-shared key identity is "myhint". AT+CIPSSLCPSKHEX="70736b","myhint" // Multiple connections: (AT+CIPMUX=1), pre-shared key is "psk", pre-shared key identity is "myhint". AT+CIPSSLCPSKHEX=0,"70736b","myhint"
4.1.37. AT+IPERF
Function: Test throughput of the ST67W611M1 in standalone mode.
4.1.37.1. Set command
Command
AT+IPERF=<"direct">,<"type">,[<"ipaddr">],[<time>],[<port>]
Response
OK
4.1.37.2. Parameters
- <"direct">: The direction of iperf, "TX" or "RX".
- <"type">: The type of connection, "TCP" or "UDP".
- <"ipaddr">: Target ip address. If acting as a client, this parameter must be set.
- <"time">: The duration of iperf, default value 10S.(Unit seconds)
- <"port">: The port number of iperf, default value 5001.
4.1.37.3. Example
AT+IPERF="RX","TCP" AT+IPERF="TX","TCP","192.168.1.2",1000 AT+IPERF="TX","TCP","192.168.1.2",1000,5001
4.1.38. AT+IPERFSTOP
Function: Stop test throughput of the ST67W611M1.
4.1.38.1. Set command
Command
AT+IPERFSTOP
Response
OK
4.1.38.2. Example
AT+IPERF="TX","TCP","192.168.1.2",1000 AT+IPERFSTOP
5. MQTT AT commands
Instruction | Description |
---|---|
AT+MQTTUSERCFG | Get/Set MQTT user configuration |
AT+MQTTCLIENTID | Get/Set MQTT client ID |
AT+MQTTUSERNAME | Get/Set MQTT username |
AT+MQTTPASSWORD | Get/Set MQTT password |
AT+MQTTCONNCFG | Get/Set configuration of MQTT connection |
AT+MQTTALPN | Get/Set MQTT Application Layer Protocol Negotiation (ALPN) |
AT+MQTTSNI | Get/Set MQTT Server Name Indication (SNI) |
AT+MQTTCONN | Connect to MQTT Brokers |
AT+MQTTPUB | Publish MQTT Messages in string |
AT+MQTTPUBRAW | Publish long MQTT messages |
AT+MQTTSUB | Subscribe to MQTT topics |
AT+MQTTUNSUB | Unsubscribe from MQTT topics |
AT+MQTTCLEAN | Close MQTT connections |
5.1. MQTT AT commands
5.1.1. AT+MQTTUSERCFG
Get/Set MQTT user configuration.
5.1.1.1. Query command
Query MQTT User Configuration.
Command
AT+MQTTUSERCFG?
Response
+MQTTUSERCFG:<LinkID>,<scheme>,<"client_id">,<"username">,<"password">,<"cert_file">,<"key_file">,<"ca_file"> OK
5.1.1.2. Set command
Set MQTT User Configuration.
Command
AT+MQTTUSERCFG=<LinkID>,<scheme>,<"client_id">,<"username">,<"password">[,<"cert_file">][,<"key_file">][,<"ca_file">]
Response
OK
5.1.1.3. Parameters
<LinkID>: currently only supports link ID 0.
<scheme>:
- 0: MQTT over TCP.
- 1: MQTT over TLS (no certificate verify).
- 2: MQTT over TLS (verify server certificate).
- 3: MQTT over TLS (provide client certificate).
- 4: MQTT over TLS (verify server certificate and provide client certificate).
<client_id>: MQTT client ID. Maximum length: 23 bytes.
<username>: The username to login to the MQTT broker. Maximum length: 128 bytes.
<password>: The password to login to the MQTT broker. Maximum length: 128 bytes.
<"cert_file">: The file name of the certificate.
<"key_file">: The file name of the private key.
<"ca_file">: The file name of CA used by the client to verify the server.
Notes:
- The length of the entire AT command should be less than 256 bytes.
- If <scheme> is configured to 3, 5, 8, or 10, in order to check the server certificate validity period, please make sure ST67W611M1 has obtained the current time before sending the AT+MQTTCONN command. (You can send AT+CIPSNTPCFG command to configure SNTP and obtain the current time, and send AT+CIPSNPTIME? command to query the current time.)
5.1.2. AT+MQTTCLIENTID
Get/Set MQTT client ID.
5.1.2.1. Query command
Query MQTT client ID.
Command
AT+MQTTCLIENTID?
Response
+MQTTCLIENTID:<LinkID>,<"client_id"> OK
Notes:
- The maximum length of the Query command does not exceed 128 bytes (limited to AT length)
5.1.2.2. Set command
Set MQTT client ID.
Command
AT+MQTTLONGCLIENTID=<LinkID>,<length>
Response
OK >
This response indicates that AT is ready for receiving MQTT Client ID. You should enter the Client ID, and when the Client ID length reaches the <length> value, the system returns:
OK
5.1.2.3. Parameters
- <LinkID>: currently only supports link ID 0.
- <length>: MQTT client ID length. Range: [1,23].
Notes:
The command AT+MQTTUSERCFG can also set MQTT client ID. The differences between the two commands include:
- You can use AT+MQTTLONGCLIENTID to set a relatively long client ID since there is a limitation on the length of the AT+MQTTUSERCFG command.
- You should set AT+MQTTLONGCLIENTID after setting the AT+MQTTUSERCFG command.
5.1.3. AT+MQTTUSERNAME
Get/Set MQTT username.
5.1.3.1. Query command
Query MQTT username.
Command
AT+MQTTUSERNAME?
Response
+MQTTUSERNAME:<LinkID>,<"user_name"> OK
Notes:
- The maximum length of the Query command does not exceed 128 bytes (limited to AT length)
5.1.3.2. Set command
Set MQTT username.
Command
AT+MQTTUSERNAME=<LinkID>,<length>
Response
OK >
This response indicates that AT is ready for receiving MQTT username. You should enter the MQTT username, and when the MQTT username length reaches the <length> value, the system returns:
OK
5.1.3.3. Parameters
- <LinkID>: currently only supports link ID 0.
- <length>: MQTT username length. Range: [1,128].
Notes:
The command AT+MQTTUSERCFG can also set MQTT username. The differences between the two commands include:
- You can use AT+MQTTLONGUSERNAME to set a relatively long username since there is a limitation on the length of the AT+MQTTUSERCFG command.
- You should set AT+MQTTLONGUSERNAME after setting the command AT+MQTTUSERCFG.
5.1.4. AT+MQTTPASSWORD
Get/Set MQTT password.
5.1.4.1. Query command
Query MQTT password.
Command
AT+MQTTPASSWORD?
Response
+MQTTPASSWORD:<LinkID>,<"password"> OK
Notes:
- The maximum length of the Query command does not exceed 128 bytes (limited to AT length)
5.1.4.2. Set command
Set MQTT password.
Command
AT+MQTTPASSWORD=<LinkID>,<length>
Response
OK >
This response indicates that AT is ready for receiving MQTT password. You should enter the MQTT password, and when the MQTT password length reaches the <length> value, the system returns:
OK
5.1.4.3. Parameters
- <LinkID>: currently only supports link ID 0.
- <length>: MQTT password length. Range: [1,128].
Notes:
The command AT+MQTTUSERCFG can also set MQTT password. The differences between the two commands include:
- You can use AT+MQTTLONGPASSWORD to set a relatively long password since there is a limitation on the length of the AT+MQTTUSERCFG command.
- You should set AT+MQTTLONGPASSWORD after setting the command AT+MQTTUSERCFG.
5.1.5. AT+MQTTCONNCFG
Get/Set configuration of MQTT connection.
5.1.5.1. Query command
Query configuration of MQTT connection.
Command
AT+MQTTCONNCFG?
Response
+MQTTCONNCFG:<LinkID>,<keepalive>,<disable_clean_session>,<"lwt_topic">,<"lwt_msg">,<lwt_qos>,<lwt_retain> OK
5.1.5.2. Set command
Set configuration of MQTT Connection.
Command
AT+MQTTCONNCFG=<LinkID>,<keepalive>,<disable_clean_session>,<"lwt_topic">,<"lwt_msg">,<lwt_qos>,<lwt_retain>
Response
OK
5.1.5.3. Parameters
<LinkID>: currently only supports link ID 0.
<keepalive>: timeout of MQTT ping. Unit: second. Range [0,7200]. The default value is 0, which will be force-changed to 120 s.
<disable_clean_session>: set MQTT clean session. For more details about this parameter, please refer to the section Clean Session in MQTT Version 3.1.1.
- 0: enable clean session.
- 1: disable clean session.
<lwt_topic>: LWT (Last Will and Testament) message topic. Maximum length: 128 bytes.
<lwt_msg>: LWT message. Maximum length: 128 bytes.
<lwt_qos>: LWT QoS, which can be set to 0, 1, or 2. Default: 0.
<lwt_retain>: LWT retain, which can be set to 0 or 1. Default: 0.
5.1.6. AT+MQTTALPN
Get/Set MQTT Application Layer Protocol Negotiation (ALPN).
5.1.6.1. Query command
Query MQTT Application Layer Protocol Negotiation (ALPN).
Command
AT+MQTTALPN?
Response
+MQTTALPN:<LinkID>[,<"alpn">][,<"alpn">][,<"alpn">] OK
5.1.6.2. Set command
Set MQTT Application Layer Protocol Negotiation (ALPN).
Command
AT+MQTTALPN=<LinkID>,<alpn_counts>[,<"alpn">][,<"alpn">][,<"alpn">]
Response
OK
5.1.6.3. Parameters
<LinkID>: Currently only supports link ID 0.
<alpn_counts>: The number of <”alpn”> parameters. Range: [0,5].
- 0: clean the MQTT ALPN configuration.
- [1,5]: set the MQTT ALPN configuration.
<"alpn">: You can send more than one ALPN in ClientHello to the server.
Notes:
- The length of the entire AT command should be less than 256 bytes.
- MQTT ALPN will be effective only if the MQTT connection is based on TLS or WSS.
- You should set AT+MQTTALPN after setting the command AT+MQTTUSERCFG.
5.1.6.4. Example
AT+CWMODE=1 AT+CWJAP="ssid","password" AT+CIPSNTPCFG=1,-5,"0.pool.ntp.org","time.google.com" AT+MQTTUSERCFG=0,4,"ST67W611M1","user","123456789","client_1.crt","client_1.key","ca_1.crt" AT+MQTTALPN=0,2,"mqtt-ca.cn","mqtt-ca.us" AT+MQTTCONN=0,"192.168.31.112",8883,1
5.1.7. AT+MQTTSNI
Get/Set MQTT Server Name Indication (SNI).
5.1.7.1. Query command
Query MQTT Server Name Indication (SNI).
Command
AT+MQTTSNI?
Response
+MQTTSNI:<LinkID>,<"sni"> OK
5.1.7.2. Set command
Set MQTT Server Name Indication (SNI).
Command
AT+MQTTSNI=<LinkID>,<"sni">
Response
OK
5.1.7.3. Parameters
- <LinkID>: Currently only supports link ID 0.
- <"sni">: MQTT Server Name Indication. You can send it in ClientHello to the server.
Notes:
- The length of the entire AT command should be less than 256 bytes.
- MQTT SNI will be effective only if the MQTT connection is based on TLS or WSS.
- You should set AT+MQTTSNI after setting the command AT+MQTTUSERCFG.
5.1.7.4. Example
AT+CWMODE=1 AT+CWJAP="ssid","password" AT+CIPSNTPCFG=1,-5,"0.pool.ntp.org","time.google.com" AT+MQTTUSERCFG=0,4,"ST67W611M1","user","123456789","client_1.crt","client_1.key","ca_1.crt" AT+MQTTSNI=0,"my_specific_prefix.iot.my_aws_region.amazonaws.com" AT+MQTTCONN=0,"192.168.31.112",8883,1
5.1.8. AT+MQTTCONN
Connect to MQTT Brokers.
5.1.8.1. Query command
Query MQTT Brokers that have already been connected.
Command
AT+MQTTCONN?
Response
+MQTTCONN:<LinkID>,<state>,<scheme><"host">,<port>,<reconnect> OK
5.1.8.2. Set command
Connect to MQTT Brokers.
Command
AT+MQTTCONN=<LinkID>,<"host">,<port>,<reconnect>
Response
OK +MQTT:CONNECTED,0
or
+MQTT:DISCONNECTED,0
5.1.8.3. Parameters
<LinkID>: Currently only supports link ID 0.
<"host">: MQTT broker domain. Maximum length: 128 bytes.
<port>: MQTT broker port. Maximum: port 65535.
<reconnect>:
- 0: MQTT will not reconnect automatically. If MQTT connection established and then disconnected, you cannot use this command to reestablish MQTT connection. Please send AT+MQTTCLEAN=0 command to clean MQTT connection first, reconfigure the connection parameters, and then establish a new MQTT connection.
- 1: MQTT will reconnect automatically. It takes more resources.
<state>:
- 0: MQTT uninitialized.
- 1: already set AT+MQTTUSERCFG.
- 2: already set AT+MQTTCONNCFG.
- 3: connection disconnected.
- 4: connection established.
- 5: connected, but did not subscribe to any topic.
- 6: connected, and subscribed to MQTT topics.
<scheme>:
- 0: MQTT over TCP.
- 1: MQTT over TLS (no certificate verify).
- 2: MQTT over TLS (verify server certificate).
- 3: MQTT over TLS (provide client certificate).
- 4: MQTT over TLS (verify server certificate and provide client certificate).
5.1.9. AT+MQTTPUB
Publish MQTT Messages in string.
5.1.9.1. Set command
Function
Publish MQTT messages in string to a defined topic. If the amount of data you publish is relatively large, and the length of a single AT command has exceeded the threshold of 256, please use the AT+MQTTPUBRAW command.
Command
AT+MQTTPUB=<LinkID>,<"topic">,<"data">,<qos>,<retain>
Response
OK
5.1.9.2. Parameters
- <LinkID>: Currently only supports link ID 0.
- <"topic">: MQTT topic. Maximum length: 128 bytes.
- <"data">: MQTT message in string.
- <qos>: QoS of message, which can be set to 0, 1, or 2. Default: 0.
- <retain>: retain flag.
Notes:
- The length of the entire AT command should be less than 256 bytes.
- This command cannot send data 0. If you need to send 0, please use the command AT+MQTTPUBRAW instead.
5.1.9.3. Example
AT+CWMODE=1 AT+CWJAP="ssid","password" AT+CIPSNTPCFG=1,-5,"0.pool.ntp.org","time.google.com" AT+MQTTUSERCFG=0,4,"ST67W611M1","user","123456789","client_1.crt","client_1.key","ca_1.crt" AT+MQTTALPN=0,2,"mqtt-ca.cn","mqtt-ca.us" AT+MQTTCONN=0,"192.168.31.112",8883,1 AT+MQTTPUB=0,"topic","\"{\"timestamp\":\"20201121085253\"}\"",0,0 // When sending this command, please pay attention to whether special characters need to be escaped.
5.1.10. AT+MQTTPUBRAW
Publish Long MQTT Messages.
5.1.10.1. Set command
Function
Publish long MQTT messages to a defined topic. If the amount of data you publish is relatively small, and the length of a single AT command is not greater than the threshold of 256, you also can use the AT+MQTTPUB command.
Command
AT+MQTTPUBRAW=<LinkID>,<"topic">,<length>,<qos>,<retain>
Response
OK >
The symbol > indicates that AT is ready for receiving serial data, and you can enter the data now. When the requirement of message length determined by the parameter <length> is met, the transmission starts.
If the transmission is successful, AT returns:
SEND OK
Otherwise, it returns:
SEND FAIL
5.1.10.2. Parameters
- <LinkID>: Currently only supports link ID 0.
- <"topic">: MQTT topic. Maximum length: 128 bytes.
- <length>: The length of an MQTT message. Its maximum length is 1536.
- <qos>: QoS of the published message, which can be set to 0, 1, or 2. Default is 0.
- <retain>: retain flag.
5.1.11. AT+MQTTSUB
Subscribe to MQTT topics.
5.1.11.1. Query command
Query subscribed MQTT topics.
Command
AT+MQTTSUB?
Response
+MQTTSUB:<LinkID>,<state>,<"topic1">,<qos> +MQTTSUB:<LinkID>,<state>,<"topic2">,<qos> +MQTTSUB:<LinkID>,<state>,<"topic3">,<qos> ... OK
5.1.11.2. Set command
Function
Subscribe to defined MQTT topics with defined QoS. It supports subscribing to multiple topics.
Command
AT+MQTTSUB=<LinkID>,<"topic">,<qos>
Response
OK
If the topic has been subscribed before, it will prompt: :
+MQTTSUB,ALREADY_SUBSCRIBE OK
When AT receives MQTT messages of the subscribed topic, it will prompt:
+MQTT:SUBRECV,<LinkID>,<topic_length>,<data_length>,<"topic">,<data>
5.1.11.3. Parameters
<LinkID>: Currently only supports link ID 0.
<state>:
- 0: MQTT uninitialized.
- 1: already set AT+MQTTUSERCFG.
- 2: already set AT+MQTTCONNCFG.
- 3: connection disconnected.
- 4: connection established.
- 5: connected, but subscribe to no topic.
- 6: connected, and subscribed to MQTT topics.
<topic>: the topic that is subscribed to.
<qos>: the QoS that is subscribed to.
5.1.12. AT+MQTTUNSUB
Unsubscribe from MQTT topics.
5.1.12.1. Set command
Function
Unsubscribe the client from defined topics. This command can be called multiple times to unsubscribe from different topics.
Command
AT+MQTTUNSUB=<LinkID>,<"topic">
Response
OK
If the topic has been subscribed before, it will prompt:
+MQTTUNSUB:NO_UNSUBSCRIBE OK
5.1.12.2. Parameters
- <LinkID>: Currently only supports link ID 0.
- <topic>: MQTT topic. Maximum length: 128 bytes.
5.1.13. AT+MQTTCLEAN
Close MQTT connections.
5.1.13.1. Set command
Function
Close the MQTT connection and release the resource.
Command
AT+MQTTCLEAN=<LinkID>
Response
OK
5.1.13.2. Parameters
- <LinkID>: Currently only supports link ID 0.
6. BLE AT commands
Instruction | Description |
---|---|
AT+BLEINIT | Initialize BLE |
AT+BLEADDR | BLE address |
AT+BLENAME | Set BLE device name |
AT+BLESCANPARAM | Set BLE scanning parameters |
AT+BLESCAN | Enable BLE scanning |
AT+BLESCANRSPDATA | Set BLE SCAN Response data |
AT+BLEADVPARAM | Set BLE advertising parameters |
AT+BLEADVDATA | Set BLE advertising data |
AT+BLEADVSTART | Enable BLE advertising |
AT+BLEADVSTOP | Stop BLE advertising |
AT+BLECONN | Establish BLE connection |
AT+BLECONNPARAM | Update BLE connection parameters |
AT+BLEDISCONN | End BLE connection |
AT+BLEDATALEN | Set BLE packet length |
AT+BLEEXCHANGEMTU | Exchange the size of BLE MTU |
AT+BLEGATTSSRV | GATTS discover services |
AT+BLEGATTSSRVCRE | GATTS create services |
AT+BLEGATTSSRVDEL | GATTS delete services |
AT+BLEGATTSREGISTER | GATTS services Register/Unregister |
AT+BLEGATTSCHAR | GATTS discover characteristics |
AT+BLEGATTSCHARCRE | GATTS create characteristics |
AT+BLEGATTSNTFY | GATTS characteristics notify |
AT+BLEGATTSIND | GATTS characteristics indicate |
AT+BLEGATTSRD | GATTS characteristics read |
AT+BLEGATTCSRVDIS | GATTC discover services |
AT+BLEGATTCCHARDIS | GATTC discover characteristics |
AT+BLEGATTCWR | GATTC characteristics write |
AT+BLEGATTCRD | GATTC characteristics read |
AT+BLEGATTCSUBSCRIBE | GATTC subscribe server |
AT+BLEGATTCUNSUBSCRIBE | GATTC unsubscribe server |
AT+BLETXPWR | BLE TX power |
AT+BLESECPARAM | Set/Query BLE security parameter |
AT+BLESECCANNEL | BLE Cancel Pairing |
AT+BLESECPASSKEYCONFIRM | BLE Pairing passkey confirm |
AT+BLESECPAIRINGCONFIRM | BLE Pairing confirm |
AT+BLESECPASSKEY | BLE Pairing pass entry |
AT+BLESECGETLTKLIST | Query BLE Paired deviceList |
AT+BLESECUNPAIR | BLE unpairing |
AT+BLESECSTART | BLE start pairing |
AT+BLEBASINIT | BLE BAS profile init |
AT+BLEBASDEINIT | BLE BAS profile deinit |
AT+BLEBASLVLGET | GET BLE BAS profile level |
AT+BLEBASLVLSET | SET BLE BAS profile level |
AT+BLEIASINIT | BLE IAS profile init |
AT+BLEIASDEINIT | BLE IAS profile deinit |
AT+BLEDISINIT | BLE DIS profile init |
AT+BLEDISDEINIT | BLE DIS profile deinit |
AT+BLEDISSET | BLE DIS profile setting |
6.1. BLE AT commands
6.1.1. AT+BLEINIT
Function: BLE initialization.
6.1.1.1. Query command
Function
Check the initialization status of BLE.
Command
AT+BLEINIT?
Response
If BLE is initialized, AT will return:
+BLEINIT:<role> OK
If BLE is not initialized, AT will return:
+BLEINIT:0 OK
6.1.1.2. Set command
Function
Initialize BLE.
Command
AT+BLEINIT=<init>
Response
OK
6.1.1.3. Parameter
- <init>:
- 0: deinit BLE
- 1: client role
- 2: server role
6.1.2. AT+BLEADDR
Function: Query/Set the BLE address.
6.1.2.1. Query command
Function
Query the BLE device address.
Command
AT+BLEADDR?
Response
+BLEADDR:<BLE_public_addr> OK
6.1.2.2. Set command
Function
Set the BLE device address.
Command
AT+BLEADDR=<BLE_public_addr>
Response
OK
6.1.2.3. Parameter
- <BLE_public_addr>:
6.1.3. AT+BLENAME
Function: Query/Set the BLE device name.
6.1.3.1. Query command
Function
Query the BLE device name.
Command
AT+BLENAME?
Response
+BLENAME:<device_name> OK
6.1.3.2. Set command
Function
Set the BLE device name.
Command
AT+BLENAME=<device_name>
Response
OK
6.1.3.3. Parameter
- <device_name>: the BLE device name. The maximum length is 29.
6.1.4. AT+BLESCANPARAM
Function: Query/Set the parameters of BLE scanning.
6.1.4.1. Query command
Function
Query the parameters of BLE scanning.
Command
AT+BLESCANPARAM?
Response
+BLESCANPARAM:<scan_type>,<own_addr_type>,<filter_policy>,<scan_interval>,<scan_window> OK
6.1.4.2. Set command
Function
Set the parameters of BLE scanning.
Command
AT+BLESCANPARAM=<scan_type>,<own_addr_type>,<filter_policy>,<scan_interval>,<scan_window>
Response
OK
6.1.4.3. Parameters
- <scan_type>:
- 0: passive scan
- 1: active scan
- <own_addr_type>:
- 0: Public Address
- 1: Random Address
- 2: RPA Public Address
- 3: RPA Random Address
- <filter_policy>:
- 0: BLE_SCAN_FILTER_ALLOW_ALL
- 1: BLE_SCAN_FILTER_ALLOW_ONLY_WLST
- 2: BLE_SCAN_FILTER_ALLOW_UND_RPA_DIR
- 3: BLE_SCAN_FILTER_ALLOW_WLIST_PRA_DIR
- <scan_interval>: scan interval. It should be more than or equal to the value of <scan_window>. The range of this parameter is [0x0004,0x4000]-->[4, 16384] . The scan interval equals this parameter multiplied by 0.625 ms, so the range for the actual scan interval is [2.5,10240] ms.
- <scan_window>: scan window. It should be less than or equal to the value of <scan_interval>. The range of this parameter is [0x0004,0x4000]-->[4, 16384]. The scan window equals this parameter multiplied by 0.625 ms, so the range for the actual scan window is [2.5,10240] ms.
6.1.5. AT+BLESCAN
Function: Enable BLE scanning.
6.1.5.1. Set command
Function
Enable/disable scanning.
Command
AT+BLESCAN=<enable>
Response
+BLE:SCAN:<addr>,<rssi>,<adv_data>,<scan_rsp_data>,<addr_type> OK
6.1.5.2. Parameters
- <enable>:
- 1: enable continuous scanning.
- 0: disable continuous scanning.
- <addr>: BLE address.
- <rssi>: signal strength.
- <adv_data>: advertising data.
- <scan_rsp_data>: scan response data.
- <addr_type>: the address type of broadcasters.
6.1.5.3. Example
AT+BLEINIT=1 // Role: client AT+BLESCAN=1 // start scanning AT+BLESCAN=0 // stop scanning
6.1.6. AT+BLESCANRSPDATA
Function: Set BLE SCAN Response data.
6.1.6.1. Set command
Function
Set scan response.
Command
AT+BLESCANRSPDATA=<scan_rsp_data>
Response
OK
6.1.6.2. Parameter
- <scan_rsp_data>: scan response data is a HEX string. For example, if you want to set the response data to “02010606095757575757”, the command should be AT+BLESCANRSPDATA="02010606095757575757". BT_DATA_NAME_COMPLETE DATA index must be 2,like AT+BLESCANRSPDATA="02010606095757575757".
02 : Command 01 : Flag 06 : Value 06 : Length of data + 1 09 : AD type 5757575757 : Data in Hex format
6.1.6.3. Example
AT+BLEINIT=2 // Role: server AT+BLESCANRSPDATA="02010606095757575757"
6.1.7. AT+BLEADVPARAM
Function: Query/Set Parameters of BLE Advertising.
6.1.7.1. Query command
Function
Query the parameters of advertising.
Command
AT+BLEADVPARAM?
Response
+BLEADVPARAM:<adv_int_min>,<adv_int_max>,<adv_type>,<channel_map> OK
6.1.7.2. Set command
Function
Set the parameters of advertising.
Command
AT+BLEADVPARAM=<adv_int_min>,<adv_int_max>,<adv_type>,<channel_map>
Response
OK
6.1.7.3. Parameters
- <adv_int_min>: minimum advertising interval. The range of this parameter is [0x0020,0x4000] --> [32, 16384]. The actual advertising interval equals this parameter multiplied by 0.625 ms, so the range for the actual minimum interval is [20, 10240] ms. It should be less than or equal to the value of <adv_int_max>.
- <adv_int_max>: maximum advertising interval. The range of this parameter is [0x0020,0x4000]--> [32, 16384]. The actual advertising interval equals this parameter multiplied by 0.625 ms, so the range for the actual maximum interval is [20, 10240] ms. It should be more than or equal to the value of <adv_int_min>.
- <adv_type>:
- 0: ADV_TYPE_IND
- 1: ADV_TYPE_SCAN_IND
- 2: ADV_TYPE_NONCONN_IND
- <channel_map>: channel of advertising.
- 1: ADV_CHNL_37
- 2: ADV_CHNL_38
- 4: ADV_CHNL_39
- 7: ADV_CHNL_ALL
6.1.7.4. Example
AT+BLEINIT=2 // Role: server AT+BLEADVPARAM=160,320,0,7
6.1.8. AT+BLEADVDATA
Function: Set BLE Advertising data.
6.1.8.1. Set command
Function
Set advertising data.
Command
AT+BLEADVDATA=<adv_data>
Response
OK
6.1.8.2. Parameter
- <adv_data>: advertising data in HEX string. For example, to set the advertising data to “02010606095757575757”, the command should be AT+BLEADVDATA="02010606095757575757". The maximum length is 31 bytes.
02 : Command 01 : Flag 06 : Value 06 : Length of data + 1 09 : AD type 5757575757 : Data in Hex format
6.1.8.3. Example
AT+BLEINIT=2 // Role: server AT+BLEADVDATA="02010606095757575757"
6.1.9. AT+BLEADVSTART
Function: Start BLE advertising.
6.1.9.1. Execute command
Function
Start advertising.
Command
AT+BLEADVSTART
Response
OK
6.1.9.2. Example
AT+BLEINIT=2 // Role: server AT+BLEADVSTART
6.1.10. AT+BLEADVSTOP
Function: Stop BLE advertising.
6.1.10.1. Execute command
Function
Stop advertising.
Command
AT+BLEADVSTOP
Response
OK
6.1.10.2. Example
AT+BLEINIT=2 // Role: server AT+BLEADVSTART AT+BLEADVSTOP
6.1.11. AT+BLECONN
Function: Establish BLE connection.
6.1.11.1. Query command
Function
Query the Bluetooth LE connection.
Command
AT+BLECONN?
Response
+BLECONN:<conn_index>,<remote_address> OK
If the connection has not been established, there will be no <conn_index> and <remote_address> in the response.
6.1.11.2. Set command
Function
Establish the BLE connection.
Command
AT+BLECONN=<conn_index>,<remote_address>[,<addr_type>,<timeout>]
Response
If the connection is established successfully, it will prompt:
+BLE:CONNECTED:<conn_index>,<remote_address> OK
If the connection fails, it will prompt:
ERROR
If the connection fails due to parameters error or other reasons, it will prompt:
ERROR
6.1.11.3. Parameters
- <conn_index>: index of BLE connection. Range: [0,1].
- <remote_address>: remote BLE address.
- <addr_type>: the address type of broadcasters:
- 0: Public Address
- 1: Random Address
- <timeout> :connection req timeout (option).[3,30].
6.1.11.4. Example
AT+BLEINIT=1 // Role: client AT+BLECONN=0,"11:22:33:44:55:66",0,10
6.1.12. AT+BLECONNPARAM
Function: Query/Update parameters of BLE connection.
6.1.12.1. Query command
Function
Query the parameters of BLE connection.
Command
AT+BLECONNPARAM?
Response
+BLECONNPARAM:<conn_index>,<min_interval>,<max_interval>,<cur_interval>,<latency>,<timeout> OK
6.1.12.2. Set command
Function
Update the parameters of BLE connection.
Command
AT+BLECONNPARAM=<conn_index>,<min_interval>,<max_interval>,<latency>,<timeout>
Response
OK
If the setting fails, it will prompt the message below:
ERROR
6.1.12.3. Parameters
- <conn_index>: index of BLE connection. Range: [0,1].
- <min_interval>: minimum connecting interval. It should be less than or equal to the value of <max_interval>. The range of this parameter is [0x0006,0x0C80]-->[6,3200]. The actual connecting interval equals this parameter multiplied by 1.25 ms, so the range for the actual minimum interval is [7.5,4000] ms.
- <max_interval>: maximum connecting interval. It should be more than or equal to the value of <min_interval>. The range of this parameter is [0x0006,0x0C80]-->[6,3200]. The actual connecting interval equals this parameter multiplied by 1.25 ms, so the range for the actual maximum interval is [7.5,4000] ms.
- <cur_interval>: current connecting interval.
- <latency>: latency. Range: [0, 499].
- <timeout>: timeout. The range of this parameter is [0x000A,0x0C80]-->[10,3200] ms. The actual timeout equals this parameter multiplied by 10 ms, so the range for the actual timeout is [100,32000] ms.
6.1.12.4. Example
AT+BLEINIT=1 // Role: client AT+BLECONN=0,"11:22:33:44:55:66",0,10 AT+BLECONNPARAM=0,12,14,1,500
6.1.13. AT+BLEDISCONN
Function: End BLE connection.
6.1.13.1. Execute command
Function
End the BLE connection.
Command
AT+BLEDISCONN=<conn_index>
Response
OK // The AT+BLEDISCONN command is received. +BLE:DISCONNECTED:<conn_index>,<remote_address> // The command is successful.
6.1.13.2. Parameters
- <conn_index>:index of BLE connection. Range: [0,1].
- <remote_address>: remote BLE address.
6.1.13.3. Example
AT+BLEINIT=1 // Role: client AT+BLECONN=0,"11:22:33:44:55:66",0,10 AT+BLEDISCONN=0
6.1.14. AT+BLEDATALEN
Function: Set the length of BLE data packet.
6.1.14.1. Query command
Function
Set the length of BLE data packet.
Command
AT+BLEDATALEN=<conn_index>,<tx_octets>,<tx_time>
Response
OK
6.1.14.2. Parameters
- <conn_index>: index of BLE connection. Range: [0,1].
- <tx_octets>: data packet’s length. Range: [27,251].
- <tx_time>: data packet transition time: Range: [328, 17040] ms.
Notes: The BLE connection has to be established first.
6.1.14.3. Example
AT+BLEINIT=1 // Role: client AT+BLECONN=0,"11:22:33:44:55:66",0,10 AT+BLEDATALEN=0,251,2120
6.1.15. AT+BLEEXCHANGEMTU
Function: Exchange BLE MTU Length.
6.1.15.1. Set command
Function
Set the length of the maximum transmission unit (MTU).
Command
AT+BLEEXCHANGEMTU=<conn_index>
Response
OK +BLE:MTUSIZE:<conn_index>,<MTU>
6.1.15.2. Parameters
- <conn_index>: index of BLE connection. Range: [0,1].
6.1.15.3. Example
AT+BLEINIT=1 // Role: client AT+BLECONN=0,"11:22:33:44:55:66",0,10 AT+BLEEXCHANGEMTU=0
6.1.16. AT+BLEGATTSSRV
Function: GATTS Discovers Services.
6.1.16.1. Query command
Function
GATTS Discovers Services.
Command
AT+BLEGATTSSRV?
Response
+BLEGATTSSRV:<srv_index>,<srv_uuid>,<srv_type>,<uuid_type> OK
6.1.16.2. Parameters
- <srv_index>: service’s index starting from 0 to 2
- <srv_uuid>: service’s UUID
- <srv_type>: service’s type
- 0: not primary service
- 1: primary service
- <uuid_type>: uuid’s type
- 0: 16-bit UUID
- 2: 128-bit UUID
6.1.16.3. Example
AT+BLEINIT=2 // Role: server AT+BLEGATTSSRV?
6.1.17. AT+BLEGATTSSRVCRE
Function: GATTS Creates Services.
6.1.17.1. Set command
Function
The Generic Attributes Server (GATTS) creates BLE services.
Command
AT+BLEGATTSSRVCRE=<srv_index>,<srv_uuid>,<srv_type>,<uuid_type>
Response
OK
6.1.17.2. Parameters
- <srv_index>: service’s index starting from 0 to 2
- <srv_uuid>: service’s UUID
- <srv_type>: service’s type
- 0: not primary service
- 1: primary service
- <uuid_type>: uuid’s type
- 0: 16-bit UUID
- 2: 128-bit UUID
6.1.17.3. Example
AT+BLEINIT=2 // Role: server AT+BLEGATTSSRVCRE=0,"01020304010203040102030401020304",1,2
6.1.18. AT+BLEGATTSSRVDEL
Function: GATTS Delete Services.
6.1.18.1. Set command
Function
The Generic Attributes Server (GATTS) delete BLE services.
Command
AT+BLEGATTSSRVDEL=<srv_index>
Response
OK
6.1.18.2. Parameter
- <srv_index>: service’s index starting from 0 to 2
6.1.18.3. Example
AT+BLEINIT=2 // Role: server AT+BLEGATTSSRVDEL=0
6.1.19. AT+BLEGATTSREGISTER
Function: GATTS services Register/Unregister.
6.1.19.1. Set command
Function
GATTS services Register/Unregister..
Command
AT+BLEGATTSREGISTER=<enable>
Response
OK
6.1.19.2. Parameter
- <enable>: 1 : Register 0: Unregister
6.1.19.3. Example
AT+BLEINIT=2 // Role: server AT+BLEGATTSSRVCRE=0,"01020304010203040102030401020304",1,2 //create service first AT+BLEGATTSCHARCRE=0,0,"01020304010203040102030401020305",2,3,2 //write property(read) (read|write) AT+BLEGATTSREGISTER=1 //Register Service
6.1.20. AT+BLEGATTSCHAR
Function: GATTS Discovers Characteristics.
6.1.20.1. Query command
Function
GATTS discovers characteristics.
Command
AT+BLEGATTSCHAR?
Response
+BLEGATTSCHAR:<srv_index>,<char_index>,<char_uuid>,<char_prop>,<char_perm>,<uuid_type> OK
6.1.20.2. Parameters
- <srv_index>: service’s index starting from 0 to 2
- <char_index>: characteristic’s index starting from 0 to 4
- <char_uuid>: characteristic’s UUID
- <char_prop>: characteristic’s property
- 2: characteristic read property
- 4: characteristic write without response property
- 8: characteristic write with response property
- 16: characteristic notify property
- 32: characteristic indicate property
- <char_perm>: characteristic’s permissions
- 1: read permissions
- 2: write permissions
- <uuid_type>: uuid’s type
- 0: 16-bit UUID
- 2: 128-bit UUID
6.1.21. AT+BLEGATTSCHARCRE
Function: GATTS Creates Characteristics.
6.1.21.1. Set command
Function
The Generic Attributes Server (GATTS) creates BLE servic's characteristics.
Command
AT+BLEGATTSCHARCRE=<srv_index>,<char_index>,<char_uuid>,<char_prop>,<char_perm>,<uuid_type>
Response
Recv <length> bytes SEND OK
6.1.21.2. Parameters
- <srv_index>: service’s index starting from 0 to 2
- <char_index>: characteristic’s index starting from 0 to 4
- <char_uuid>: characteristic’s UUID
- <char_prop>: characteristic’s property
- 2: characteristic read property
- 4: characteristic write without response property
- 8: characteristic write with response property
- 16: characteristic notify property
- 32: characteristic indicate property
- <char_perm>: characteristic’s permissions
- 1: read permissions
- 2: write permissions
- <uuid_type>: uuid’s type
- 0: 16-bit UUID
- 2: 128-bit UUID
6.1.21.3. Example
AT+BLEINIT=2 // Role: server AT+BLEGATTSSRVCRE=0,"01020304010203040102030401020304",1,2 //create service first AT+BLEGATTSCHARCRE=0,0,"01020304010203040102030401020305",2,3,2 //write property(read) (read|write)
6.1.22. AT+BLEGATTSNTFY
Function: Notify the Characteristic Value from the Server to a Client.
6.1.22.1. Set command
Function
Notify the Characteristic Value from the Server to a Client.
Command
AT+BLEGATTSNTFY=<srv_index>,<char_index>,<length>
Response
>
The symbol > indicates that AT is ready for receiving serial data, and you can enter data now. When the requirement of data length determined by the parameter <length> is met, the notification starts.
If the data transmission is successful, AT returns:
Recv <length> bytes SEND OK
6.1.22.2. Parameters
- <srv_index>: service’s index starting from 0 to 2
- <char_index>: characteristic’s index starting from 0 to 4
- <length>: maximum data length is 244.
6.1.22.3. Example
AT+BLEINIT=2 // Role: server AT+BLEGATTSSRVCRE=0,"01020304010203040102030401020304",1,2//create service first AT+BLEGATTSCHARCRE=0,0,"01020304010203040102030401020305",8,2,2 //notify property AT+BLEGATTSREGISTER=1 //Register Service AT+BLEGATTSNTFY=0,0,4 // After the symbol ">" shows, enter the 4-byte data, such as "1234". Then the data will be transmitted automatically.
6.1.23. AT+BLEGATTSIND
Function: Indicate the Characteristic Value from the Server to a Client.
6.1.23.1. Set command
Function
Indicate the Characteristic Value from the Server to a Client.
Command
AT+BLEGATTSIND=<srv_index>,<char_index>,<length>
Response
>
The symbol > indicates that AT is ready for receiving serial data, and you can enter data now. When the requirement of data length determined by the parameter <length> is met, the notification starts.
If the data transmission is successful, AT returns:
Recv <length> bytes SEND OK
6.1.23.2. Parameters
- <srv_index>: service’s index starting from 0 to 2
- <char_index>: characteristic’s index starting from 0 to 4
- <length>: maximum data length is 244.
6.1.23.3. Example
AT+BLEINIT=2 // Role: server AT+BLEGATTSSRVCRE=0,"01020304010203040102030401020304",1,2 //create service first AT+BLEGATTSCHARCRE=0,0,"01020304010203040102030401020305",16,2,2 //indicate property AT+BLEGATTSREGISTER=1 //Register Service AT+BLEGATTSIND=0,0,4 // After the symbol ">" shows, enter the 4-byte data, such as "1234". Then the data will be transmitted automatically.
6.1.24. AT+BLEGATTSRD
Function: Set the data when Client read characteristic from the Server.
6.1.24.1. Set command
Function
Set the data when Client read characteristic from the Server.
Command
AT+BLEGATTSRD=<srv_index>,<char_index>,<length>
Response
>
The symbol > indicates that AT is ready for receiving serial data, and you can enter data now. When the requirement of data length determined by the parameter <length> is met, the notification starts.
If the data transmission is successful, AT returns:
Recv <length> bytes SEND OK
6.1.24.2. Parameters
- <srv_index>: service’s index starting from 0 to 2
- <char_index>: characteristic’s index starting from 0 to 4
- <length>: maximum data length is 244.
6.1.24.3. Example
AT+BLEINIT=2 // Role: server AT+BLEGATTSSRVCRE=0,"01020304010203040102030401020304",1,2 //create service first AT+BLEGATTSCHARCRE=0,0,"01020304010203040102030401020305",1,2,2 //read property AT+BLEGATTSREGISTER=1 //Register Service AT+BLEGATTSRD=0,0,4 // After the symbol ">" shows, enter the 4-byte data, such as "1234". Then the data will be transmitted automatically when Client read characteristic from the Server.
6.1.25. AT+BLEGATTCSRVDIS
Function: GATTC discover services.
6.1.25.1. Set command
Function
GATTC discover services.
Command
AT+BLEGATTCSRVDIS=<conn_index>
Response
+BLE:SRV:<conn_index>,<srv_index>,<srv_uuid>,<srv_type>,<start_handle>,<end_handle> OK
6.1.25.2. Parameters
- <conn_index>: index of BLE connection. Range: [0,1].
- <srv_index>: service’s index starting from 1.
- <srv_uuid>: service’s UUID.
- <srv_type>: service’s type
- 0: not primary service
- 1: primary service
Notes: The BLE connection has to be established first.
6.1.25.3. Example
AT+BLEINIT=1 // Role: client AT+BLECONN=0,"11:22:33:44:55:66",0,10 AT+BLEGATTCSRVDIS=0
6.1.26. AT+BLEGATTCCHARDIS
Function: GATTC discover characteristics.
6.1.26.1. Set command
Function
GATTC discover characteristics.
Command
AT+BLEGATTCCHARDIS=<conn_index>,<srv_index>
Response
+BLE:SRVCHAR=<conn_index>,<srv_index>,<char_index>,<char_uuid>,<char_prop>,<char_handle>,<char_value_handle> OK
6.1.26.2. Parameters
- <conn_index>: index of BLE connection. Range: [0,1].
- <srv_index>: service’s index starting from 1.
- <char_index>: characteristic's index starting from 1.
- <char_uuid>: characteristic's UUID.
- <char_prop>: characteristic’s property
- 1: characteristic read property
- 2: characteristic write without response property
- 4: characteristic write with response property
- 8: characteristic notify property
- 16: characteristic indicate property
Notes: The BLE connection has to be established first and the service needs to be discovered first.
6.1.26.3. Example
AT+BLEINIT=1 // Role: client AT+BLECONN=0,"11:22:33:44:55:66",0,10 AT+BLEGATTCSRVDIS=0 AT+BLEGATTCCHARDIS=0,1
6.1.27. AT+BLEGATTCWR
Function: GATTC writes characteristics.
6.1.27.1. Set command
Function
GATTC writes characteristics.
Command
AT+BLEGATTCWR=<conn_index>,<srv_index>,<char_index>,<length>
Response
>
The symbol > indicates that AT is ready for receiving serial data, and you can enter data now. When the requirement of data length determined by the parameter <length> is met, the notification starts.
If the data transmission is successful, AT returns:
Recv <length> bytes SEND OK
6.1.27.2. Parameters
- <conn_index>: index of BLE connection. Range: [0,1].
- <srv_index>: service’s index starting from 1.
- <char_index>: characteristic’s index starting from 1.
- <length>: maximum data length is 244.
6.1.27.3. Example
AT+BLEINIT=1 // Role: client AT+BLECONN=0,"11:22:33:44:55:66",0,10 AT+BLEGATTCSRVDIS=0 AT+BLEGATTCCHARDIS=0,1 AT+BLEGATTCWR=0,1,2,4 // After the symbol ">" shows, enter the 4-byte data, such as "1234". Then the data will be transmitted automatically.
6.1.28. AT+BLEGATTCRD
Function: GATTC read characteristics.
6.1.28.1. Set command
Function
GATTC read characteristics.
Command
AT+BLEGATTCRD=<conn_index>,<srv_index>,<char_index>
Response
+BLE:GATTREAD:<conn_index>,<srv_index>,<char_index>,<length> OK
6.1.28.2. Parameters
- <conn_index>: index of BLE connection. Range: [0,1].
- <srv_index>: service’s index starting from 1.
- <char_index>: characteristic’s index starting from 1.
- <length>: data length
6.1.28.3. Example
AT+BLEINIT=1 // Role: client AT+BLECONN=0,"11:22:33:44:55:66",0,10 AT+BLEGATTCSRVDIS=0 AT+BLEGATTCCHARDIS=0,1 AT+BLEGATTCRD=0,1,1
6.1.29. AT+BLEGATTCSUBSCRIBE
Function: GATTC subscribe server.
6.1.29.1. Set command
Function
GATTC subscribe server.
Command
AT+BLEGATTCSUBSCRIBE=<conn_index>,<ccc_handle>,<value_handle>,<value>
Response
OK
6.1.29.2. Parameters
- <conn_index>: index of BLE connection. Range: [0,1].
- <ccc_handle>: Client Characteristic Configuration Descriptor handle.
- <value_handle>: Characteristic value handle.
- <value>: 1: notification 2: indication
6.1.29.3. Example
AT+BLEINIT=1 // Role: client AT+BLECONN=0,"11:22:33:44:55:66",0,10 AT+BLEGATTCSUBSCRIBE=0,15,14,1
6.1.30. AT+BLEGATTCUNSUBSCRIBE
Function: GATTC unsubscribe server.
6.1.30.1. Set command
Function
GATTC unsubscribe server.
Command
AT+BLEGATTCUNSUBSCRIBE=<conn_index>,<value_handle>
Response
OK
6.1.30.2. Parameters
- <conn_index>: index of BLE connection. Range: [0,1].
- <value_handle>: Characteristic value handle.
6.1.30.3. Example
AT+BLEINIT=1 // Role: client AT+BLECONN=0,"11:22:33:44:55:66",0,10 AT+BLEGATTCUNSUBSCRIBE=0,14
6.1.31. AT+BLETXPWR
Function: Query/Set BLE TX power.
6.1.31.1. Query command
Function
Query BLE TX power.
Command
AT+BLETXPWR?
Response
+BLETXPWR:<tx_power> Range: [0,20]. OK
6.1.31.2. Set command
Function
Set BLE TX power.
Command
AT+BLETXPWR=<tx_power>
Response
OK
6.1.31.3. Parameter
- <tx_power>: tx power
6.1.31.4. Example
AT+BLEINIT=1 // or AT+BLEINIT=2 AT+BLETXPWR=10
6.1.32. AT+BLESECPARAM
Function: Set/Query BLE security parameter
6.1.32.1. Query command
Function
Query BLE security parameter.
Command
AT+BLESECPARAM?
Response
+BLESECPARAM:<security parameter> OK
6.1.32.2. Set command
Function
Set BLE security parameter.
Command
AT+BLESECPARAM=<security parameter>
Response
OK
6.1.32.3. Parameter
- *; <security parameter>: <security parameter>
- *;* BT_SMP_IO_DISPLAY_ONLY 0
- BT_SMP_IO_DISPLAY_YESNO 1
- BT_SMP_IO_KEYBOARD_ONLY 2
- BT_SMP_IO_NO_INPUT_OUTPUT 3
- BT_SMP_IO_KEYBOARD_DISPLAY 4
6.1.32.4. Example
AT+BLEINIT=1 // or AT+BLEINIT=2 AT+BLESECPARAM=4 // BT_SMP_IO_KEYBOARD_DISPLAY
6.1.33. AT+BLESECCANNEL
Function: BLE Cancel Pairing.
6.1.33.1. Set command
Function
BLE Cancel Pairing.
Command
AT+BLESECCANNEL=<conn_index>
Response
OK
6.1.33.2. Parameters
- <conn_index>: index of BLE connection. Range: [0,1].
6.1.33.3. Example
AT+BLESECCANNEL=0
6.1.34. AT+BLESECPASSKEYCONFIRM
Function: BLE Pairing passkey confirm .
6.1.34.1. Set command
Function
BLE Pairing passkey confirm .
Command
AT+BLESECPASSKEYCONFIRM=<conn_index>
Response
OK
6.1.34.2. Parameters
- <conn_index>: index of BLE connection. Range: [0,1].
6.1.34.3. Example
AT+BLESECPASSKEYCONFIRM=0
6.1.35. AT+BLESECPAIRINGCONFIRM
Function: BLE Pairing passkey confirm .
6.1.35.1. Set command
Function
BLE Pairing confirm .
Command
AT+BLESECPAIRINGCONFIRM=<conn_index>
Response
OK
6.1.35.2. Parameters
- <conn_index>: index of BLE connection. Range: [0,1].
6.1.35.3. Example
AT+BLESECPAIRINGCONFIRM=0
6.1.36. AT+BLESECPASSKEY
Function: BLE Pairing pass entry.
6.1.36.1. Set command
Function
BLE Pairing pass entry.
Command
AT+BLESECPASSKEY=<conn_index>,<passkey>
Response
OK
6.1.36.2. Parameters
- <conn_index>: index of BLE connection. Range: [0,1].
- <passkey>: pairing passkey. Range: [0,999999].
6.1.36.3. Example
AT+BLESECPASSKEY=0,123456
6.1.37. AT+BLESECGETLTKLIST
Function: Query BLE Paired deviceList.
6.1.37.1. Query command
Function
Query BLE Paired deviceList.
Command
AT+BLESECGETLTKLIST?
Response
+BTADDR 12:34:56:78:00:11 (public) LTK:01234567890123456789012345678900 OK
6.1.38. AT+BLESECUNPAIR
Function: BLE unpairing.
6.1.38.1. Set command
Function
BLE unpairing.
Command
AT+BLESECUNPAIR=<address>,<addrtype>
Response
OK
6.1.38.2. Parameters
- <addr>: BLE address.
- <addr_type>: BLE address type.
6.1.38.3. Example
AT+BLESECUNPAIR="12:34:56:78:00:12",0
6.1.39. AT+BLESECSTART
Function: BLE start pairing.
6.1.39.1. Set command
Function
BLE start pairing.
Command
AT+BLESECSTART=<conn_index>,<sec_level>
Response
OK
if error in pairing
+BLE:PAIRINGFAILED: <addr>
+BLE:DISCONNECTED:<conn_index>,<addr>
6.1.39.2. Parameters
- <conn_index>: index of BLE connection. Range: [0,1].
- *; <sec_level>: Security level. Range: [0,4].
- *;* BT_SECURITY_L0 0 : Only for BR/EDR special cases, like SDP.
- BT_SEC_LEVEL_1 1
- No encryption and no authentication.
- BT_SEC_LEVEL_2 2 : Encryption and no authentication (no MITM).
- BT_SEC_LEVEL_3 3 : Encryption and authentication (MITM).
- BT_SEC_LEVEL_4 4 : Authenticated Secure Connections and 128-bit key.
6.1.39.3. Example
AT+BLESECSTART=0,4
6.1.40. AT+BLEBASINIT
Function
Initialize the Bluetooth BAS profile.
6.1.40.1. Execute command
Command
AT+BLEBASINIT
Response
OK
6.1.41. AT+BLEBASDEINIT
Function
Deinitialize the Bluetooth BAS profile.
6.1.41.1. Execute command
Command
AT+BLEBASDEINIT
Response
OK
6.1.42. AT+BLEBASLVLGET
Function: Query BLE BAS level.
6.1.42.1. Query command
Function
Query BLE BAS level.
Command
AT+BLEBASLVLGET?
Response
+BLEBASLEVEL:100 (level) OK
6.1.43. AT+BLEBASLVLSET
Function
Set BLE BAS level.
6.1.43.1. Setup command
Command
AT+BLEBASLVLSET=<conn idx>,<level>
Response
OK
6.1.43.2. Parameters
- <conn_index>: index of BLE connection. Range: [0,1].
- <level>: battery level. Range: [0,100].
6.1.43.3. Example
AT+BLEBASLVLSET=0,100
6.1.44. AT+BLEIASINIT
Function
Initialize the Bluetooth IAS profile.
6.1.44.1. Execute command
Command
AT+BLEIASINIT
Response
OK
6.1.45. AT+BLEIASDEINIT
Function
Deinitialize the Bluetooth IAS profile.
6.1.45.1. Execute command
Command
AT+BLEIASDEINIT
Response
OK
6.1.46. AT+BLEDISINIT
Function
Initialize the Bluetooth DIS profile.
6.1.46.1. Setup command
Command
AT+BLEDISINIT=<pnp_vid_src>,<pnp_vid>,<pnp_pid>,<pnp_ver>
Response
OK
6.1.46.2. Parameters
- *; <pnp_vid_src>
- *;* range: <0,255>
- *; <pnp_vid>
- *;* range: <0,65535>
- *; <pnp_pid>
- *;* range: <0,65535>
- *; <pnp_ver>
- *;* range: <0,65535>
6.1.46.3. Example
AT+BLEDISINIT=100,101,102,103
6.1.47. AT+BLEDISDEINIT
Function
Deinitialize the Bluetooth DIS profile.
6.1.47.1. Execute command
Command
AT+BLEDISDEINIT
Response
OK
6.1.48. AT+BLEDISSET
Function
SET the Bluetooth DIS profile.
6.1.48.1. Setup command
Command
AT+BLEDISSET=<parameter_name>,<parameter_value>,<parameter_len>
Response
OK
6.1.48.2. Parameters
- *; <parameter_name>:
- *;* "manuf" : Manufacturer Name String
- "model"
- Model Number String
- "serial" : Serial Number String
- "fw" : Firmware Revision String
- "hw" : Hardware Revision String
- "sw" : Software Revision String
- <parameter_value>
- <parameter_len> Range: [0,21].
6.1.48.3. Example
AT+BLEDISSET="manuf","ST67W611M1",6
7. Low power AT commands
Instruction | Description |
---|---|
AT+PWR | Configure power mode |
AT+SLWKIO | Configure GPIO as wakeup source |
AT+DEWKIO | Delete GPIO as wakeup source |
AT+SLWKTIMER | Configure timer as wakeup source |
AT+GET_AP_DTIM | Query the current DTIM setting obtained by the STA |
AT+GET_TWT_SUPPORTED | Query whether TWT (Target Wake Time) is supported by the current firmware/platform |
AT+PWR_CLEAR | Clear/reset the internal power statistics/counters used by PWR_GET
|
AT+PWR_GET | Get the current averaged power value (unit defined by implementation) |
AT+SLWKDTIM | Configure DTIM |
AT+SLCLDTIM | Delete DTIM config |
AT+TWT_PARAM | Setup TWT parameters |
AT+TWT_SLEEP | Enter TWT low power |
AT+TWT_TEARDOWN | Tear down TWT |
AT+TWT_STATUS | Get TWT status |
AT+LP_INTERVAL_GET | Query the station listen interval value for power saving mode |
AT+START_KEEPALIVE | Start sending keepalive frames |
AT+STOP_KEEPALIVE | Stop sending keepalive frames |
AT+GET_CLOCK | Get the current clock source |
AT+SET_CLOCK | Set the system clock source |
7.1. Low power AT commands
7.1.1. AT+PWR
Function: Configure power mode
7.1.1.1. Execute command
Command
AT+PWR=<power mode>[,<level>]
Response
OK
7.1.1.2. Parameters
- *; <power mode>:
- *;* 0: normal mode.
- 1
- hibernate mode.
- 2: standby mode.
- [<level>]: In hibernate mode, power level 0-2; In standby mode, 1 - enable receive broadcast package.
7.1.1.3. Example
AT+PWR=0 // Normal mode AT+PWR=1,0 // Hbn mode, level 0. AT+PWR=2 // Standby mode AT+PWR=2,1 // Standby mode, enable receive broadcast package
7.1.2. AT+SLWKIO
Function: Configure GPIO as wakeup source.
7.1.2.1. Execute command
Command
AT+SLWKIO=<wakeup io>,<trigger mode>
Response
OK
7.1.2.2. Parameters
- <wakeup io>: GPIO wake-up IO number. supports only GPIO 16 or GPIO 28
- *; <trigger mode>: wakeup trigger Mode
- *;* 0: Wake-up by high level
Notes: The current implementation uses a five-wire SPI low-power solution, so the wake-up method is not configurable and only supports high-level wake-up.
7.1.3. AT+DEWKIO
Function: Delete GPIO as wakeup source.
7.1.3.1. Execute command
Command
AT+DEWKIO=<io>
Response
OK
7.1.3.2. Parameters
- <io>: GPIO wake-up IO number.
7.1.4. AT+SLWKTIMER
Function: Configure timer as wakeup source.
7.1.4.1. Set command
Command
AT+SLWKTIMER=<mode>,<timeouts>
Response
OK
7.1.4.2. Parameter
- <mode>: 0, standby mode, 1 hibernate mode
- <timeouts>: Set the wake-up duration in milliseconds. One-time wake-up timer, does not enter sleep again after waking up (unless a new wake-up timer is configured again)
7.1.4.3. Example
AT+SLWKTIMER=0,5000 //Standby mode, Wake up once next 5000ms
7.1.5. AT+GET_AP_DTIM
Function: Query the current DTIM setting obtained by the STA (as reported by firmware).
7.1.5.1. Query command
Command
AT+GET_AP_DTIM?
Response
+DTIM:<dtim> OK
7.1.5.2. Return codes
OK
— Query succeeded.ERROR
— Query failed.
7.1.5.3. Example
AT+GET_AP_DTIM? +DTIM:3 OK
7.1.6. AT+GET_TWT_SUPPORTED
Function: Query whether TWT (Target Wake Time) is supported by the current firmware/platform.
7.1.6.1. Query Command
Command
AT+GET_TWT_SUPPORTED?
Response
+TWT_SUPPORT:<support> OK
Where <support>
is: - 0
— Not supported - 1
— Supported
7.1.6.2. Return codes
OK
— Query succeeded.ERROR
— Query failed.
7.1.6.3. Example
AT+GET_TWT_SUPPORTED? +TWT_SUPPORT:1 OK
7.1.7. AT+PWR_CLEAR
Function: Clear/reset the internal power statistics/counters used by PWR_GET
.
7.1.7.1. Execute command
Command
AT+PWR_CLEAR
Response
OK
7.1.7.2. Return codes
OK
— Operation succeeded.
7.1.7.3. Example
AT+PWR_CLEAR OK
7.1.8. AT+PWR_GET
Function: Get the current averaged power value (unit defined by implementation).
7.1.8.1. Execute Command
Command
AT+PWR_GET
Response
+AVERAGE PWR:<value> OK
7.1.8.2. Return codes
OK
— Query succeeded.
7.1.8.3. Example
AT+PWR_GET +AVERAGE PWR:1969 OK
7.1.9. AT+SLWKDTIM
Function: Configure DTIM as wakeup source
7.1.9.1. Set command
Command
AT+SLWKDTIM=<dtim>
Response
OK
7.1.9.2. Parameter
- <dtim>: Set the wakeup DTIM.
7.1.9.3. Example
AT+SLWKDTIM=10 // Set dtim10 for wakeup.
7.1.10. AT+SLCLDTIM
Function: Delete DTIM config
7.1.10.1. Set command
Command
AT+SLCLDTIM
Response
OK
7.1.10.2. Example
AT+SLCLDTIM
7.1.11. AT+TWT_PARAM
Function: Setup TWT parameters.
7.1.11.1. Set command
Command
AT+TWT_PARAM=<setup type>,<flow type>,<exponent>,<wakeup duration>,<wake interval mantissa>
Response
OK
7.1.11.2. Parameter
- Setup type (s): 0:REQUEST, 1:SUGGEST, 2:DEMAND.
- Flow type (t): 0:ANNOUNCED TWT, 1:UNANNOUNCED TWT. Only supports unannounced TWT.
- Wake Interval Exponent: Specifies the wake interval
- Wake Duration (n): Minimum wake duration in microseconds.
- Wake Interval Mantissa (m): Mantissa value for precise interval adjustments.
- Service Period (SP): SP = WakeDuration * 256us.
- Wakeup Interval: Wakeup Interval = wake_int_mantissa << WakeIntervalExponent us.
7.1.11.3. Example
AT+TWT_PARAM=1,1,13,128,1000 //SP = 32.768 ms, Wake Interval = 8.192 seconds:
7.1.11.4. Note
- REQUEST Setup type: The target wake time field of the TWT element is set to 0 as the responding STA/AP specifies the target wake time value in this case. Other fields are suggested by requesting STA.
- SUGGEST Setup type: TWT requesting STA will suggest the target wake time and other parameters during setup. Responding STA may / may not accommodate the suggested value. TWT Connection will still be accepted with values suggested by requesting STA or the values provided by responding STA.
- DEMAND Setup type: TWT requesting STA will demand the target wake time and other parameters during setup. If responding STA cannot accommodate the suggested value, TWT setup will fail.
- Equation to calculate Service Period: Service Period (SP) = (<wakeup duration>/10) ms
- Example: AT+TWT_PARAM=1,1,13,128,1000 : SP = (128/10) = 12.8 ms
- Equation to calculate TWT Wake Interval: TWT Wake Interval = ((2^<exponent>)/<wake interval mantissa>) s
- Example: AT+TWT_PARAM=1,1,13,128,1000 : TWT Wake Interval = ((2^12)/1000) = 8.192 s
7.1.12. AT+TWT_SLEEP
Function: Enter TWT low power
7.1.12.1. Set command
Command
AT+TWT_SLEEP
Response
OK
7.1.12.2. Example
AT+TWT_SLEEP
7.1.13. AT+TWT_TEARDOWN
Function: Teardown the Target Wake Time (TWT) session.
7.1.13.1. Set command
Command
AT+TWT_TEARDOWN=<neg_type>,<all_twt>[,<flow_id>]
Response
OK
or
ERROR
7.1.13.2. Parameters
<neg_type>: TWT negotiation type.
- 0: Individual negotiation (TWT teardown will be performed for the specified TWT flow).
- 1: Negotiate TWT teardown on the next wake TBTT (Target Beacon Transmission Time). Currently not supported.
<all_twt>: Specifies whether to teardown all TWT flows.
- 0: Teardown only the specified TWT flow (specified by <flow_id> parameter).
- 1: Teardown all existing TWT flows.
<flow_id>: The TWT flow ID to be torn down. This parameter is required when <all_twt> is set to 0.
Notes:
- Internal RC errors can result in wake interval inaccuracies (for example, 60 ms deviation over 30 seconds).
- External Oscillator Requirement: Testing must be conducted on boards with external crystal oscillators to minimize RTC clock deviation.
- Router Compatibility: Use a TWT-compatible router for testing (for example, TP-Link AX5400).
- Currently, only Individual negotiation type (0) is supported.
- When <all_twt>=1, the <flow_id> parameter is not needed.
- The device must be in TWT mode before using this command.
7.1.13.3. Example
// Teardown a specific TWT flow with ID 1 AT+TWT_TEARDOWN=0,0,1 // Teardown all TWT flows AT+TWT_TEARDOWN=0,1
7.1.14. AT+TWT_STATUS
Function: Query current TWT (Target Wake Time) session status.
7.1.14.1. Execute command
Command
AT+TWT_STATUS?
Response
If TWT is active:
+TWT:ACTIVE:<flow_id>,<flow_type>,<flow_type_str>,<wake_int_exp>,<min_wake_dur>,<wake_int_mantissa> OK
If no active TWT session:
+TWT:INACTIVE OK
7.1.14.2. Parameters
- <flow_id>: ID of the TWT flow
- <flow_type>: Type of TWT flow (0 for Announced, 1 for Unannounced)
- <flow_type_str>: Text description of flow type ("ANNOUNCED" or "UNANNOUNCED")
- <wake_int_exp>: Wake interval exponent
- <min_wake_dur>: Minimum TWT wake duration
- <wake_int_mantissa>: Wake interval mantissa
7.1.14.3. Example
AT+TWT_STATUS? +TWT:ACTIVE:0,1,UNANNOUNCED,10,255,512 OK
7.1.15. AT+LP_INTERVAL_GET
Function: Query the station listen interval value for power saving mode.
7.1.15.1. Query Command
Command
AT+LP_INTERVAL_GET
Response
+LP INTERVAL:<interval> OK
7.1.15.2. Parameters
- <interval>: Listen interval value, specified as how often the STA wakes up to listen to beacon frames when in power save mode.
7.1.16. AT+START_KEEPALIVE
Function: Start sending Null data frames at regular intervals to maintain AP connection.
7.1.16.1. Set command
Command
AT+START_KEEPALIVE=<period>
Response
OK
7.1.16.2. Parameters
- <period>: The interval between Null data frame transmissions, in seconds.
Notes:
- This command creates a timer that periodically sends Null data frames to the connected AP to prevent connection timeout during periods of inactivity.
- This can be useful for maintaining connection with APs that have aggressive client timeout settings.
- The feature will only work when connected to an AP.
7.1.16.3. Example
AT+START_KEEPALIVE=30 OK
7.1.17. AT+STOP_KEEPALIVE
Function: Stop the periodic Null data frame transmission.
7.1.17.1. Execute command
Command
AT+STOP_KEEPALIVE
Response
OK
Notes:
- This command stops the timer created by AT+START_KEEPALIVE.
- If no keepalive timer is active, the command will still return OK.
7.1.17.2. Example
AT+STOP_KEEPALIVE OK
7.1.18. AT+GET_CLOCK
Function: Get current clock source.
7.1.18.1. Execute command
Command
AT+GET_CLOCK
Response
+GET_CLOCK:<source> OK
7.1.18.2. Parameters
- *; <source>: Current clock source ID.
- *;* 1: RC as the RTC clock source
- 2
- Passive crystal oscillator as the RTC clock source
- 3: Active crystal oscillator as the RTC clock source
7.1.18.3. Example
AT+GET_CLOCK // Response +GET_CLOCK:1 OK
7.1.19. AT+SET_CLOCK
Function: Set system clock source.
7.1.19.1. Execute command
Command
AT+SET_CLOCK=<source>
Response
OK
7.1.19.2. Parameters
- *; <source>: Clock source to set.
- *;* 1: RC as the RTC clock source
- 2
- Passive crystal oscillator as the RTC clock source
- 3: Active crystal oscillator as the RTC clock source
Notes:
- Changing the clock source may affect system performance and power consumption
- Some clock sources may not be available in certain power modes
7.1.19.3. Example
AT+SET_CLOCK=1 // Response OK
8. Set up secure communication
This section walk you through embedding certificates into firmware using ROMFS, setting up a local HTTPS server, configuring MQTT services with TLS authentication, and verify MQTT TLS connectivity between ST67W611M1 devices and HiveMQ brokers.
8.1. Embed certificates with ROMFS
Integrate certificate files into the firmware by embedding them within a ROMFS (Read Only Memory File System) partition. This enables the device to securely access essential credentials such as CA certificates and private keys at runtime, supporting secure operations including authentication and encrypted communication.
Create the ROMFS directory and add certificate files
Create a folder named
romfs
, and place the required certificate files inside it. The directory structure should look like this:romfs$ ca_01.crt cert_01.crt private_01.key
Generate
romfs.bin
using thegenromfs
toolUse the
genromfs
tool located in the SDK directory to generate the binary file. To automate this step, add the following command to yourMakefile
:$(shell ./tools/genromfs -d romfs/ -f ./build/build_out/romfs.bin)
Configure the flash settings
Open the
flash_prog_cfg.ini
file and add a new section for the ROMFS partition. Include the path to the generated binary and specify the flash address:#media factory [romfs] filedir = ./build/build_out/romfs.bin address = 0x378000
Make sure the
address
value matches the media partition address defined in the partition table.Locate the partition table
Identify the correct partition table file based on your chip configuration. The file will be located in one of the following paths:
bsp/board/<chip_name>/config/partition_cfg_4M.toml
bsp/board/<chip_name>/config_8M/partition_cfg_8M.toml
Flash the firmware including
romfs.bin
Run the firmware flashing command to download the firmware and the
romfs.bin
file into the chip:make flash CHIP=qcc743 COMX=<com_port>
8.2. Configure MQTT services with TLS authentication
Set up a secure local MQTT broker using Mosquitto and demonstrate the configuration of ST67W611M1 modules for publishing and subscribing to MQTT topics with various authentication options.
Install Mosquitto
Install the Mosquitto MQTT broker on your system:
sudo apt install mosquitto
Set MQTT user password
Create a password file and set a password for the user
ST67W611M1
:mosquitto_passwd -c /etc/mosquitto/passwd ST67W611M1
Enter the password twice when prompted. For example:
12345678
Configure certificates
Copy the required certificate and key files to the Mosquitto configuration directory:
cp {case_path}/lfs/lfs/server_1.crt /etc/mosquitto/server_1.crt cp {case_path}/lfs/lfs/server_1.key /etc/mosquitto/server_1.key cp {case_path}/lfs/lfs/ca_1.crt /etc/mosquitto/ca_1.crt
Start the MQTT service
Launch the Mosquitto broker with your configuration file:
mosquitto -c /etc/mosquitto/mosquitto.conf
Subscribe to a topic from PC
Use the following command to subscribe to a topic securely:
mosquitto_sub -h 192.168.31.156 -u ST67W611M1 -P 12345678 \ --cafile lfs/lfs/ca_1.crt --cert lfs/lfs/client_1.crt --key lfs/lfs/client_1.key \ -t "test/topic1" --tls-version tlsv1.2 --insecure
ST67W611M1 MQTT user configuration
Configure the ST67W611M1 device with user credentials and certificates:
AT+MQTTUSERCFG=0,4,"QC001","ST67W611M1","12345678","client_1.crt","client_1.key","ca_1.crt"
ST67W611M1 connect to MQTT broker
Connect the ST67W611M1 device to the MQTT broker:
AT+MQTTCONN=0,"192.168.31.156",8883,0
ST67W611M1 publish a message
Publish a message to a topic from the ST67W611M1 device:
AT+MQTTPUB=0,"test/topic1","This is a MQTT test",2,0
ST67W611M1 subscribe to a topic
Subscribe to a topic from the ST67W611M1 device:
AT+MQTTSUB=0,"test/topic2",0
Publish a message from PC
Use the following command to publish a message to the broker from your PC:
mosquitto_pub -h 192.168.31.156 -p 8883 -u ST67W611M1 -P 12345678 \ --cafile lfs/lfs/ca_1.crt --cert lfs/lfs/client_1.crt --key lfs/lfs/client_1.key \ -t "test/topic2" -m "Hello MQTT" --tls-version tlsv1.2 --insecure
Verify MQTT TLS connectivity between ST67W611M1 devices and HiveMQ brokers =================================================================== Verify MQTT TLS connectivity between ST67W611M1 devices and HiveMQ brokers using both serverless and starter plans. Demonstrate the configuration of one-way and two-way TLS authentication, set up Server Name Indication (SNI), and perform publish/subscribe operations to validate secure communication.
8.2.1. Verification steps for the serverless version
Download the broker Root CA certificate from HiveMQ (
isrgrootx1.pem
) and place it in:examples/wifi/spi_wifi/lfs/lfs/isrgrootx1.pem
Rebuild the project and flash the image:
cd examples/wifi/spi_wifi/ make # Use QConn_Flash tool to flash the image
Create a broker in the HiveMQ web console under the serverless plan. Set credentials:
- Username:
QC_test_0
- Password:
QC123456
- Permissions: Publish & Subscribe
Refer to HiveMQ documentation for detailed steps.
- Username:
Connect the ST67W611M1 device to the Wi-Fi AP:
AT+CWMODE=1 AT+CWJAP="8E88",""
Configure MQTT user settings (one-way TLS):
AT+MQTTUSERCFG=0,4,"ST67W611M1","user","QC123456","","","isrgrootx1.pem"
Configure MQTT SSL/TLS SNI:
AT+MQTTSNI=0,"8f3ef71da5bf445eb0669e56eecef396.s1.eu.hivemq.cloud"
Configure MQTT connection properties:
AT+MQTTCONNCFG=0,120,0,"","",0,0
Initiate MQTT connection:
AT+MQTTCONN=0,"8f3ef71da5bf445eb0669e56eecef396.s1.eu.hivemq.cloud",8883,0
Subscribe to all topics:
AT+MQTTSUB=0,"#",0
Publish a topic message:
AT+MQTTPUB=0,"/test/ST67W611M1","What's up guys",0,0
8.2.2. Verification steps for the starter version
Download the broker Root CA certificate (
isrgrootx1.pem
) and place it in:examples/wifi/spi_wifi/lfs/lfs/isrgrootx1.pem
Rebuild the project and flash the image:
cd examples/wifi/spi_wifi/ make # Use QConn_Flash tool to flash the image
Create a broker in the HiveMQ web console under the starter plan. Set credentials:
- Username:
QC_test_0
- Password:
QC123456
- Permissions: Publish & Subscribe
- Add
ca_1.crt
as the Root CA for verifying device certificates
Refer to HiveMQ documentation for detailed steps.
- Username:
Connect the ST67W611M1 device to the Wi-Fi AP:
AT+CWMODE=1 AT+CWJAP="8E88",""
Configure MQTT user settings (two-way TLS):
AT+MQTTUSERCFG=0,4,"ST67W611M1","QC_test_0","QC123456","client_1.crt","client_1.key","isrgrootx1.pem"
Configure MQTT SSL/TLS SNI:
AT+MQTTSNI=0,"indigosquash-2lk628.a02.usw2.aws.hivemq.cloud"
Configure MQTT connection properties:
AT+MQTTCONNCFG=0,120,0,"","",0,0
Initiate MQTT connection:
AT+MQTTCONN=0,"indigosquash-2lk628.a02.usw2.aws.hivemq.cloud",8883,0
Subscribe to all topics:
AT+MQTTSUB=0,"#",0
Publish a topic message:
AT+MQTTPUB=0,"/test/ST67W611M1","What's up guys",0,0