-->
Page 1 of 1

slow tcp on esp8266

PostPosted: Mon Oct 10, 2022 11:35 am
by dannybackx
Hey,
I have an app to run a power switch, which I could update via OTA until recently.
Written in C++ against the rtos sdk.

Suddenly (after build system updates?) I find that the OTA doesn't work any more. I think I see two things : only a packet per second, and frequent timeouts. Both phenomenons are new : I used to be able to OTA my app in 30 seconds from start to reboot.

This shows some of that :
Code: Select allI (10799) WebServer: Starting httpd
I (23812) WebServer: Receiving (req content-len 753696)
I (23818) WebServer: httpd_req_recv 1400
I (24823) WebServer: httpd_req_recv 1400
I (25835) WebServer: httpd_req_recv 1400
I (26844) WebServer: httpd_req_recv 120
I (29478) WebServer: httpd_req_recv 1280
I (30487) WebServer: httpd_req_recv 1400
I (31495) WebServer: httpd_req_recv 76
I (33157) WebServer: httpd_req_recv 1324
I (34168) WebServer: httpd_req_recv 116
I (37149) WebServer: httpd_req_recv 1284
I (38159) WebServer: httpd_req_recv 1400
I (39167) WebServer: httpd_req_recv 196
I (45128) WebServer: httpd_req_recv 1204
I (46142) WebServer: httpd_req_recv 1400
I (47150) WebServer: httpd_req_recv 276
E (53151) httpd: httpd_default_recv: recv error -1
W (53155) httpd_txrx: httpd_sock_err: error in recv : 0
E (58162) httpd: httpd_default_recv: recv error -1
W (58165) httpd_txrx: httpd_sock_err: error in recv : 0
I (61393) WebServer: httpd_req_recv 1124
I (62407) WebServer: httpd_req_recv 1400
I (63415) WebServer: httpd_req_recv 356
E (69416) httpd: httpd_default_recv: recv error -1
W (69419) httpd_txrx: httpd_sock_err: error in recv : 0
E (74428) httpd: httpd_default_recv: recv error -1
W (74431) httpd_txrx: httpd_sock_err: error in recv : 0
E (79439) httpd: httpd_default_recv: recv error -1
W (79442) httpd_txrx: httpd_sock_err: error in recv : 0
E (84450) httpd: httpd_default_recv: recv error -1
W (84453) httpd_txrx: httpd_sock_err: error in recv : 0
E (89462) httpd: httpd_default_recv: recv error -1
W (89465) httpd_txrx: httpd_sock_err: error in recv : 0
E (94474) httpd: httpd_default_recv: recv error -1
W (94477) httpd_txrx: httpd_sock_err: error in recv : 0


My source is at https://sourceforge.net/p/serre/svncode ... Server.cpp .

Any clues ?
Thanks,

Danny

Re: slow tcp on esp8266

PostPosted: Tue Oct 11, 2022 11:43 am
by dannybackx
Solved by copying a file "sdkconfig.works" to the regular one.
This habit has saved my ass more than once before.

Not clear to me which of the settings below can cause this.
Some of them (number of sockets, etc) were edits from after the problem occurred.

Code: Select allhp: {301} diff sdkconfig sdkconfig-
64,65c64,65
< CONFIG_ESPTOOLPY_MONITOR_BAUD_74880B=y
< # CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B is not set
---
> # CONFIG_ESPTOOLPY_MONITOR_BAUD_74880B is not set
> CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y
71c71
< CONFIG_ESPTOOLPY_MONITOR_BAUD=74880
---
> CONFIG_ESPTOOLPY_MONITOR_BAUD=115200
100,101c100,101
< # CONFIG_ESP_TLS_USING_MBEDTLS is not set
< CONFIG_ESP_TLS_USING_WOLFSSL=y
---
> CONFIG_ESP_TLS_USING_MBEDTLS=y
> # CONFIG_ESP_TLS_USING_WOLFSSL is not set
106,108c106
< CONFIG_ESP_WOLFSSL_SMALL_CERT_VERIFY=y
< # CONFIG_ESP_DEBUG_WOLFSSL is not set
< CONFIG_ESP_WOLFSSL_INTERNAL=y
---
> # CONFIG_ESP_WOLFSSL_INTERNAL is not set
127c125
< # CONFIG_ESP_PANIC_PRINT_REBOOT is not set
---
> CONFIG_ESP_PANIC_PRINT_REBOOT=y
129c127
< CONFIG_ESP_PANIC_GDBSTUB=y
---
> # CONFIG_ESP_PANIC_GDBSTUB is not set
133c131,132
< # CONFIG_ESP8266_OTA_FROM_OLD is not set
---
> CONFIG_ESP8266_OTA_FROM_OLD=y
> # CONFIG_LOAD_OLD_RF_PARAMETER is not set
165c164
< CONFIG_ESP_CONSOLE_UART_BAUDRATE=74880
---
> CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200
175,177d173
< CONFIG_ESP_GDBSTUB_ENABLED=y
< CONFIG_ESP_GDBSTUB_SUPPORT_TASKS=y
< CONFIG_ESP_GDBSTUB_MAX_TASKS=32
257c253
< CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y
---
> # CONFIG_LIBSODIUM_USE_MBEDTLS_SHA is not set
272c268
< CONFIG_LWIP_MAX_SOCKETS=10
---
> CONFIG_LWIP_MAX_SOCKETS=5
275,276c271
< CONFIG_LWIP_SO_REUSE=y
< CONFIG_LWIP_SO_REUSE_RXTOALL=y
---
> # CONFIG_LWIP_SO_REUSE is not set
280,281c275,276
< CONFIG_LWIP_IP6_FRAG=y
< # CONFIG_LWIP_IP4_REASSEMBLY is not set
---
> # CONFIG_LWIP_IP6_FRAG is not set
> CONFIG_LWIP_IP4_REASSEMBLY=y
297,298c292,293
< CONFIG_LWIP_MAX_ACTIVE_TCP=16
< CONFIG_LWIP_MAX_LISTENING_TCP=16
---
> CONFIG_LWIP_MAX_ACTIVE_TCP=5
> CONFIG_LWIP_MAX_LISTENING_TCP=5
314c309
< CONFIG_LWIP_MAX_UDP_PCBS=16
---
> CONFIG_LWIP_MAX_UDP_PCBS=5
400,401c395,396
< CONFIG_util_assert=y
< CONFIG_ESP_SHA=y
---
> # CONFIG_util_assert is not set
> # CONFIG_ESP_SHA is not set
472,473c467,468
< CONFIG_MONITOR_BAUD_74880B=y
< # CONFIG_MONITOR_BAUD_115200B is not set
---
> # CONFIG_MONITOR_BAUD_74880B is not set
> CONFIG_MONITOR_BAUD_115200B=y
479c474
< CONFIG_MONITOR_BAUD=74880
---
> CONFIG_MONITOR_BAUD=115200
497c492
< CONFIG_CONSOLE_UART_BAUDRATE=74880
---
> CONFIG_CONSOLE_UART_BAUDRATE=115200