Espressif Systems ESP Faq page 113

Table of Contents

Advertisement

Chapter 4. Software framework
Does ES32 support PPP functionality?
Yes, please refer to
esp_modem
Every time ESP32 attempts to read 4 KB of data with read and recv APIs in the socket, it can not always
read the 4 KB of data. Why?
• Both read and recv APIs are used to read the data in the underlying buffer. For example, if there are 100
bytes of data in the underlying buffer, and the len size passed in by read and recv is only 50, then the API
will return after it reads 50 bytes. If len exceeds the length of the data received in the underlying buffer, say
200, the API will return after it reads 100 bytes and will not wait until it receives 200 bytes. So, an attempt to
read 4 KB of data will not necessarily return 4 KB of data, but only the data available in the underlying buffer
at the time of reading.
• If you need to read 4 KB of data every time, it is recommended to use application code on top of the socket
layer to design the corresponding logic, which reads data recursively until it reaches 4 KB.
What is the version of lwIP currently used in ESP-IDF?
lwIP v2.1.3 is used currently.
In DHCP mode, will ESP32 renew the IP or apply for a new IP when the lease expires?
There are two lease periods, T1 (1/2 time of the lease) and T2 (7/8 time of the lease) in DHCP mode.
When both lease expires, ESP32 usually renews the same IP. Only when both of them fail to renew will
ESP32 apply for a new IP.
Why does ESP-IDF report an error when SO_SNDBUF option of setsockopt are used to get or set the size
of the send buffer?
By default, lwIP does not support SO_SNDBUF. To set the send buffer size, go to menuconfig ->
Component config -> LWIP -> TCP -> Default send buffer size. To get or set the
receive buffer size, you need to enable the CONFIG_LWIP_SO_RCVBUF option in menuconfig before
you can use the SO_RCVBUF option of setsockopt to get or set the receive buffer size.
I find that the network data latency of TCP & UDP is large when testing ESP-IDF. What is the buffering
data mechanism of TCP & UDP protocols?
• For TCP, there is TCP_NODELAY option in socket option. You can enable this option to disable the Nagle
algorithm which is enabled by default, so that the data will not be cached locally and then sent together.
• For UDP, UDP data is sent directly. If there is any delay, it is because of the delay of the Wi-Fi network
environment, not the UDP itself.
• If TCP retransmission is caused by poor network environment, and the transmission interval is set too long,
high latency will occur. You can try to shorten the RTO value (by modifying component config -> lwip
-> tcp -> Default TCP rto time and TCP timer interval options in menuconfig).
Espressif Systems
example.
96
Submit Document Feedback
Release master

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

This manual is also suitable for:

Esp32Esp8266Esp32-s2Esp32-c3Esp32-s3

Table of Contents