Chapter 4. Software framework
When ESP32 uses SNTP to synchronize the current time, I found that there is a random delay. After further
analysis, I found that it is caused by SNTP_STARTUP_DELAY in the IDF lwip component, the default value
of which is 1. Is there any way to avoid the random delay without modifying the IDF component?
• There is no way to avoid the random delay without modifying the IDF component. You need to manually add
the code #define SNTP_STARTUP_DELAY 0 to lwipopts.h in the lwip component. This code reduces
the time that SNTP takes to send a request, so it can reduce the total time for ESP devices connecting to the
cloud after they are powered up as a result.
• The reason for enabling this random delay option by default is that it is mandated by the SNTP RFC protocol.
A random delay can reduce the number of simultaneous accessing devices, so this can prevent the SNTP server
from being overloaded.
Does IPv6 support setting static IP?
IPv6’s link-local address is generated automatically according to certain protocol rules, so there is no
need to manually set it. Therefore, it cannot set static addresses as IPVv4.
4.5.4 Mbed TLS
Does ESP8266 OpenSSL support hostname validation?
Yes. ESP8266 OpenSSL is based on Mbed TLS encapsulation, which supports hostname vali-
dation. ESP-TLS can be used to switch between Mbed TLS and wolfSSL.
How to optimize memory when ESP32 uses Mbed TLS?
• You can enable dynamic buer in menucong, the specic operation is menuconfig > Component con-
fig > mbedTLS > Using dynamic TX/RX buffer (key "Y" to enable).
• At the same time, you can enable the sub-options Free SSL peer certificate after its usage
and Free certificate, key and DHM data after its usage in the Using dynamic
TX/RX buffer in the previous step.
• However, ESP-IDF v5.0 and later no longer have sub-optioin Free SSL peer certificate after
its usage, and Mbed TLS enables MBEDTLS_SSL_KEEP_PEER_CERTIFICATE by default. If you
want to save memory, you can close it by menuconfig > Component config > mbedTLS > mbedTLS
v3.x related > Keep peer certificate after handshake completion (key "N"
to disable).
When I connected an ESP32 module with the HTTPS Server, I got the following log. What is the reason?
free heap size: 181784 bytes
I (4285) esp_https_server: Starting server
E (4285) esp_https_server: Could not allocate memory
I (4295) example: Error starting server!
I (4295) SSDP Server: SSDP server started
free heap size: 178636 bytes
Espressif Systems 99
Submit Document Feedback
Release master