-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
WIFI Disconnect with Reason 34 ?! (IDFGH-4410) #6241
Comments
Another step further, debugging lwip shows me where the mem alloc fails
|
Even with LWIP Stats enable an pbub debug enabled, nothing which explains the ERR_MEM:
|
It seems to fail at a simple malloc call (traced back to mem_malloc), |
@alorbach It's possible, but it is unlikely to happen if your packet size remains the same. I didn't find reason code 34 in our code, is that a hexadecimal number? If so, 22 is refer to INVALID_RSN_IE_CAP, it may happens with very few ap, dose it happen with other ap? |
@YouDONG-ESP Yes it happens with other AP as well, I have three different AP's available for testing. |
I had added heap_caps_print_heap_info before and after the failure,: BEFORE:
AFTER FAIL:
|
The main UDP buffers used are the same, about 500 bytes for incoming (RAW Data) and about 70 bytes for outgoing (DTLS) |
Could you provide a code to reproduce this issue? |
Well you will need a DTLS receiving Server. If I am not able to reproduce the issue, I will try to greate a minimal sketch that reproduces the issue somehow. |
Interesting development! The problem has not totally gone but somehow it is better now - meaning Wifi (LWIP) is not becoming unstable anymore after the first ERR_MEM occurred. So I have a Class that does thwe DTLS UDP Streaming which uses HTTPClient from arduino-esp32, and I was creating / deleting HTTPClient objects dynamically after the ERR_MEM occurred. I remembered that I had trouble (strange exceptions) when deleting dynamic HTTPClient objects before in my OTA Updatecode. So as a workaround, I made the HTTPClient Object static in my OTA update code which was a sufficient at this time for me. Now I did the same to my Class that does the DTLS Streaming, I made the HTTPClient object static at the top of the Class code like this: And it appears to have fixed the problem mostly - I am running DTLS Streaming now since about 30 minutes without any ERR_MEM till yet. So I think HTTPClient is messing something badly up in the destructor. |
Please give a minimal example that shows the problem. |
we have a customer with an esp32 based product of ours and the esp32 is not able to connect to his network, but works literally everywhere else. I get the error 34 (not in hex, but decimal), maybe this is the same issue here? #7593 I cant reproduce it in our office and the customer says he has a devolo "mesh network setup", where only the access points talk mesh to each other and send out a access point (then usable by the customer). But I dont get the whole mesh thematic here :) |
@0xFEEDC0DE64 I have got the problem more or less under control, it happens very very seldom. I believe this is a following error of issues like this, and the hardest error's to find btw. |
FWIW, I can repro WIFI disconnect with reason 34 with a lot of pings to the IP address, and it appears that reason 34 is documented in the 802.11 standard as: "Disassociated because excessive number of frames need to be acknowledged, but are not acknowledged due to AP transmissions and/or poor channel conditions". Searching for "WLAN_STATUS_DENIED_POOR_CHANNEL_CONDITIONS" will bring up plenty of references. Asking for a reconnect (assuming the poor channel conditions have recovered) works fine for me.
|
hi @alorbach this issue may have fixed at new version, please checked with the newest esp-idf master. |
|
Thanks for reporting, feel free to reopen. |
I am on ESP-IDF release 3.3 with arduino-esp32 master branch
I have a sketch that receives about 60 UDP packages per seconds, with a data size of up to 1024 bytes per packet.
At the same time its streaming DTLS data (UDP) with about 25 packets per second with about 70 bytes erach packet.
I have more than enough memory free:
Free: 141KB
Heap: 182KB
At a random point WIFI becomes unstable, it disconnects with reason 34 which I can not find any documentation on!
The Wifi error codes go from 0 to 24 and from 200 to 205 as described here:
https://github.com/espressif/esp-idf/blob/0b71a0a46d67cce681ec55973b020d950d8596bd/docs/en/api-guides/wifi.rst#wi-fi-reason-code
So what does this error code mean?
This is my reconnect handling after the disconnect
After the problem has happened, this repeats every few seconds until I reset:
The text was updated successfully, but these errors were encountered: