Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp_wifi_internal_tx_by_ref returns ESP_ERR_NO_MEM when a client is disconnected #25

Open
pbruynbroeck opened this issue Apr 16, 2021 · 0 comments

Comments

@pbruynbroeck
Copy link

In esp-idf 4.2 (https://github.com/espressif/esp-idf/tree/v4.2), I have some troubles when I send data to a wifi client in UDP: espressif/esp-idf#6852

If the client is disconnected, sendto always (or almost) return ENOMEM.

In esp-idf 4.2 , the version of esp32-wifi-lib is: https://github.com/espressif/esp32-wifi-lib/tree/8075af8. I found that the ENOMEM is the error returned by esp_wifi_internal_tx_by_ref (ESP_ERR_NO_MEM).

  • Why return ESP_ERR_NO_MEM when a client is disconnected ?

I understand that, even in UDP, as the physical layer is Wi-Fi, an ACK is required (https://en.wikipedia.org/wiki/Distributed_coordination_function). So why return a no memory error and not just a timeout or another error like that ?

As ENOMEM is always returned when the device is disconnected, it adds a lot of delay if we process like that.
(And if we don't process like that, the throughput isn't respected and we can't send all our data in time...).

  • What's is your advice to detect properly a disconnection ?

My example code is available in the esp-idf ticket: espressif/esp-idf#6852

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant