HTTP Server / LWIP / Netconn Errors

paddy_b
Posts: 11
Joined: Wed Jun 06, 2018 2:00 pm

HTTP Server / LWIP / Netconn Errors

Postby paddy_b » Thu Feb 27, 2020 8:54 am

I have an ESP32 running as WiFi AP and running an HTTP server using the IDF HTTP Server Component.

I keep getting request failures with the warning messages:
httpd_txrx: httpd_sock_err: error in send : 104
httpd_txrx: httpd_sock_err: error in recv : 104
these don't happen on every request, and I think they occur more frequently as requests/responses get bigger.

I've been digging through the IDF and enabled the LWIP sockets debugging but I'm struggling to get to the root of it.
Here's a log showing some of the errors. 1.2.3.4 is the IP I've set the ESP to, and only one device is connecting (assigned 1.2.3.5), i'm not sure where the other addresses come from (0.0.0.2, 0.0.0.8), I'm guessing some buffer is overflowing somewhere.

Any helpy getting to the bottom of it would be greatly appreciated

IDF version:
v4.1-dev-369-g4dac7c7df

Code: Select all

I (3780) wifi: wifi driver task: 3ffdfe1c, prio:23, stack:3584, core=0
I (3780) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (3780) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (3810) wifi: wifi firmware version: c01c829
I (3810) wifi: config NVS flash: enabled
I (3810) wifi: config nano formating: disabled
I (3810) wifi: Init dynamic tx buffer num: 32
I (3820) wifi: Init data frame dynamic rx buffer num: 16
I (3820) wifi: Init management frame dynamic rx buffer num: 16
I (3830) wifi: Init management short buffer num: 32
I (3830) wifi: Init static tx buffer num: 8
I (3840) wifi: Init static rx buffer size: 1600
I (3840) wifi: Init static rx buffer num: 8
I (3840) wifi: Init dynamic rx buffer num: 16
I (4420) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (4520) phy: phy_version: 4102, 2fa7a43, Jul 15 2019, 13:06:06, 0, 0
I (4860) phy_init: esp_modem_sleep_register, multiple registration of module (0)
I (4860) phy_init: esp_modem_sleep_register, multiple registration of module (1)
I (13080) wifi: mode : softAP (30:ae:a4:c6:6e:3d)
I (13080) wifi: Total power save buffer number: 4
I (13080) wifi: Init max length of beacon: 752/752
I (13080) wifi: Init max length of beacon: 752/752
lwip_socket(UNKNOWN, SOCK_STREAM, 0) = 54
lwip_setsockopt(54, SOL_SOCKET, optname=0x4, ..) -> on
lwip_bind(54, addr=0:0:0:0:0:0:0:0 port=80)
lwip_bind(54) succeeded
lwip_listen(54, backlog=5)
lwip_socket(PF_INET, SOCK_DGRAM, 17) = 55
lwip_bind(55, addr=127.0.0.1 port=32768)
lwip_bind(55) succeeded
lwip_socket(PF_INET, SOCK_DGRAM, 17) = 56
lwip_select(56, 0x3ffd4f88, 0x0, 0x0, tvsec=-1 tvusec=-1)
I (21590) wifi: new:<1,1>, old:<1,0>, ap:<1,1>, sta:<255,255>, prof:1
I (21600) wifi: station: 48:f1:7f:41:f3:16 join, AID=1, bgn, 40U
I (22290) tcpip_adapter: softAP assign IP to station,IP is: 1.2.3.5
lwip_selscan: fd=54 ready for reading
lwip_select: nready=1
lwip_accept(54)...
lwip_accept(54) returning new sock=57 addr=1.2.3.5 port=52969
lwip_select(58, 0x3ffd4f88, 0x0, 0x0, tvsec=-1 tvusec=-1)
lwip_selscan: fd=54 ready for reading
lwip_selscan: fd=57 ready for reading
lwip_select: nready=2
lwip_recvfrom(57, 0x3ffee524, 128, 0x0, ..)
lwip_recv_tcp: top while sock->lastdata=0x0
lwip_recv_tcp: netconn_recv err=0, pbuf=0x3f82741c
lwip_recv_tcp: buflen=415 recv_left=128 off=0
lwip_recv_tcp: lastdata now pbuf=0x3f82741c
lwip_recvfrom(57):  addr=1.2.3.5 port=52969 len=128
lwip_recvfrom(57, 0x3ffee594, 128, 0x0, ..)
lwip_recv_tcp: top while sock->lastdata=0x3f82741c
lwip_recv_tcp: buflen=287 recv_left=128 off=0
lwip_recv_tcp: lastdata now pbuf=0x3f82741c
lwip_recvfrom(57):  addr=1.2.3.5 port=52969 len=128
lwip_recvfrom(57, 0x3ffee614, 128, 0x0, ..)
lwip_recv_tcp: top while sock->lastdata=0x3f82741c
lwip_recv_tcp: buflen=159 recv_left=128 off=0
lwip_recv_tcp: lastdata now pbuf=0x3f82741c
lwip_recvfrom(57):  addr=1.2.3.5 port=52969 len=128
lwip_recvfrom(57, 0x3ffee694, 128, 0x0, ..)
lwip_recv_tcp: top while sock->lastdata=0x3f82741c
lwip_recv_tcp: buflen=31 recv_left=128 off=0
lwip_recv_tcp: deleting pbuf=0x3f82741c
lwip_recv_tcp: top while sock->lastdata=0x0
lwip_recv_tcp: netconn_recv err=-7, pbuf=0x0
lwip_recvfrom(57):  addr=1.2.3.5 port=52969 len=31
lwip_send(57, data=0x3ffee524, size=63, flags=0x0)
lwip_send(57) err=0 written=63
lwip_send(57, data=0x3f4024e1, size=2, flags=0x0)
lwip_send(57) err=0 written=2
lwip_send(57, data=0x3fff1c40, size=673, flags=0x0)
lwip_send(57) err=0 written=673
lwip_accept(54)...
lwip_accept(54) returning new sock=58 addr=1.2.3.5 port=52970
lwip_select(59, 0x3ffd4f88, 0x0, 0x0, tvsec=-1 tvusec=-1)
lwip_selscan: fd=57 ready for reading
lwip_selscan: fd=58 ready for reading
lwip_select: nready=2
lwip_recvfrom(57, 0x3ffee524, 128, 0x0, ..)
lwip_recv_tcp: top while sock->lastdata=0x0
lwip_recv_tcp: netconn_recv err=0, pbuf=0x3f8272f8
lwip_recv_tcp: buflen=312 recv_left=128 off=0
lwip_recv_tcp: lastdata now pbuf=0x3f8272f8
lwip_recvfrom(57):  addr=1.2.3.5 port=52969 len=128
lwip_recvfrom(57, 0x3ffee58d, 128, 0x0, ..)
lwip_recv_tcp: top while sock->lastdata=0x3f8272f8
lwip_recv_tcp: buflen=184 recv_left=128 off=0
lwip_recv_tcp: lastdata now pbuf=0x3f8272f8
lwip_recvfrom(57):  addr=1.2.3.5 port=52969 len=128
lwip_recvfrom(57, 0x3ffee60d, 128, 0x0, ..)
lwip_recv_tcp: top while sock->lastdata=0x3f8272f8
lwip_recv_tcp: buflen=56 recv_left=128 off=0
lwip_recv_tcp: deleting pbuf=0x3f8272f8
lwip_recv_tcp: top while sock->lastdata=0x0
lwip_recv_tcp: netconn_recv err=-7, pbuf=0x0
lwip_recvfrom(57):  addr=1.2.3.5 port=52969 len=56
lwip_send(57, data=0x3ffee524, size=63, flags=0x0)
lwip_send(57) err=0 written=63
lwip_send(57, data=0x3f4024e1, size=2, flags=0x0)
lwip_send(57) err=0 written=2
lwip_send(57, data=0x3f829e04, size=9052, flags=0x0)
lwip_send(57) err=-14 written=0
W (28770) httpd_txrx: httpd_sock_err: error in send : 104
lwip_recvfrom(58, 0x3ffee524, 128, 0x0, ..)
lwip_recv_tcp: top while sock->lastdata=0x0
lwip_recv_tcp: netconn_recv err=0, pbuf=0x3f82741c
lwip_recv_tcp: buflen=300 recv_left=128 off=0
lwip_recv_tcp: lastdata now pbuf=0x3f82741c
lwip_recvfrom(58):  addr=1.2.3.5 port=52970 len=128
lwip_recvfrom(58, 0x3ffee58a, 128, 0x0, ..)
lwip_recv_tcp: top while sock->lastdata=0x3f82741c
lwip_recv_tcp: buflen=172 recv_left=128 off=0
lwip_recv_tcp: lastdata now pbuf=0x3f82741c
lwip_recvfrom(58):  addr=1.2.3.5 port=52970 len=128
lwip_recvfrom(58, 0x3ffee60a, 128, 0x0, ..)
lwip_recv_tcp: top while sock->lastdata=0x3f82741c
lwip_recv_tcp: buflen=44 recv_left=128 off=0
lwip_recv_tcp: deleting pbuf=0x3f82741c
lwip_recv_tcp: top while sock->lastdata=0x0
lwip_recv_tcp: netconn_recv err=-7, pbuf=0x0
lwip_recvfrom(58):  addr=1.2.3.5 port=52970 len=44
lwip_send(58, data=0x3ffee524, size=64, flags=0x0)
lwip_send(58) err=0 written=64
lwip_send(58, data=0x3f4024e1, size=2, flags=0x0)
lwip_send(58) err=0 written=2
lwip_send(58, data=0x3fff1e58, size=2763, flags=0x0)
lwip_send(58) err=0 written=2763
lwip_select(59, 0x3ffd4f88, 0x0, 0x0, tvsec=-1 tvusec=-1)
lwip_selscan: fd=54 ready for reading
lwip_selscan: fd=57 ready for reading
lwip_select: nready=2
lwip_recvfrom(57, 0x3ffee524, 128, 0x0, ..)
lwip_recv_tcp: top while sock->lastdata=0x0
lwip_recv_tcp: netconn_recv err=-14, pbuf=0x0
lwip_recv_tcp: p == NULL, error is "Connection reset."!
lwip_recvfrom(57):  addr=0.0.0.2 port=19696 len=-1
W (28930) httpd_txrx: httpd_sock_err: error in recv : 104
lwip_close(57)
lwip_accept(54)...
lwip_accept(54) returning new sock=57 addr=1.2.3.5 port=52971
lwip_select(59, 0x3ffd4f88, 0x0, 0x0, tvsec=-1 tvusec=-1)
lwip_selscan: fd=54 ready for reading
lwip_selscan: fd=57 ready for reading
lwip_select: nready=2
lwip_recvfrom(57, 0x3ffee524, 128, 0x0, ..)
lwip_recv_tcp: top while sock->lastdata=0x0
lwip_recv_tcp: netconn_recv err=0, pbuf=0x3f8274c8
lwip_recv_tcp: buflen=297 recv_left=128 off=0
lwip_recv_tcp: lastdata now pbuf=0x3f8274c8
lwip_recvfrom(57):  addr=1.2.3.5 port=52971 len=128
lwip_recvfrom(57, 0x3ffee58d, 128, 0x0, ..)
lwip_recv_tcp: top while sock->lastdata=0x3f8274c8
lwip_recv_tcp: buflen=169 recv_left=128 off=0
lwip_recv_tcp: lastdata now pbuf=0x3f8274c8
lwip_recvfrom(57):  addr=1.2.3.5 port=52971 len=128
lwip_recvfrom(57, 0x3ffee60d, 128, 0x0, ..)
lwip_recv_tcp: top while sock->lastdata=0x3f8274c8
lwip_recv_tcp: buflen=41 recv_left=128 off=0
lwip_recv_tcp: deleting pbuf=0x3f8274c8
lwip_recv_tcp: top while sock->lastdata=0x0
lwip_recv_tcp: netconn_recv err=-7, pbuf=0x0
lwip_recvfrom(57):  addr=1.2.3.5 port=52971 len=41
lwip_send(57, data=0x3ffee524, size=64, flags=0x0)
lwip_send(57) err=0 written=64
lwip_send(57, data=0x3f4024e1, size=2, flags=0x0)
lwip_send(57) err=0 written=2
lwip_send(57, data=0x3f82a4a4, size=8315, flags=0x0)
lwip_send(57) err=0 written=8315
lwip_accept(54)...
lwip_accept(54) returning new sock=59 addr=1.2.3.5 port=52972
lwip_select(60, 0x3ffd4f88, 0x0, 0x0, tvsec=-1 tvusec=-1)
lwip_selscan: fd=54 ready for reading
lwip_selscan: fd=57 ready for reading
lwip_selscan: fd=58 ready for reading
lwip_selscan: fd=59 ready for reading
lwip_select: nready=4
lwip_recvfrom(57, 0x3ffee524, 128, 0x0, ..)
lwip_recv_tcp: top while sock->lastdata=0x0
lwip_recv_tcp: netconn_recv err=-14, pbuf=0x0
lwip_recv_tcp: p == NULL, error is "Connection reset."!
lwip_recvfrom(57):  addr=0.0.0.8 port=19696 len=-1
W (29220) httpd_txrx: httpd_sock_err: error in recv : 104

Who is online

Users browsing this forum: No registered users and 41 guests