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

At instruction set and examples
Hide thumbs Also See for ESP32:
Table of Contents

Advertisement

!
Response:
4,CONNECT
OK
�� 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,7 // send 7 bytes to transmission NO.4
>UDPtest // enter the data, no CR
Response:
SEND OK
⚠ Notice:
If the number of bytes inputted are more than the size defined (n):
-
-
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
9.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
the system will reply busy, and send the first n bytes.
and after sending the first n bytes, the system will reply SEND OK.
69 97
!
/!
9. AT Commands Examples
2019.06

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