我尝试将 esp32 模块配置为在 p2p 连接中工作。我正在尝试使用“当ESP设备在UDP透明传输中作为softAP工作时的UART Wi-Fi直通传输”。这是来自 AT 命令固件的数据表的示例。我想通过 WiFi 制作无线 UART,但我不知道该怎么做,因为该示例预测了我们有 ESP-PC 连接的情况。我希望一个模块通过无线电向另一个模块发送数据,并通过串行端口接收数据。我要求提示或其他任何内容。
基本命令序列,例如来自数据表:
Set the Wi-Fi mode to softAP.
Command:
AT+CWMODE=2
Response:
OK
Set softAP.
Command:
AT+CWSAP="ESP32_softAP","1234567890",5,3
Response:
OK
Connect the PC to the ESP device softAP.
Create a UDP endpoint.
Use a network tool on PC to create a UDP endpoint. For example, the PC’s IP address is 192.168.4.2 and the port is 8080.
Create a UDP transmission between ESP32 and the PC with a fixed remote IP address and port. The remote host’s IP address is 192.168.4.2, the remote port is 8080, the local port is 2233, and the mode is 0.
Command:
AT+CIPSTART="UDP","192.168.4.2",8080,2233,0
Response:
CONNECT
OK
Enable the UART Wi-Fi transmission mode.
Command:
AT+CIPMODE=1
Response:
OK
Send data in Passthrough Mode.
Command:
AT+CIPSEND
Response:
OK