EasyManuals Logo

Freenove ESP32-S3 User Manual

Default Icon
142 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #93 background imageLoading...
Page #93 background image
Any concerns? support@freenove.com
91
Chapter 6 TCP/IP
www.freenove.com
43
44
45
46
47
if (Serial.available() > 0) {
delay(20);
String line = Serial.readString();
client.print(line);
}
If the server is disconnected, turn off WiFi of ESP32-S3.
48
49
50
51
if (client.connected () == false) {
client.stop();
WiFi.disconnect();
}
Reference
Class Client
Every time when using Client, you need to include header file "WiFi.h."
connect(ip, port, timeout)/connect(*host, port, timeout): establish a TCP connection.
ip, *hostip address of target server
port: port number of target server
timeout: connection timeout
connected(): judge whether client is connecting. If return value is 1, then connect successfully; If return
value is 0, then fail to connect.
stop(): stop tcp connection
print(): send data to server connecting to client
available(): return to the number of bytes readable in receive buffer, if no, return to 0 or -1.
read(): read one byte of data in receive buffer
readString(): read string in receive buffer

Questions and Answers:

Question and Answer IconNeed help?

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

Freenove ESP32-S3 Specifications

General IconGeneral
BrandFreenove
ModelESP32-S3
CategoryControl Unit
LanguageEnglish