Failed to create MQTT task

nzh912
Posts: 23
Joined: Mon Mar 25, 2019 4:27 am

Failed to create MQTT task

Postby nzh912 » Fri Apr 10, 2020 3:20 am

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.

ESP_Sprite
Posts: 9711
Joined: Thu Nov 26, 2015 4:08 am

Re: Failed to create MQTT task

Postby ESP_Sprite » Fri Apr 10, 2020 7:30 am

Okay. What is your question?

nzh912
Posts: 23
Joined: Mon Mar 25, 2019 4:27 am

Re: Failed to create MQTT task

Postby nzh912 » Fri Apr 10, 2020 1:20 pm

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.

ESP_Sprite
Posts: 9711
Joined: Thu Nov 26, 2015 4:08 am

Re: Failed to create MQTT task

Postby ESP_Sprite » Sat Apr 11, 2020 8:27 am

It means that there is no more free memory. You need to use less memory in the rest of your program.

nzh912
Posts: 23
Joined: Mon Mar 25, 2019 4:27 am

Re: Failed to create MQTT task

Postby nzh912 » Sat Apr 11, 2020 9:11 am

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).

ESP_Sprite
Posts: 9711
Joined: Thu Nov 26, 2015 4:08 am

Re: Failed to create MQTT task

Postby ESP_Sprite » Sun Apr 12, 2020 8:41 am

You could switch to a module with PSRAM, indeed.

nzh912
Posts: 23
Joined: Mon Mar 25, 2019 4:27 am

Re: Failed to create MQTT task

Postby nzh912 » Sun Apr 12, 2020 10:49 am

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 ?

ESP_Sprite
Posts: 9711
Joined: Thu Nov 26, 2015 4:08 am

Re: Failed to create MQTT task

Postby ESP_Sprite » Mon Apr 13, 2020 6:32 am

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.

Who is online

Users browsing this forum: akolodner25 and 88 guests