-
Notifications
You must be signed in to change notification settings - Fork 9
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
[BUG] assert failed: tcp_update_rcv_ann_wnd IDF/components/lwip/lwip/src/core/tcp.c:951 (new_rcv_ann_wnd <= 0xffff) ONLY when connected in AP #23
Comments
Hello, for now with the info, it is not enough to trigger any action item, so I will let this issue opened in case you can find out more about it or other people. In theory, AP mode should not differ (and the fix was reproduced and tested in AP mode), by me and also other people from other projects. I would suggest you work on a minimal reproductible use case : a new main file only involving AsyncTCP and ESPAsyncWS, no ESPAsync_WiFiManager (which is bringing its own outdated dependencies by the way). It really feels that the wrong library or wrong version is linked... |
Okay, I stripped it down to bare bones and removed all the ajax and javascript so the page loads just a static page. The problem still happens, but not as often. I need to refresh the screen a handful of times, but it still does it. Tried on a second board with a different, but older micro, and it does it too. I acknowledge that probably everybody is a better programmer than my hobbyist style, so here is a link to my vscode project if i'm just doing something wrong scold me and hopefully nobody wastes time.
I went and moved the images into progmem so littlefs is not involved and the problem is still there. Also i ran the esp32_exception_decoder filter this time:
|
ok, can you please try something... Inside
with:
I've looked at your project and I only see the definition of your content which could be progmem to free space, but the way you use ESPAsycnWS you go through the progmem handler anyway. |
It amazes me that you do what you do, how do you even know where to look? I moved everything to progmem just to eliminate littlefs just-in-case. I can move everything back if it helps. I made the change and was able to still cause the error. Most times the page loads quickly/immediately. Occasionally it loads and then only half an image and then goes through a timeout or something and gives up without loading, and then less occasionally the same error as before and seems to fail immediately without the timeout event. I also, I think, for the first time got a new error:
|
Not really: the issue you got looks exactly like this long-standing issue impacting also other forks and projects:
The fix was merged : #18 That is why I really don't understand why you have it, and made you try to rollback the fix, just in case it has a side effect I don't yet know about. The new issue you have is clearly an indication that you are running out of memory. If you have some progmem data (
if you have some files in the FileSystem, you instead this to serve all files from a root location for example (or one serveStatic per file)
I would suggest that you rollback the change - make sure you run AsyncTCP without any modifications, then clean your code, then retry, and if it fails like before, retry the patch I gave you. You could also serve the progmem data using chunk encoding if you wanted to, like in the project example: /*
Chunked encoding test: sends 16k of characters.
❯ curl -N -v -X GET -H "origin: http://192.168.4.1" http://192.168.4.1/chunk
*/
static const char characters[] = "1234567890";
static size_t charactersIndex = 0;
server.on("/chunk", HTTP_HEAD | HTTP_GET, [](AsyncWebServerRequest* request) {
AsyncWebServerResponse* response = request->beginChunkedResponse("text/html", [](uint8_t* buffer, size_t maxLen, size_t index) -> size_t {
if (index >= 16384)
return 0;
memset(buffer, characters[charactersIndex], maxLen);
charactersIndex = (charactersIndex + 1) % 10;
return maxLen;
});
request->send(response);
}); I really don't understand yet why rolling back the patch would solve your issue if that's the case. |
Also here are additional tests you can try:
|
FYI @jordanfuerst : #24 I will merge and release soon. If you happen to see the issue again with the new upcoming releases, please let me know / reopen this issue. |
Description
I have a web page (19KB) on a esp32dev (esp32-wroom-32E) with some text and two png files (4KB and 7KB) . The page works flawlessly for days when the esp32 is connected as a station and is accessed via wireless router, but if I connect to it with it acting like an AP in either WIFI_MODE_APSTA or WIFI_MODE_AP mode I get the following crash nearly, if not, 100% of the time:
assert failed: tcp_update_rcv_ann_wnd IDF/components/lwip/lwip/src/core/tcp.c:951 (new_rcv_ann_wnd <= 0xffff)
Backtrace: 0x400837b9:0x3ffb2cc0 0x4008d8bd:0x3ffb2ce0 0x40092f15:0x3ffb2d00 0x400fc3ee:0x3ffb2e30 0x400fc49c:0x3ffb2e50 0x401593c5:0x3ffb2e70 0x400f9268:0x3ffb2e90
I've made the following recommended changes:
-D CONFIG_ASYNC_TCP_MAX_ACK_TIME=3000
-D CONFIG_ASYNC_TCP_PRIORITY=10
-D CONFIG_ASYNC_TCP_QUEUE_SIZE=128
-D CONFIG_ASYNC_TCP_RUNNING_CORE=1
-D CONFIG_ASYNC_TCP_STACK_SIZE=4096
-D WS_MAX_QUEUED_MESSAGES=128
Additional notes
I think that the web page text visually loads, its not till the images are downloaded that it crashes (I THINK - not sure really how to verify this 100%). The index.html is loaded from PROGMEM while the images are loaded from littlefs
It makes no difference if in pure AP mode or APSTA and it makes no difference if it is connected as a station or not during the crash in APSTA. Client connected web page access is rock solid even in APSTA mode.
I see that there was a fix in v3.2.4 (fix#14 and #18) the fix must somehow only work in client connections, also this fix is included in 3.2.5 (I manually verified just to be safe)
I'm using latest AsyncTCP-3.2.5 and ESPAsyncWebServer-3.3.1 and ESPAsync_WiFiManager-1.15.1
I can duplicate this at will, and unfortunately the use case of this device is to connect directly to it to control a piece of equipment on my farm where there is no WiFi to rout it through.
If somehow useful: addr2line of backtrace gives:
panic_abort
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/panic.c:408
esp_system_abort
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/esp_system.c:137
__assert_func
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/assert.c:85
lwip_recvfrom_udp_raw
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/sockets.c:1196
get_socket
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/sockets.c:523
wr_rf_freq_mem
/home/cff/gittree/chip7.1_phy/chip_7.1/board_code/app_test/pp/phy/phy_chip_v7_ana.c:1208 (discriminator 3)
printf_decode
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/wpa_supplicant/src/utils/common.c:162
Thanks for any help or hopefully a fix by someone smarter than me...
-Jordan
The text was updated successfully, but these errors were encountered: