Microsoft 咋宎Luat Air602 WiFi模嚊AT Ex AT Command User Manual
Air602%20AT%20Command%20User%20Manual
User Manual:
Open the PDF directly: View PDF .
Page Count: 73
Download | |
Open PDF In Browser | View PDF |
Air602 AT Command User Manual V1.1 Created by Luat, translated by seeed Air602_AT Instruction User Manual Document version Version Data Modify record Author Review Approve V1.0.0 2018-03-29 create Mrbenlu Craoy Luat V1.0.1 2018-08-04 Improve documentation Mrbenlu Craoy Luat V1.0.2 2018-08-05 Improve documentation Mrbenlu Craoy Luat V1.1 Improve documentation, add 2018-08-08 examples, add MQTT Winny Bill Seeed Completed the English translation V1.1 English 2018-10-24 based on version 1.1 Luat Jelly 2 /73 Air602_AT Instruction User Manual Contents 1 Introduction ......................................................................................................................................................6 1.1 Overview....................................................................................................................................................6 . 1.2 Control Command Protocol........................................................................................................................6 1.2.1 Command Code..............................................................................................................................6 1.2.2 Error Code.......................................................................................................................................9 2 AT Command Protocol .............................................................................................................................. 10 2.1 Syntax Description................................................................................................................................... 10 2.2.1 Syntax Format............................................................................................................................... 10 2.1.1.1 Processing Flow................................................................................................................ 11 2.1.1.2 Example Format................................................................................................................ 12 2.2 Instruction Definition................................................................................................................................ 13 2.2.1 System Control Class Instruction................................................................................................. 13 2.2.1.1 Null Operation Instruction:AT+ ................................................................................... 13 2.2.1.2 System Reset:AT+Z ...................................................................................................... 13 2.2.1.3 settings Echo :AT+E ..................................................................................................... 14 2.2.1.4 Serial Port Enters Transparent Transmission Mode :AT+ENTM................................. 14 2.2.1.5 Enter Energy Saving Mode :AT+ENTS ......................................................................... 16 2.2.1.6 Reset Factory Settings :AT+RSTF................................................................................. 17 2.2.1.7 Save In-memory Parameters to FLASH :AT+PMTF ..................................................... 18 2.2.1.8 Get the physical address of the wireless network card in STA mode : AT+QMAC........19 2.2.1.9 Get the physical address of the wireless network card in SoftAP mode : AT+APMAC..19 2.2.1.10 Get Version :AT+QVER ................................................................................................ 20 2.2.2 Parameter Setting Class Instruction............................................................................................ 21 2.2.2.1 Wireless Netoperating mode :AT+WPRT.................................................................... 21 2.2.2.2 Query/set the local IP address in STA mode :AT+NIP ................................................ 22 2.2.2.3 Query/set the local IP address in SoftAP mode :AT+APNIP....................................... 23 2.2.2.4 Network Card DNS:AT+DNS......................................................................................... 24 2.2.2.5 Operating Mode:AT+ATM.............................................................................................. 24 3 /73 Air602_AT Instruction User Manual 2.2.2.6 Socket connection in automatic operating mode :AT+ATRM ............................. 25 2.2.2.7 Wireless Network Name :AT+SSID .................................................................... 27 2.2.2.8 SoftAP Wireless Network Name :AT+APSSID................................................... 27 2.2.2.9 Wireless Network Security Mode :AT+ENCRY.................................................. 28 2.2.2.10 SoftAP Wireless Network Security Mode :AT+APENCRY ................................. 29 2.2.2.11 Network Key :AT+KEY ....................................................................................... 30 2.2.2.12 SoftAP Network Key :AT+APKEY ....................................................................... 31 2.2.2.13 Set/query the BSSID address of the specified AP :AT+BSSID........................... 33 2.2.2.14 Set/query the specified wireless channel mode :AT+CHL................................ 33 2.2.2.15 Set / Query SoftAP Wireless Channel Mode :AT+APCHL .................................. 34 2.2.2.16 Wireless Channel List :AT+CHLL ......................................................................... 34 2.2.2.17 Enable automatic creation of adhoc network functions :AT+WATC................. 35 2.2.2.18 Turn automatic energy saving mode on/off :AT+WPSM................................... 35 2.2.2.19 Enable/disable AP SSID broadcast :AT+BRDSSID................................................ 37 2.2.2.20 UART Port Data Format:AT+UART ...................................................................... 37 2.2.2.21 Built-in enable WEB management server :AT+WEBS ........................................ 39 2.2.2.22 Device Name :AT+DNAME................................................................................... 39 2.2.2.23 System Login Password :AT+PASS ....................................................................... 39 2.2.2.24 Receiving User Data :AT+CUSTDATA................................................................... 40 2.2.2.25 Query the configured networking parameters :AT+CNTPARAM........................ 40 2.2.3 Network Control Class Instruction.......................................................................................... 41 2.2.3.1 Network Card Interface Mode:AT+PORTM ............................................................. 41 2.2.3.2 Get the IP address of the external domain name :AT+SKGHBN.......................... 42 2.2.3.3 Set / Query WPS Features :AT+WWPS ................................................................. 42 2.2.3.4 Join The Specified AP :AT+WJOIN......................................................................... 43 2.2.3.5 Disconnect the Current Network :AT+WLEAV...................................................... 45 2.2.3.6 Scan Wireless Network:AT+WSCAN..................................................................... 46 2.2.3.7 Query the local network connection status :AT+LKSTT....................................... 47 2.2.3.8 Set / Query SoftAP Status :AT+APLKSTT ............................................................... 48 2.2.3.9 Query the connected station :AT+SLIST............................................................... 50 2.2.3.10 Build a socket connection :AT+SKCT.................................................................... 50 4 /73 Air602_AT Instruction User Manual 2.2.3.11 Send data through the specified socket :AT+SKSND .......................................... 52 2.2.3.12 Read the data in the receive buffer of the specified socket :AT+SKRCV............ 53 2.2.3.13 Get the specified socket state :AT+SKSTT ........................................................... 54 2.2.3.14 Close the specified socket :AT+SKCLS ................................................................. 55 2.2.3.15 Set the socket sent by the system by default. :AT+SKSDF.................................. 55 2.2.3.16 Get the source IP address of the current socket received data :AT+SKSRCIP…. 56 2.2.3.17 Socket actively reports receiving data :AT+SKRPTM .......................................... 56 2.2.3.18 One-click configuration :AT+ONESHOT ............................................................... 57 2.2.3.19 HTTP client post get function :AT+HTTPC ........................................................... 58 2.2.4 MQTT Instruction................................................................................................................... 59 2.2.4.1 Set up the MQTT server :AT+MSERVER.............................................................. 59 2.2.4.2 Set login account and password :AT+MLOGIN................................................... 59 2.2.4.3 Set Client ID:AT+MID........................................................................................... 59 2.2.4.4 Connect to the MQTT server :AT+MCONNECT .................................................. 60 2.2.4.5 Subscribe to a topic :AT+MSUB .......................................................................... 60 2.2.4.6 Post a message :AT+MPUB ................................................................................. 61 2.2.4.7 Received a message :AT+MTOPIC,AT+MQD ...................................................... 61 2.2.4.8 Close the MQTT server :AT+MCLOSE.................................................................. 61 2.2.4.9 MQTT Result Code................................................................................................... 62 2.2.4.10 MQTT Usage Example............................................................................................. 63 3 Common operation........................................................................................................................................ 65 3.1 Create a SoftAP Process............................................................................................................. 65 3.2 Scan AP Process.......................................................................................................................... 66 3.3 STA joins the AP Process............................................................................................................ 66 3.4 Create an APSTA Process........................................................................................................... 67 3.5 How the STA disconnects the AP................................................................................................ 68 3.6 SoftAP Disconnected................................................................................................................... 68 3.7 How STAs view current status..................................................................................................... 68 3.8 View current SoftAP status.......................................................................................................... 68 3.9 How to use the socket function................................................................................................... 68 3.10 Transparent transmission application in automatic operating mode........................................... 73 Luat 5 /73 Air602_AT Instruction User Manual 1 Introduction 1.1 Overview This manual describes the AT+ command communication protocol of the Luat embedded Wi-Fi module. The AT+ command protocol uses a set of command based on ascii to communicate with the Wi-Fi chip through the UART interface. 1.2 Control Command Protocol 1.2.1 Command Code This section is a user command for implementing parameter configuration and networking transmission of the product. The command list is as follows: Number Luat Instruction Name Function 1 (null) Null Operation Instruction 2 ATM Set/query operating mode 3 ATRM Set/query socket connection information automatically created in automatic operating mode 4 BSSID Set/query the BSSID address of the specified AP 5 BRDSSID Enable and disable the SSID broadcast of the AP 6 CHL Set/query the specified wireless channel mode 7 CHLL Set/Query Wireless Channel List 8 CNTPARAM Query the configured networking parameters 9 CUSTDATA Receive user data sent via one-click configuration tool 10 DNAME 11 DNS Set/query device name Set domain name of network card 6 /73 Air602_AT Instruction User Manual 12 13 ENCRY Switch serial port character echo Set/Query Wireless Network Security Mode 14 ENTM Enter serial port transparent transmission mode 15 ENTS Set the system to enter energy saving mode 16 HTTPC 17 KEY Set/Query Wireless Network Key 18 LKSTT Query network connection status 19 LKSTT2 Query network connection status 2, valid only in APSTA mode 20 NIP 21 Luat E ONESHOT HTTP post get data function Set/query the local IP address Turn one-click configuration on or off 22 PASS Set / query system password 23 PMTF Update all parameters in memory to Flash 24 PORTM 25 QMAC Query physical address 26 QMAC2 Query physical address 2, valid only in APSTA mode 27 QVER Query version information 28 RSTF Reset Factory settings 29 SKCLS 30 SKCT 31 SKGHBN 32 SKRCV Set the interface mode of the wireless network card Close socket connection Create a socket connection Get the IP of the server Receive data via a Socket connection 7 /73 Air602_AT Instruction User Manual Luat 33 SKRPTM Open or close the socket to actively report the receiving data function 34 SKSDF Set the default send socket connection 35 SKSND Send data over a socket connection 36 SKSRCIP Query socket data source IP address 37 SKSTT 38 SLIST Query the STAs that have been connected, valid only in AP and APSTA modes. 39 SSID Set/Query Wireless Network Name 40 SSID2 Set/query the wireless network name, valid only in APSTA mode 41 UART Set / query serial data format 42 WATC Set/Query to automatically create an Adhoc network 43 WEBS Set/Query Web Server 44 WJOIN Join/create a wireless network 45 WLEAV Disconnect wireless network 46 WPRT Set/Query Wireless Network Type 47 WPSM Turn energy saving mode on/off 48 WSCAN Scan Network 49 WWPS Set / Query WPS Features 50 Z Query socket connection status Reset 8 /73 Air602_AT Instruction User Manual 1.2.2 Erro Code The error codes supported by this system are defined as follows: ASCII Luat Description - Success -1 Invalid command format -2 Command not supported -3 Invalid operator -4 Invalid parameter -5 Operation not allowed -6 Not enough memory -7 FLASH error -8 System busy -10 access the network failed -11 No socket available -12 Invalid socket -13 Socket connection failed -62 Socket failed to send -63 Socket reception failed -64 Undefined error 9 /73 Air602_AT Instruction User Manual 2 AT Command Protocol 2.1 Syntax Description This module uses the AT+ command protocol as the user control protocol. The AT+ instruction protocol uses a set of command line format instruction sets based on ascii. The syntax format and processing flow are described below. 2.2.1 Syntax format • Format Description <>: Indicates the part that must be included [ ] : Indicates the optional part • Command Message AT+[op][para1],[para2],[para3],[para4]… AT+ : Command message prefix CMD:Command String [op]: Instruction operator, when the command needs to take a parameter, you can specify the operation type of the parameter, including: =, Parameter/Return value preamble =!, In the setting parameter class command, it means that the modification is synchronized to flash, and the restart does not disappear. ;If there is no ! after = , it means that it is only saved in memory, and the parameters disappear after restarting. =?,In the Set Parameter Class command, query the current settings. :Carriage Return,ascii character 0x0d • Response message + [op][para1],[para2],[para3],[para4]… +: Response message prefix RSP: Response string OK Success ERR Failure Luat 10 /73 page Air602_AT Instruction User Manual :Carriage Return,ascii character 0x0d :Line feed,ascii character 0x0a Data Type • String:String, Surrounded by double quotes, the content does not contain quotes, e.g.:"this is a string" Dec: Decimal number , e.g.:10 Hex: Hexadecimal number , e.g.:a Ip:ip address string , e.g.:192.168.0.1 MAC: Consists of 12 hexadecimal digits , e.g.: 001EE3A80102 2.1.1.1 Processing flow The AT+ instruction protocol takes the form of command + response. Most instructions require the receiver to return a response message after processing. If a new command is received again during the previous command processing, it will be silently discarded without returning. Any message, as shown below: User System AT+Commad1 Processing command 1 response1 AT+Commad2 AT+Commad3 Processing command 2 Discard command3 response2 Luat 11 /73 page Air602_AT Instruction User Manual For some special commands, such as AT+SKSND, AT+SKRCV, it is necessary to transmit binary data after the instruction or response details. At this time, the receiver of the command transmission temporarily enters the transparent transmission state and starts receiving the binary data stream until receiving the specified length of data in the field of the message or command, or until the waiting timeout, automatically exits the transparent transmission state, the flow is as follows: User AT+SKRCV Enter transparent reception status and automatically exit after receiving User Sys +OK= Return response message Sys AT+SKRCV=, Return response message +OK= Enter transparent reception status and automatically exit after receiving 2.1.1.2 Example Format exampl1: Return success message AT+ +OK Example 2: Return error message AT+WJOIN +ERR=-10 Example 3: Set input parameters AT+UART=9600,1,1,0 +OK Example 4: Synchronizing parameters to the Flash operator Luat 12 /73 page Air602_AT Instruction User Manual AT+ATPT=!500 +OK Example 5: Using the Query Operator AT+ATPT=? +OK=500 2.2 Instruction Definition 2.2.1 System Control Class Instruction 2.2.1.1 Null Operation Instruction:AT+ • Function: empty operation, can be used to detect whether the program is responding normally • Format(ASCII): AT+ +OK • Parameter:Null • e.g.:( → indicates input, ← indicates return or ac ve report, the same below ) → AT+ ← +OK 2.2.1.2 System Reset:AT+Z • Function: System Reset . • Format(ASCII): Luat 13 /73 page Air602_AT Instruction User Manual AT+Z +OK • Parameter:Null • e.g.: → AT+Z ← +OK ready 2.2.1.3 Set Echo:AT+E • Function: Switch serial port command echo • Format(ASCII): AT+E +OK • Parameter:Null • e.g.: → AT+E ← +OK 2.2.1.4 Serial port enters transparent transmission mode :AT+ENTM • Function: Serial port enters transparent transmission mode ;the system exits this mode when it receives an escape character that matches the trigger condition in transparent transmission mode. Attention: Before entering the transparent transmission mode, the following conditions must be met: 1. Connected to the Internet 2. Create a socket 3. Set the transparent connection to the currently created socket Luat 14 /73 page Air602_AT Instruction User Manual • Format(ASCII): AT+ENTM +OK • Parameter:Null • e.g.: Entering the transparent mode requires the following steps: 1. Connect to the internet → AT+E ← +OK → AT+KEY=1,0,"" ← +OK → AT+WJOIN ← +OK=3c46d82bd81e,0,11,0,"TP-LINK_ Luat_AP ",51 2. Creat a socket → AT+SKCT=0,0, 36.7.87.76,1000,2000 ← +OK=1 3. Set the transparent connection to the currently created socket Luat → AT+SKSDF=1 ← +OK 15 /73 page Air602_AT Instruction User Manual 4. Entering the transparent mode → AT+ENTM ← +OK 2.2.1.5 Energy saving mode :AT+ENTS • Function:Set the system to enter the energy saving mode (Wi − Fi OFF / sleep / standby state) • Format(ASCII): AT+ENTS=[ps_type],[wake_type],[delay_time],[wake_time] +OK • Parameter: ps_type: Energy saving mode Value Description 0 Wi-Fi OFF 1 Standby 2 Sleep wake_type:Wake mode Value Wi-Fi OFF Mode Sleep /Standby Mode 0 Disable Wakeup pin wakes up 1 Enable Timer wakes up delay_time:Delay time,unit ms, Valid value 100~1000 wake_time:Wake time,unit ms, Valid value 1000~65535 Luat 16 /73 page Air602_AT Instruction User Manual Attention: ① In the Wi-Fi OFF energy saving mode, the setting is valid only when the network is disconnected, and the wake_time parameter is meaningless. ② Standby and sleep power-saving modes will cause the network connection to be disconnected and the wake-up will be reset. ③ Set WAKEUP pin wake mode, the wake_time parameter is meaningless. • e.g.: 1. Wi-Fi OFF energy saving mode Enter Wi-Fi OFF energy saving mode : AT+ENTS=0,1,1000,10000 Exit Wi-Fi OFF energy saving mode : AT+ENTS=0,0,100,1000 2. standy mode Set timer wake-up mode, unit ms, (delay 1s, wake up after 10s) AT+ENTS=1,1,1000,10000 Set WAKEUP pin wake up mode(wake_time parameter is meaningless ) AT+ENTS=1,0,1000,10000 3. sleep mode The same as standy mode 2.2.1.6 Reset Reset Factory Settings :AT+RSTF • Function: Restore the factory settings in FLASH; the restored settings will not take effect until the system is restarted. • Format(ASCII): AT+RSTF +OK • Parameter:Null Luat 17 /73 page Air602_AT Instruction User Manual • E.g.: → AT+RSTF ← +OK 2.2.1.7 Save in-memory parameters to FLASH :AT+PMTF • Function: Update all parameters saved in memory to FLASH • Format(ASCII): AT+PMTF +OK • Parameter:Null • e.g.: → AT+WPRT=0 ← +OK → AT+SSID=TP-LINK_HyFi_1E ← +OK → AT+KEY=1,0,"" ← +OK → AT+PMTF ← +OK The AT+PMTF command is equivalent to saving the parameters of the above three commands to the NV, so that these parameters do not need to be reset after the module is restarted or turned off. The effect is equivalent to saving the parameters of each command separately (as shown below): → Luat AT+WPRT=!0 18 /73 page Air602_AT Instruction User Manual ← +OK → AT+SSID=!TP-LINK_HyFi_1E ← +OK → AT+KEY=!1,0,"" ← +OK 2.2.1.8 Get the physical address of the wireless network card in STA mode :AT+QMAC • Function: Get the physical address of the wireless network card. • Format(ASCII): AT+QMAC +OK= • Parameter: mac address: Physical address, the return format is as follows Format ASCII Format command Description a hexadecimal number of length 12, like: 001EE3A34455 • e.g.: → AT+QMAC ← +OK=286dcd004e7d 2.2.1.9 Get the physical address of the wireless network card in SoftAP mode. :AT+APMAC : • Function: Obtain the SoftAP physical address, which is valid only in SoftAP and APSTA modes. Luat 19 /73 page Air602_AT Instruction User Manual • Format(ASCII): AT+APMAC +OK= • Parameter: mac address: Physical address, the return format is as follows Format ASCII Format command Description a hexadecimal number of length 12, like : 001EE3A34455 e.g.: → AT+APMAC ← +OK=2a6dcd004e7d 2.2.1.10 Get version information :AT+QVER • Function:Get system version information, including hardware version and firmware version. • Format(ASCII): AT+QVER +OK= • Parameter: firm: Firmware version information ASCII String format ,like " AirM2M_Luat_WiFi_V008_WM " e.g.: Luat 20 /73 page Air602_AT Instruction User Manual → AT+QVER ← +OK=AirM2M_Luat_WiFi_V008_WM 2.2.2 Parameter Setting Class Instruction 2.2.2.1 Wireless Network Type:AT+WPRT • Function: Set/Query Wireless Network Type • Format(ASCII): AT+WPRT=[!?][type] +OK[=type] Parameter: type:Network Type Value Description 0 infra Network(STA mode) 1 adhoc Network 2 infra Network(AP mode) 3 infra Network(APSTA mode) e.g.: Set to SoftAp mode: Luat → AT+WPRT=!2 ← +OK 21 /73 page Air602_AT Instruction User Manual 2.2.2.2 Query/set the local IP address in STA mode :AT+NIP • Function: When the wireless network card is used as a STA, this command is used to set/query the local IP address. It should be noted that when the address type is set to DHCP Server, you cannot use this command to query the IP address information that the wireless network card actually allocates dynamically. Queries can use the AT+LKSTT command. • Format(ASCII): AT+NIP=[!?][type],[ip],[netmask],[gateway],[dns] +OK[=type,ip,netmask,gateway,dns] • Parameter: Type:Address type Value Description 0 Dynamically assign/enable DHCP Server using DHCP 1 Use static IP address / disable DHCP Server ip:ip address,data format "192.168.1.22", Without quotes netmask: Subnet mask, data format is the same as ip address gateway: Gateway address, data format is the same as ip address dns: DNS address, data format is the same as ip address • e.g.: Luat → AT+WPRT=!0 ← +OK → AT+NIP=!0 ← +OK → AT+SSID=!TP-LINK_HyFi_1E ← +OK 22 /73 page Air602_AT Instruction User Manual → AT+KEY=!1,0,"" ← +OK → AT+WJOIN ← +OK=3c46d82bd81e,0,11,0,"TP-LINK_HyFi_1E",59 → AT+LKSTT ← +OK=1,"192.168.1.124","255.255.255.0","192.168.1.1","192.168.1.1","0.0.0.0" → AT+NIP=? ← +OK=0,192.168.1.1,255.255.255.0,192.168.1.1,192.168.1.1 Note: The above test shows that in the case of DHCP enabled, the second parameter queried by AT+NIP=? is not the IP address actually obtained by the module, and the second parameter queried by AT+LKSTT is. 2.2.2.3 Query/set the local IP address in SoftAP mode :AT+APNIP • Function: When the wireless network card is used as the SoftAP, this command is used to set/query the IP address of the local end and enable /disable the DHCP server. When the DHCP server is enabled, the IP address of the wireless network card can still be queried through this command. • Format(ASCII): AT+APNIP=[!?][type],[ip],[netmask],[gateway],[dns] +OK[=type,ip,netmask,gateway,dns] • Parameter: type: address type Value Luat Dscription 0 Dynamically assign/enable DHCP Server using DHCP 1 Use static IP address / disable DHCP Server 23 /73 page Air602_AT Instruction User Manual ip:ip address,data format "192.168.1.22", Without quotes netmask: Subnet mask, data format is the same as ip address gateway: Gateway address, data format is the same as ip address dns: DNS address, data format is the same as ip address • e.g.: → AT+APNIP=1,192.168.1.1,255.255.255.0,192.168.1.1,192.168.1.1 ← +OK Please refer to this document for specific applications. Create a SoftAP process 2.2.2.4 Network Card DNS :AT+DNS • Function: Set/query the NIC module domain name. This setting is valid only when the NIC is used as SoftAP. • Format(ASCII): AT+DNS=[!?][dnsname] +OK[=dnsname] • Parameter: dns name:NIC module domain name, 1~31 characters, surrounded by double quotes • e.g.: → AT+DNS="DNS-FOR-TEST" ← +OK 2.2.2.5 Operating Mode:AT+ATM • Function: Luat 24 /73 page Air602_AT Instruction User Manual Set / query the operating mode. • Format(ASCII): AT+ATM=[!?][mode] +OK[=mode] • Parameter: mode:operating mode Value • Dscription 0 Automatic working mode 1 Command mode e.g.: Query current working mode: → AT+ATM=? ← +OK=1 Modify mode to automatic working mode : → AT+ATM=!0 ← +OK 2.2.2.6 Socket connection in automatic working mode :AT+ATRM • Function: Set/query the socket connection information automatically created in the automatic working mode. • Format(ASCII): AT+ATRM=[!?][protocol],[cs],[host/timeout],[port] +OK[=protocol,cs, host/timeout,port] Luat 25 /73 page Air602_AT Instruction User Manual • Parameter: protocol:Protocol type Value Dscription 0 TCP 1 UDP cs:C/S Mode Value Dscription 0 Client 1 Server host_timeout:according to protocol and cs, its meaning is as follows cs protocol 0 X Dscription Destination server name, you can enter the domain name or ip address,e.g. "192.168.1.100" or "www.sina.com.cn" The TCP connection timeout period, that is, the client connected to the 1 0 server is automatically kicked off after sending no data for more than this time. The valid value range is 1~10000000, the unit is seconds, 0 means never, the default is 120 seconds. 1 1 Meaningless port: The port number • e.g.: → AT+ATRM=!0,0,180.97.81.180,51950 ← +OK Please refer to: Transparent transmission application in automatic working mode Luat 26 /73 page Air602_AT Instruction User Manual 2.2.2.7 Wireless network name :AT+SSID • Function: Set/Query the name of the wireless network to be joined in STA mode ,i.e.ssid。 • Format(ASCII): AT+SSID=[!?][ssid] +OK[=ssid] • Parameter: ssid: Wireless network name, 1~32 characters, with or without double quotes • e.g.: → AT+SSID=! Air_Test_WiFi ← +OK Please refer to this part for details. : STA joins the AP process 2.2.2.8 SoftAP wireless network name :AT+APSSID • Function: The SoftAP wireless network name, SSID, is valid in SoftAP and APSTA modes. • Format(ASCII): AT+APSSID=[!?][ssid] +OK[=ssid] • Parameter: ssid: Wireless network name, 1~32 characters, with or without double quotes • e.g.: Luat 27 /73 page Air602_AT Instruction User Manual → AT+APSSID=!"AAAA-Test-Wifi" ← +OK Please refer to this part for specific applications. Create a SoftAP process 2.2.2.9 Wireless network security mode :AT+ENCRY • Function: Set/query wireless network security mode. It is important to note that in addition to the OPEN mode, other security modes need to be set with the correct network key in conjunction with the AT+KEY command. In addition, in AP or AD-HOC mode, the module only supports setting OPEN, WEP64, and WEP128. • Format(ASCII): AT+ENCRY=[!?][encry mode] +OK[=encry mode] • Parameter: encry mode : security mode Value Luat Dscription 0 OPEN 1 WEP64 2 WEP128 3 WPA-PSK(TKIP) 4 WPA-PSK(CCMP/AES) 5 WPA2-PSK(TKIP) 6 WPA2-PSK(CCMP/AES) 28 /73 page Air602_AT Instruction User Manual • e.g.: Query network security mode : → AT+ENCRY=? ← +OK=0 Set the network security mode to WEP64: → AT+ENCRY=!1 ← +OK 2.2.2.10 SoftAP wireless network security mode :AT+APENCRY • Function: Set/Query SoftAP Wireless Network Security Mode. In addition to the OPEN mode, other security modes require the correct network key to be set with the AT+APKEY command. • Format(ASCII): AT+ENCRY=[!?][encry mode] +OK[=encry mode] • Parameter: encry mode: security mode Value Luat Dscription 0 OPEN 1 WEP64 2 WEP128 3 WPA-PSK(TKIP) 29 /73 page Air602_AT Instruction User Manual 4 WPA-PSK(CCMP/AES) 5 WPA2-PSK(TKIP) 6 WPA2-PSK(CCMP/AES) • e.g.: Set the network security mode to WEP64: → AT+APENCRY=!1 ← +OK 2.2.2.11 Network key :AT+KEY • Function: Set/query the network key. It should be noted that before using this command to set the network key, you sometimes need to set the network security mode using the AT+ENCRY command. • Format(ASCII): AT+KEY=[!?][format],[index],[key] +OK[=format,index,key] • Parameter: Format: Key format Value Dscription 0 HEX 1 ASCII Index: Key index number, 1 to 4 is used for WEP encryption key. Other encryption methods are fixed at 0. key: Key string, with or without quotes, ccording to different security modes, the length and format requirements of the key usage are defined as follows: Luat 30 /73 page Air602_AT Instruction User Manual Key Format Safe Mode HEX ASCII WEP64 10 hexadecimal characters(note1) 5 ASCII characters(note2) WEP128 26 hexadecimal characters 13 ASCII characters WPA-PSK(TKIP) 64 hexadecimal characters 8~63 ASCII characters WPA-PSK(CCMP/AES) 64 hexadecimal characters 8~63 ASCII characters WPA2-PSK(TKIP) 64 hexadecimal characters 8~63 ASCII characters WPA2-PSK(CCMP/AES) 64 hexadecimal characters 8~63 ASCII characters Note1:The hexadecimal characters are 0~9, a~f (not case sensitive), e.g. "11223344dd". Note2: ASCII characters refer to the numbers in the standard ASCII character set specified by the International Organization for Standardization (ISO) 0~9 and the letters a~z (case sensitive),e.g. "14u6E". • e.g.: → AT+KEY=!1,0,"A123456" ← +OK 2.2.2.12 SoftAP network key :AT+APKEY • Function: Set/Query the SoftAP wireless network key. It should be noted that you must first set the wireless network security mode using the AT+APENCRY command before setting the network key using this command. • Format(ASCII): AT+APKEY=[!?][format],[index],[key] +OK[=format,index,key] Luat 31 /73 page Air602_AT Instruction User Manual • Parameter: format: Key Format Value Dscription 0 HEX 1 ASCII Index: Key index number, 1 to 4 is used for WEP encryption key. Other encryption methods are fixed at 0. key: Key string, with or without quotes , according to different security modes, the length and format requirements of the key usage are defined as follows: Key Format Safe Mode HEX ASCII WEP64 10 hexadecimal characters(note1) 5 ASCII characters(note2) WEP128 26 hexadecimal characters 13 ASCII characters WPA-PSK(TKIP) 64 hexadecimal characters 8~63 ASCII characters WPA-PSK(CCMP/AES) 64 hexadecimal characters 8~63 ASCII characters WPA2-PSK(TKIP) 64 hexadecimal characters 8~63 ASCII characters WPA2-PSK(CCMP/AES) 64 hexadecimal characters 8~63 ASCII characters Note1:The hexadecimal characters are 0~9, a~f (not case sensitive), e.g. "11223344dd". Note2: ASCII characters refer to the numbers in the standard ASCII character set specified by the International Organization for Standardization (ISO) 0~9 and the letters a~z (case sensitive),e.g. "14u6E". • e.g.: Luat → AT+APKEY=!1,1,123456 ← +OK 32 /73 page Air602_AT Instruction User Manual 2.2.2.13 Set/query the BSSID address of the specified AP :AT+BSSID • Function: Set/query the BSSID address of the specified AP. This setting is valid only on the infra network when the module functions as a STA. • Format(ASCII): AT+BSSID=[!?][mode],[bssid] +OK[=mode,bssid] • Parameter: mode:BSSID Mode Value Dscription 0 automatic 1 Designation bssid:Network BSSID, A hexadecimal number of 12 in the format 001EE3A34455 2.2.2.14 Set/query the specified wireless channel mode :AT+CHL • Function: Set/query the specified wireless channel mode . • Format(ASCII): AT+CHL=[!?][ mode],[channel] +OK[=mode,channel] • Parameter: mode: Channel mode Value Luat Dscription 33 /73 page Air602_AT Instruction User Manual 0 automatic 1 Designation channel: Wireless channel number , effective range 1~14 . 2.2.2.15 Set / Query SoftAP Wireless Channel Mode :AT+APCHL • Function: Set / Query SoftAP Wireless Channel Mode . • Format(ASCII): AT+APCHL=[!?][ mode],[channel] +OK[=mode,channel] • Parameter: mode: Channel mode Value Dscription 0 automatic 1 Designation channel: Wireless channel number , effective range 1~14 . 2.2.2.16 • Wireless Channel List:AT+CHLL Function: Set/query the list of wireless channels. The wireless channel list parameter is used to specify the working channel range of the module. Channels not included in the list will not be scanned. Reasonable use of this parameter can speed up the scanning and networking speed of the module. • Format(ASCII): AT+CHLL=[!?][channel list] +OK[=channel list] Luat 34 /73 page Air602_AT Instruction User Manual • Parameter: channel list: The list of wireless channels, in hexadecimal format, starting from the lowest bit, each bit representing a channel, the default is 3fff, indicating 1~14 all channels 2.2.2.17 Enable automatic creation of adhoc network functions :AT+WATC • Function: Set/Query whether to enable the automatic creation of the adhoc network function. This setting is valid only when the wireless network type is set to adhoc, indicating whether an adhoc network with the same name is automatically created when the network join fails. • Format(ASCII): AT+WATC=[!?][enable] +OK[=enable] • Parameter: enable: Enable flag Dscription Value 0 Not enabled 1 Enable 2.2.2.18 Turn automatic energy saving mode on/off :AT+WP • Function:Turn automatic energy saving mode on/off Note: This power-saving mode is the energy-saving mode of the wifi protocol. It only turns off the wireless transceiver and reduces the CPU frequency. This mode CPU does not sleep, so it can receive AT/RI commands. After the power-saving mode is turned on, the WiFi module enters the WiFi_off state after wireless idle. If there is no Luat 35 /73 page Air602_AT Instruction User Manual external wake-up, the WiFi is turned on when the time period indicated by the TIM information element of the beacon frame [minimum 100ms] comes, according to the TIM in the Beacon frame. The domain determines whether there is data to be received [including broadcast frames and unicast frames]. If there is no data, it will immediately enter the WiFi_off state. If there is data after processing, the wireless access will enter the WiFi_off state. If there is external wake-up during WiFi_off, it will open. WiFi, until the next wireless idle and then enter the WiFi_off state. Ways to wake up the module: AT port directly sends data will wake up the module • Format(ASCII): AT+WPSM=[!?][enable] +OK[=enable] • Parameter: enable: Enable flag Value Dscription 0 Not enabled 1 Enable • e.g. Turn on the power save mode (Note: AT+WPSM=1 is valid only after the module joins the hotspot): AT+WPSM=1 +OK Turn off power save mode : AT+WPSM=0 +OK Luat 36 /73 page Air602_AT Instruction User Manual 2.2.2.19 Enable/disable AP SSID broadcast :AT+BRDSSID • Function: Enable/disable AP SSID broadcast. This setting is valid only when the module is an AP. • Format(ASCII): AT+BRDSSID=[!?][enable] +OK[=enable] • Parameter: enable: Whether to enable SSID broadcast Value Dscription 0 Ban AP SSID broadcast 1 Enable AP SSID broadcast 2.2.2.20 UART port data format :AT+UART • Function:Set/query the uart interface data format. • Format(ASCII): AT+UART=[!?][baudrate],[databit],[stopbit],[parity],[flowcontrol] +OK[=baudrate,databit,stopbit,parity] • Parameter: baud rate: Baud rate, RMS range 1200~115200bps Value Luat Dscription 115200 115200 bps 57600 57600 bps 37 /73 page Air602_AT Instruction User Manual 38400 38400 bps 19200 19200 bps 9600 9600 bps 4800 4800 bps 2400 2400 bps 1200 1200 bps data bit:data bit Value Dscription 0 8 bit 1 7 bit stop bit: Stop bit Value Dscription 0 1 bit 1 not support 2 2 bit parity: parity Value Luat Dscription 0 No parity 1 Odd parity 2 Even parity 38 /73 page Air602_AT Instruction User Manual 2.2.2.21 Built-in enable WEB management server :AT+WEBS • Function: Set/Query whether built-in enabled WEB Management Server • Format(ASCII): AT+WEBS=[!?][enable],[port] +OK[=enable,port] • Parameter: enable: Enable flag Value Dscription 0 Not enabled 1 enable port: Server port number, default is 80 2.2.2.22 Device name :AT+DNAME • Function:Set/query the device name. • Format(ASCII): AT+DNAME=[!?][devicename] +OK[=devicename] • Parameter: devicename: Device name, 1~32 characters 2.2.2.23 System login password :AT+PASS • Function:Set / query the system login password. • Format(ASCII): Luat 39 /73 page Air602_AT Instruction User Manual AT+PASS=[!?][pass] +OK[=pass] • Parameter: pass: 6 ASCII characters 2.2.2.24 Receiving user data :AT+CUSTDATA • Function: Receive the user data sent by the one-click configuration tool. Send the AT+ONESHOT=1 command before use to configure the module in one-button configuration mode. • Format: AT+CUSTDATA[=?] +OK=data • Parameter:Null 2.2.2.25 Query the configured networking parameters :AT+CNTPARAM • Function: Query the configured networking parameters. • Format(ASCII): AT+CNTPARAM[=?] +OK= ,[bssid],[ssid], • Parameter: Null 返回值:bssid_en 值的含义 Luat 40 /73 page Air602_AT Instruction User Manual Value Dscription 0 BSSID is not enabled 1 Enable BSSID networking If the BSSID is enabled, it returns 1, bssid, key If BSSID is not enabled ,returns 0, ssid, key 2.2.3 Network control class 2.2.3.1 NIC interface mode :AT+PORTM • Function: Set/query the interface mode of the Network Card. • Format(ASCII): AT+PORTM=[!?][mode] +OK[=mode] • Parameter: mode: Interface mode Value Dscription 0 Low speed UART 1 High speed UART 2 H-SPI 3 H-SDIO • e.g.: Query the NIC interface mode: Luat 41 /73 page Air602_AT Instruction User Manual → AT+PORTM=? ← +OK=0 2.2.3.2 Get the IP address of the external domain name :AT+SKGHBN • Function: Obtain the IP of the external domain name. • Format(ASCII): AT+SKGHBN =[!?][URL] +OK[=IP] • Parameter: URL: External domain name IP: Corresponding IP address • e.g.: After the network is successfully added, the IP address of the external domain name can be queried as follows. : → AT+WJOIN ← +OK=3c46d82bd81e,0,11,0,"TP-LINK_HyFi_1E",49 → AT+SKGHBN=www.baidu.com ← +OK="115.239.211.112" 2.2.3.3 Set / Query WPS Features :AT+WWPS • Function: Set/Query WPS function. • Format(ASCII): Luat 42 /73 page Air602_AT Instruction User Manual AT+WWPS=[!?][mode],[pin] +OK[=mode],[pin] • Parameter: mode: WPS function selection, empty parameters do not need to be filled out. mode pin get_pin set_pin Dscription Get the pin code Pin Code Set the pin code start_pin Start networking start_pbc Start networking pin: PIN code of the wireless router 2.2.3.4 Join the specified AP :AT+WJOIN • Function: Join/create the specified network depending on the type of network you have set up. If the current network type is STA, this command functions to connect to the AP. If the current network type is SoftAP, this command functions to create a SoftAP. If the current network type is Adhoc, this command function specifies the Adhoc network for the connection, and can choose whether to automatically create the network if the network with the specified SSID is not detected according to the setting parameters. If the current network is already connected or created, return the network connection information directly. For ASCII format, the system returns a response message after the network connection is successful. • Format(ASCII): AT+WJOIN +OK= , , , , , • Parameter: Bssid:Network BSSID,A hexadecimal number of length 12 in the format 001EE3A34455 type: Network Type Luat 43 /73 page Air602_AT Instruction User Manual Value Dscription 0 STA Mode 1 Adhoc Mode 2 SoftAP Mode 3 APSTA Mode channel: Channel number b_encry: Encryption mode Value Dscription 0 Open 1 Encryption SSID: Wireless network name, 1~32 characters, surrounded by double quotes rssi: Network signal strength, without negative sign, unit Db, ie 50 means signal strength is -50Db • e.g.: Luat → AT+SSID=TP-LINK_HyFi_1E ← +OK → AT+KEY=1,0,"" ← +OK → AT+WJOIN ← +OK=3c46d82bd81e,0,11,0,"TP-LINK_HyFi_1E",53 44 /73 page Air602_AT Instruction User Manual 2.2.3.5 Disconnect the current network :AT+WLEAV • Function: This command is only valid when the module is acting as a STA and is used to disconnect the current wireless network. • Format(ASCII): AT+WLEAV +OK • Parameter: Null • e.g.: Query the connection status after screening, and then query the connection status after exiting the network. : Luat -→ AT+SSID=TP-LINK_HyFi_1E ← +OK → AT+KEY=1,0,"" ← +OK -→ AT+WJOIN ← +OK=3c46d82bd81e,0,11,0,"TP-LINK_HyFi_1E",53 → AT+LKSTT ← +OK=1,"192.168.1.109","255.255.255.0","192.168.1.1","192.168.1.1","0.0.0.0" → AT+WLEAV ← +OK → AT+LKSTT ← +OK=0 45 /73 page Air602_AT Instruction User Manual 2.2.3.6 Scan wireless network:AT+WSCAN • Function: This command is valid only when the module is acting as a STA. It is used to scan the wireless network and return after completion. • Format(ASCII): AT+WSCAN +OK= , , , , , , , , , , …… • Parameter: The same as AT+WJOIN • e.g.: → AT+WSCAN ← +OK=828917C49D9A,2,1,1,"AirM2M_WiFi",70 C4CAD90B1592,2,1,1,"qianyue-lan",86 68DB540CC142,2,4,1,"O2@PHICOMM",76 64098014661A,2,6,1,"Xiaomi_6619",64 7C11CB04F7B5,2,6,0,"",74 0E5415290C52,2,6,1,"LAPTOP-JNPMKPQP 7565",56 104400631C69,2,6,1,"",84 EC26CAB3094E,2,6,1,"Black Ship Corp",74 7C11CB04F7B4,2,6,1,"HUAWEI-UM57MQ",76 8825930EAEAF,2,6,1,"GST_2.4G",84 0E26CAB3094E,2,6,1,"Doge Smart Office",74 286C0764C470,2,7,1,"FB715",66 2A6C0764C470,2,7,0,"",64 3C46D82BD81E,2,11,0,"TP-LINK_HyFi_1E",60 AC9E176C8AF8,2,10,1,"Finejoint_sec",80 Luat 46 /73 page Air602_AT Instruction User Manual 789682A20C18,2,11,1,"xiaoman-ZTE-2.4G-A20C18",62 00226C68DDE8,2,11,0,"RT8580_DDE8",78 08107999C460,2,11,1,"Netcore_air",76 A8574ED51AFE,2,12,1,"MEVIUS",82 30FC68606128,2,11,1,"Carebao717",72 2.2.3.7 Query the local network connection status :AT+LKSTT • Function: Query the status of the local network connection. • Format(ASCII): AT+LKSTT +OK[=status,ip,netmask,gateway,dns1,dns2] • Parameter: status: Connection Status Value Dscription 0 disconnect 1 connection Ip: Ip address, the data format is "192.168.1.22“, without quotes netmask: Subnet mask, data format is the same as ip address gateway: Gateway address, data format is the same as ip address dns1: DNS1 address, data format is the same as ip address dns2: DNS2 address, data format is the same as ip address • e.g.: Query the connection status after screening, and then query the connection status after exiting the network. : → Luat AT+SSID=TP-LINK_HyFi_1E 47 /73 page Air602_AT Instruction User Manual ← +OK → AT+KEY=1,0,"" ← +OK → AT+WJOIN ← +OK=3c46d82bd81e,0,11,0,"TP-LINK_HyFi_1E",53 → AT+LKSTT ← +OK=1,"192.168.1.109","255.255.255.0","192.168.1.1","192.168.1.1","0.0.0.0" → AT+WLEAV ← +OK → AT+LKSTT ← +OK=0 2.2.3.8 Set / Query SoftAP Status :AT+APLKSTT • Function: Set/query SoftAP wireless channel status, valid only in SoftAP and APSTA modes. • Format: AT+APLKSTT