需求:
- ESP32 启 AP 模式
- 其他设备连接 ESP32 的 AP
- ESP32 连接 TCP Server
- ESP32 作为 TCP Client 端与 TCP Server 进行数据透传
测试指令:
AT+RESTORE
AT+CWMODE =2 // Set ESP32 to AP mode
AT+CWSAP ="ESP32","12345678",1,3 //Set the configuration of an ESP32 SoftAP
AT+CIPMODE =1 //Set the WiFi Passthrough Receiving Mode
AT+CIPSTART ="TCP","192.168.4.2",10500 //Connecting to the TCP Server
AT+CIPSEND //Data passthrough command

测试步骤:
① 安卓手机端可以使用“网络助手”APP 进行测试。
② 手机连接 ESP32 的 AP 。
③ 打开“网络助手” APP, 然后使用APP创建 TCP Server

④ ESP32 开启透传模式,使用如下指令:
AT+CIPMODE =1 //Set the WiFi Passthrough Receiving Mode
⑤ ESP32 连接该 TCP Server,使用如下指令:
AT+CIPSTART ="TCP","192.168.4.2",10500 //Connecting to the TCP Server
本文详细介绍了如何使用ESP32在AP模式下与其他设备通信,并通过TCP透传实现与TCPServer的数据交换。步骤包括设置ESP32为AP,连接手机,创建TCPServer,配置WiFi透传和连接服务器。


734

被折叠的 条评论
为什么被折叠?



