!
7. Receive data:
+IPD,n:xxxxxxxxxx // received n bytes, data=xxxxxxxxxxx
9.2. UDP Transmission
UDP transmission is established via AT+CIPSTART. There is no such distinction between
UDP server and UDP client.
1. Set the Wi-Fi mode:
AT+CWMODE=3 // SoftAP+Station mode
Response:
OK
2. Connect to the router:
AT+CWJAP="SSID","password" // SSID and password of router
Response:
OK
3. Query the device's IP:
AT+CIFSR
Response:
+CIFSR:STAIP,"192.168.101.104" // IP address of ESP32 Station
4. Connect the PC to the same router which ESP32 is connected to. Use a network tool
on the PC to create UDP transmission.
- For example, the PC's IP address is 192.168.101.116 and the port is 8080.
5. Below are two examples of UDP transmission:
9.2.1.
UDP (with Fixed Remote IP and Port)
In UDP transmission, whether the remote IP and port are fixed or not is determined by the
last parameter of AT+CIPSTART, namely 0. 0 means that the remote IP and port are fixed
and cannot be changed. A specific ID is given to such a connection, ensuring that the data
sender and receiver will not be replaced by other devices.
1. Enable multiple connections:
AT+CIPMUX=1
Response:
OK
2. Create a UDP transmission, with the ID being 4, for example.
AT+CIPSTART=4,"UDP","192.168.101.110",8080,1112,0
Espressif
68 97
!
/!
9. AT Commands Examples
2019.06
Need help?
Do you have a question about the ESP32 and is the answer not in the manual?
Questions and answers