Udp (With Changeable Remote Ip And Port) - Espressif ESP32 At Instruction Set

Hide thumbs Also See for ESP32:
Table of Contents

Advertisement

!
�� Notes:
"192.168.101.110" and 8080 are the remote IP and port of UDP transmission on the remote side, i.e., the UDP
configuration set by PC.
1112 is the local port number of ESP32. Users can define this port number. The value of this parameter will be random if
it is not defined beforehand.
0 means that the remote IP and port are fixed and cannot be changed. For example, if another PC also creates a UDP
entity and sends data to ESP32 port 1112, ESP32 can receive the data sent from UDP port 1112. But when data are
sent using AT command AT+CIPSEND=4,X, it will still be sent to the first PC end. If parameter 0 is not used, the data will
be sent to the new PC.
3. Send data:
AT+CIPSEND=4,5 // send 5 bytes to transmission NO.4
>DGFYQ // enter the data, no CR
Response:
SEND OK
⚠ Notice:
If the number of bytes sent is bigger than the size defined as n, the response would be busy. After sending the first n
number of bytes, SEND OK will be returned.
4. Receive data:
+IPD,4,n:xxxxxxxxxx // received n bytes, data=xxxxxxxxxxx
5. Close UDP transmission No.4:
AT+CIPCLOSE=4
Response:
4,CLOSED
OK
7.2.2.

UDP (with Changeable Remote IP and Port)

1. Create a UDP transmission with the last parameter being 2.
AT+CIPSTART="UDP","192.168.101.110",8080,1112,2
Response:
CONNECT
OK
Espressif
38 53
!
/!
7. AT Commands Examples
2017.02

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32 and is the answer not in the manual?

Questions and answers

Table of Contents