Wifi espnow type 3 , heap ( memory ) TXQ ( transmit buffer ) error

utkutpcgl
Posts: 8
Joined: Tue Nov 17, 2020 5:17 am

Wifi espnow type 3 , heap ( memory ) TXQ ( transmit buffer ) error

Postby utkutpcgl » Wed Feb 24, 2021 1:48 pm

I receive an error while I am sending the encoded output of amr encoder with espnow to another board.
I use:
- Lyrat and Lyrat MSC boards. I face the error on both. (Whoever is sending, receives the error after some time).
- idf(4.3)-adf(latest).

This is the error I face:
E (...) wifi:esf_buf t=3 l=64 max:32, alloc:32 no eb, TXQ_BLOCK=0
W (...) wifi:alloc eb len=64 type=3 fail, heap:145348

The error appears sometimes once an hour and sometimes after 5 minutes, it is inconsistent, but mostly it takes some time for the error to occur.
I use a callback function (writeToEspnowSendBuffer) to check whether data is ready at the encoder:
audio_element_set_write_cb(amrEncoder, writeToEspnowSendBuffer , NULL);

Then inside the callback (method) writeToEspnowSendBuffer() I call esp_now_send() to send the available data:

if (esp_now_send(espnowUnicastMacAddr, sendParam->buffer, sendParam->len) != ESP_OK)
{
ESP_LOGI(TAG_SEND_RECIEVE,"esp_now_send caused an error!!!");
esp_restart();
}

**Some guesses about the error:**
I have read other posts about this issue and I think it is because I call esp_now_send() method too frequently without delay. I do not think that I am out of internal memory since the error shows there is available heap memory. Maybe the output data of the encoder is sometimes available with a delay that is too small for calling esp_now_send() again. I do not want to use the SPI RAM, but lack of memory might also be a cause.
Any advice to overcome this issue?
Thanks in advance.

Who is online

Users browsing this forum: Baidu [Spider], RathiSonika and 145 guests