Wi-Fi AT command set ================================================== This chapter introduces the command set for driving Wi-Fi. This command set will be adapted differently for different modules. Please follow the steps for specific differences: doc:`../instruction/other/firmware_differences`。 - :ref:`AT+WMODE `:Wi-Fi working mode - :ref:`AT+WSCAN `:scan Wi-Fi list - :ref:`AT+WSDHCP `:DHCP parameters in STA mode - :ref:`AT+WJAP `:connect AP - :ref:`AT+WDISCONNECT `: disconnect current AP connection - :ref:`AT+WAUTOCONN `:Automatically connect Wi-Fi when powered on. - :ref:`AT+WAPDHCP `:DHCP parameters in AP mode - :ref:`AT+WAP `:Wi-Fi parameters in AP mode - :ref:`AT+PING `:process Ping - :ref:`AT+CIPSTAMAC_DEF `:Wi-Fi station MAC address - :ref:`AT+WCOUNTRY `:Wi-Fi country code - :ref:`AT+WCONFIG `:Mobile phone network configue - :ref:`AT+WSCANOPT `:Filter the information displayed by Wi-Fi scanning. - :ref:`AT+WRSSI `:Wi-Fi connection signal strength .. _cmd-WMODE: AT+WMODE Inquire or set the Wi-Fi working mode. ------------------------------------------ setting command ^^^^^^^^ **command:** :: AT+WMODE=, **response:** :: OK Parameter ^^^^ - ****:Wi-Fi working mode - 0:Wi-Fi is not initialized or turned off. - 1:STA - 2:AP - 3:AP+STA - ****:if save to flash - 0:Do not save - 1:Save Instruction ^^^^ - Set Wi-Fi working mode Example ^^^^ :: AT+WMODE=1,1 //set STA mode,save to FLASH OK Query command ^^^^^^^^ **command:** :: AT+WMODE? **response:** :: +WMODE: OK Parameter ^^^^ - ****:Wi-Fi working mode - 0:Wi-Fi is not initialized or turned off. - 1:STA - 2:AP - 3:AP+STA Example ^^^^ :: AT+WMODE? //Query Wi-Fi working mode +WMODE:<1> OK .. _cmd-WSCAN: AT+WSCAN scan Wi-Fi list ------------------------------------------ ^^^^^^^^ **command:** :: AT+WSCAN **response:** :: +WSCAN:index SSID,CH,SECURITY,RSSI,BSSID ,,,, ... OK Parameter ^^^^ - ****:Scanning sequence id - ****:Wi-Fi SSID - ****:Wi-Fi channel - ****:safe mode - ****:Wi-Fi received signal strength - ****:Wi-Fi BSSID Instruction ^^^^ - Need to be in STA mode。 Example ^^^^ :: AT+WSCAN +WSCAN:index SSID,CH,SECURITY,RSSI,BSSID 1 IoT-Connect,9,WPA/WPA2 Mixed,-19,cc:81:da:1f:45:80 2 IoT-Connect_5G,44,WPA/WPA2 Mixed,-30,cc:81:da:1f:45:88 3 super_2G,1,WPA/WPA2 AES,-32,54:75:95:4f:74:5e ... 30 ChinaNet-uL5X,1,WPA/WPA2 Mixed,-71,ca:50:e9:8b:5a:0c OK Set command ^^^^^^^^ **command:** :: AT+WSCAN=[,,,] Wi-Fi scanning with filter parameters **response:** :: +WSCAN:index SSID,CH,SECURITY,RSSI,BSSID ,,,, ... OK Parameter ^^^^ - ****:scan the specified SSID - ****:scan the specified mac address - ****:Scan the specified channel number. - ****:Filter out AP with signal strength lower than rssi parameter value, unit: dBm, default value: -100, range: [-100,40]. Instruction ^^^^ - 1,Empty means to skip parameters. - 2,Can be used in combination with AT+WSCANOPT. Example ^^^^ :: AT+WSCAN=AXK +WSCAN:index,SSID,CH,SECURITY,RSSI,BSSID 1,AXK,149,WPA/WPA2 Mixed,-50,f8:8c:21:b4:40:22 2,AXK,48,WPA/WPA2 Mixed,-57,f8:8c:21:b4:4a:39 3,AXK,161,WPA/WPA2 Mixed,-75,f8:8c:21:b4:3f:62 4,AXK,157,WPA/WPA2 Mixed,-84,f8:8c:21:b4:2d:89 OK .. _cmd-WSDHCP: AT+WSDHCP query or set DHCP parameters in STA mode ------------------------------------------ Set command ^^^^^^^^ **command:** :: AT+WSDHCP=[,,,] **response:** :: OK Parameter ^^^^ - ****:IP acquisition mode - 0:Disable DHCP and use static IP. - 1:Use DHCP to obtain IP - ****:The IP address of the module, which needs to be set for static IP. - ****:Subnet mask, which needs to be set for static IP. - ****:Gateway, static IP needs to be set. Example ^^^^ :: AT+WSDHCP=0,192.168.31.199,255.255.255.0,192.168.31.1 OK Query command ^^^^^^^^ **command:** :: AT+WSDHCP? **response:** :: +WSDHCP:[,,,] OK Parameter ^^^^ - ****:IP acquisition mode - 0:Disable DHCP and use static IP. - 1:Use DHCP to obtain IP - ****:The IP address of the module, which needs to be set for static IP. - ****:Subnet mask, which needs to be set for static IP. - ****:Gateway, static IP needs to be set. Example ^^^^ :: AT+WSDHCP? +WSDHCP:0,192.168.31.199,255.255.255.0,192.168.31.1 OK .. _cmd-WJAP: AT+WJAP connect AP ------------------------------------------ Set command ^^^^^^^^ **command:** :: AT+WJAP=,[,] **response:** :: OK Parameter ^^^^ - ****:SSID of the connected AP. - ****:Password of the connected AP. - ****:BSSID of the connected AP Example ^^^^ :: AT+WJAP=super_2G,123456798 OK Query command ^^^^^^^^ **command:** :: AT+WJAP? **response:** :: +WJAP:,,,,,,,, Client Num: Client MAC: OK Parameter ^^^^ - ****:connection status - 0:Wi-Fi is not connected (initial state or STA mode is not turned on) - 1:Connecting Wi-Fi or reconnecting Wi-Fi. - 2:Wi-Fi is connected, and IP has not been obtained yet. - 3:Connect to Wi-Fi and have obtained the IP. - 4:Wi-Fi connection failed (the state that the connection has not been successful after the reconnection number has exceeded). - ****:SSID of the connected AP. - ****:Password of the connected AP. - ****:BSSID of the connected AP - ****:Encryption mode - Open //Open network - WEP - WPA TKIP - WPA AES - WPA Mixed - WPA2 AES - WPA2 TKIP - WPA2 Mixed - WPA/WPA2 TKIP - WPA/WPA2 AES - WPA/WPA2 Mixed - WPA2 Enterprise - WPA/WPA2 Enterprise - WPA3-ASE AES - UnknownType //Unknown Type - ****:MAC address of Wi-Fi module (lowercase characters, colon separated) - ****:Connecting channel - ****:IP address (dotted format) - ****:Gateway address (dotted format) Instruction ^^^^ - Inquire about Wi-Fi networking information (this is the current status obtained from hardware, not directly reading our settings) .. _cmd-WDISCONNECT: AT+WDISCONNECT disconnect current AP connection ------------------------------------------ Setting command ^^^^^^^^ **command:** :: AT+WDISCONNECT **response:** :: OK Example ^^^^ :: AT+WDTSCONNECT +EVENT:WIFI DISCONNECT OK Query command ^^^^^^^^ **Not support** .. _cmd-WAUTOCONN: AT+WAUTOCONN power-on automatic reconnection Wi-Fi ------------------------------------------ Setting command ^^^^^^^^ **cmmand:** :: AT+WAUTOCONN= **response:** :: OK Parameter ^^^^ - ****: - 0:Forbidden - 1:Enable Instruction ^^^^ - Enable/disable the power-on automatic connection function. Example ^^^^ :: AT+WAUTOCONN=1 OK Query command ^^^^^^^^ **command:** :: AT+WAUTOCONN? **response:** :: +WAUTOCONN: OK Parameter ^^^^ - ****: - 0:Forbidden - 1:Enable .. _cmd-WAPDHCP: AT+WAPDHCP DHCP parameters in AP mode ------------------------------------------ Set command ^^^^^^^^ **command:** :: AT+WAPDHCP=,,, **response:** :: OK Parameter ^^^^ - ****: - 0:Forbidden DHCP - 1:Enable DHCP - ****:DHCP start address. eg:192.168.43.100 - ****:DHCP end address.eg:192.168.43.200 - ****:Gateway IP (module IP is gateway IP when DHCP is used), which needs to be set when DHCP is enabled.eg:192.168.43.1 Instruction ^^^^ - Set DHCP parameters in AP mode. Example ^^^^ :: AT+WAPDHCP=1,192.168.43.100,192.168.43.200,192.168.43.1 OK ^^^^^^^^ **command:** :: AT+WAPDHCP? **response:** :: +WAPDHCP:[,,,] OK Parameter ^^^^ - ****: - 0:Forbidden DHCP - 1:Enable DHCP - ****:DHCP start address. eg:192.168.43.100 - ****:DHCP end address. eg:192.168.43.200 - ****:Gateway IP (module IP is gateway IP when DHCP is used), which needs to be set when DHCP is enabled.eg:192.168.43.1 .. _cmd-WAP: AT+WAP Wi-Fi parameters in AP mode ------------------------------------------ Set command ^^^^^^^^ **command:** :: AT+WAP=,,,,