Page 1 of 1

Failed to create MQTT task

Posted: Fri Apr 10, 2020 3:20 am
by nzh912

Code: Select all

E (110796) MQTT_CLIENT: C:/Users/msys32_stable_v3.3.1/home/Admin/esp/esp-idf/components/mqtt/esp-mqtt/mqtt_client.c:482 (esp_mqtt_client_init)
: Memory exhausted
W (110806) MQTT_CLIENT: Client asked to stop, but was not started
E (110816) MQTT_CLIENT: Client was not initialized

i got this error when my esp32 failed to create mqtt task.

Re: Failed to create MQTT task

Posted: Fri Apr 10, 2020 7:30 am
by ESP_Sprite
Okay. What is your question?

Re: Failed to create MQTT task

Posted: Fri Apr 10, 2020 1:20 pm
by nzh912
the error showing that memory exhausted when initializing the mqtt client.

How to fix this problem? is there any way i can do to flush the memory or clean the memory.

Re: Failed to create MQTT task

Posted: Sat Apr 11, 2020 8:27 am
by ESP_Sprite
It means that there is no more free memory. You need to use less memory in the rest of your program.

Re: Failed to create MQTT task

Posted: Sat Apr 11, 2020 9:11 am
by nzh912
ESP_Sprite wrote: It means that there is no more free memory. You need to use less memory in the rest of your program.
beside reduce the memory usage of my program, is there if i use external SRAM can increase the memory size?
Now i am developing the program using ESP32-WROOM-32D (4MB).

Re: Failed to create MQTT task

Posted: Sun Apr 12, 2020 8:41 am
by ESP_Sprite
You could switch to a module with PSRAM, indeed.

Re: Failed to create MQTT task

Posted: Sun Apr 12, 2020 10:49 am
by nzh912
thank you for the info.

Beside that, it seem like the wifi task took a lot of memory, is there a method i can flush out/clear the wifi memory ?

Re: Failed to create MQTT task

Posted: Mon Apr 13, 2020 6:32 am
by ESP_Sprite
I think you can set the amount of tx/rx buffers in menuconfig. This will impact your WiFi speeds a bit, though; not sure if that's very relevant if you only send/receive mqtt messages.