Chapter 4. Software framework
• The error is caused by low memory. The log shows that you use the esp_get_free_heap_size() API
to get the remaining memory. However, the remaining memory includes the chip’s internal RAM
as well as external PSRAM.
• By default, mbedTLS uses internal RAM memory, and you can use the
esp_get_free_internal_heap_size() API to obtain the remaining internal memory.
• If the module has an external PSRAM, you can modify the conguration from menuconfig >
Component config > mbedTLS > Memory allocation strategy > Internal
memory to menuconfig > Component config > mbedTLS > Memory allocation
strategy > External SPIRAM for testing.
When resolving a hostname on ESP32, I encountered the following error. What could be the reason?
• The error is caused by DNS request timeout.
• You can enable DNS log with the debug level or capture wireless packets for further analysis.
• To enable the debug level DNS log, you can add #define DNS_DEBUG LWIP_DBG_ON code to the
esp-idf/components/lwip/lwip/src/include/lwip/opt.h le, and then enable the Com-
ponent config > LWIP > Enable LWIP Debug conguration.
4.5.5 MQTT
How to congure the server address so as to make it an autonomic cloud platform by using MQTT?
Please refer to MQTT Examples.
I’m using ESP8266 release/v3.3 version of SDK to test the example/protocols/esp-mqtt/tcp example. Then
during Wi-Fi conguration, the connection fails after conguring SSID, password and connecting to the
default server. The log is as follows, what is the reason?
W (4211) MQTT_CLIENT: Connection refused, not authorized
I (4217) MQTT_CLIENT: Error MQTT Connected
I (4222) MQTT_CLIENT: Reconnect after 10000 ms
I (4228) MQTT_EXAMPLE: MQTT_EVENT_DISCONNECTED
I (19361) MQTT_CLIENT: Sending MQTT CONNECT message, type: 1, id: 0000
When such error occurs, it indicates that the server rejected the connection because the client’s wrong
MQTT username and password caused the server-side authentication to fail. Please check if you are
using the correct MQTT username and password.
What is the default keepalive value of the MQTT component in ESP-IDF?
The default value is 120 s, which is dened by MQTT_KEEPALIVE_TICK in le mqtt_config.h.
Espressif Systems 100
Submit Document Feedback
Release master