signed

QiShunwang

“诚信为本、客户至上”

WIFI模块接入测试

2021/6/24 17:12:07   来源:

WIFI测试

1)发送:AT+CIPSTART=“TCP”,“192.168.8.102”,8080

返回:no ip

ERROR

说明:WiFi未接入路由器,没入网

2)AT+CWJAP=“WIFI_SSID”,“WIFI_KEY”

WIFI CONNECTED
WIFI GOT IP

OK

说明:WiFi已入网并已分配IP

3)AT+CIPSTART=“TCP”,“192.168.8.102”,8080

ALREADY CONNECTED

ERROR

AT+CIPSTART=“TCP”,“192.168.8.102”,8080

CONNECT

OK

说明:已连接到服务器,可能与目的服务器不一致,可先断开服务器再连接

4)AT+CWJAP?

+CWJAP:“HUAWEI_B316_BF67”,“74:45:2d:57:bf:67”,9,-40

OK

No AP

OK

说明:查询联网状态

5)AT+CIPSTATUS

STATUS:3
+CIPSTATUS:0,“TCP”,“39.98.248.43”,8888,46493,0

OK

0: The ESP32 station is inactive.
1: The ESP32 station is idle.
2: The ESP32 Station is connected to an AP and its IP is obtained.
3: The ESP32 Station has created a TCP or UDP transmission.
4: The TCP or UDP transmission of ESP32 Station is disconnected.
5: The ESP32 Station does NOT connect to an AP.

说明:查询是否连接到服务器

6)查询本地IP
AT+CIFSR

7)考虑是否添加自动连接

AT+CWAUTOCONN=1

//wifi STA接入流程:开始》复位》设置STA模式》设置自动连接》连接路由-》连接服务器》发送数据》接受应答》结束