espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
12.79k stars 7.24k forks source link

HTTPclient freeze for 2 minutes after sending post data #9606

Open nedoskiv opened 3 weeks ago

nedoskiv commented 3 weeks ago

Board

wt32-eth01

Device Description

wt32-eth01

Hardware Configuration

just wt32-eth01

Version

other

IDE Name

ArduinoIde

Operating System

Windows 7

Flash frequency

often

PSRAM enabled

no

Upload speed

115200

Description

Hello, I'am making http request to a server (thru Ethernet) every 1 second. From time to time (can not happen 10 minutes, or happen 2 times for 5 minutes) Scrpit freezes for exactly 120 seconds on:

int httpResponseCode= http.POST(temp);

timeouts are ignored in that case. I put request part in a separate Task. Main loop and other Tasks are working during freeze period. Ethernet is working, cuz I am able to ping the device. Also placed a web server on other task and it is serving HTML files, while HTTP client is stuck.

I was ESP32 boards version 2.0.11 installed, not working there, updated to 2.0.16, same result

Sketch

http.begin(String(String(config.command_server)+lnk+"&i="+ven_asc_encode()));
    http.setTimeout(3000);
//  http.setConnectTimeout(10000);
    DBG_OUTPUT_PORT.print(" [ IZVESTITEL_REQUEST ] Opening: ");
    DBG_OUTPUT_PORT.println(config.command_server);
    http.addHeader("Content-Type", "text/plain");

    DBG_OUTPUT_PORT.print(" [ IZVESTITEL_REQUEST ] Request: ");
    DBG_OUTPUT_PORT.println(httpRequestData);

    String temp;
    serializeJson(doc2, temp);
    DBG_OUTPUT_PORT.println(".");
    int httpResponseCode= http.POST(temp);
    DBG_OUTPUT_PORT.println("..");

Debug Message

15:17:40.737 -> .
15:17:42.617 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:17:42.657 -> [ DEBUG ] free heap: 168996
15:17:44.657 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:17:44.657 -> [ DEBUG ] free heap: 169000
15:17:46.658 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:17:46.698 -> [ DEBUG ] free heap: 168984
15:17:48.658 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:17:48.658 -> [ DEBUG ] free heap: 168984
15:17:50.698 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:17:50.738 -> [ DEBUG ] free heap: 168984
15:17:52.698 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:17:52.698 -> [ DEBUG ] free heap: 168976
15:17:54.698 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:17:54.698 -> [ DEBUG ] free heap: 168992
15:17:56.738 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:17:56.738 -> [ DEBUG ] free heap: 168984
15:17:58.738 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:17:58.738 -> [ DEBUG ] free heap: 168980
15:18:00.699 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:00.699 -> [ DEBUG ] free heap: 168960
15:18:02.739 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:02.779 -> [ DEBUG ] free heap: 168952
15:18:04.739 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:04.739 -> [ DEBUG ] free heap: 168952
15:18:06.699 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:06.699 -> [ DEBUG ] free heap: 168952
15:18:08.780 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:08.780 -> [ DEBUG ] free heap: 168972
15:18:10.780 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:10.780 -> [ DEBUG ] free heap: 168972
15:18:12.740 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:12.740 -> [ DEBUG ] free heap: 168996
15:18:14.700 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:14.700 -> [ DEBUG ] free heap: 168972
15:18:16.780 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:16.780 -> [ DEBUG ] free heap: 168972
15:18:18.740 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:18.740 -> [ DEBUG ] free heap: 168980
15:18:20.820 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:20.820 -> [ DEBUG ] free heap: 168972
15:18:22.820 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:22.820 -> [ DEBUG ] free heap: 168972
15:18:24.780 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:24.780 -> [ DEBUG ] free heap: 168976
15:18:26.740 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:26.740 -> [ DEBUG ] free heap: 168980
15:18:28.781 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:28.821 -> [ DEBUG ] free heap: 169000
15:18:30.781 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:30.781 -> [ DEBUG ] free heap: 169008
15:18:32.781 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:32.781 -> [ DEBUG ] free heap: 169024
15:18:34.821 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:34.821 -> [ DEBUG ] free heap: 169016
15:18:36.822 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:36.822 -> [ DEBUG ] free heap: 169020
15:18:38.783 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:38.783 -> [ DEBUG ] free heap: 169020
15:18:40.823 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:40.863 -> [ DEBUG ] free heap: 169020
15:18:42.823 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:42.823 -> [ DEBUG ] free heap: 169008
15:18:44.784 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:44.784 -> [ DEBUG ] free heap: 169020
15:18:46.865 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:46.865 -> [ DEBUG ] free heap: 169020
15:18:48.865 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:48.865 -> [ DEBUG ] free heap: 169020
15:18:50.825 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:50.825 -> [ DEBUG ] free heap: 169020
15:18:52.785 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:52.785 -> [ DEBUG ] free heap: 169020
15:18:54.825 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:54.865 -> [ DEBUG ] free heap: 169024
15:18:56.825 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:56.825 -> [ DEBUG ] free heap: 169024
15:18:58.826 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:18:58.826 -> [ DEBUG ] free heap: 169004
15:19:00.866 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:00.866 -> [ DEBUG ] free heap: 169004
15:19:02.866 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:02.866 -> [ DEBUG ] free heap: 169020
15:19:04.826 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:04.826 -> [ DEBUG ] free heap: 169004
15:19:06.867 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:06.907 -> [ DEBUG ] free heap: 169020
15:19:08.867 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:08.867 -> [ DEBUG ] free heap: 169020
15:19:10.867 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:10.867 -> [ DEBUG ] free heap: 169020
15:19:12.908 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:12.908 -> [ DEBUG ] free heap: 169008
15:19:14.908 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:14.908 -> [ DEBUG ] free heap: 169004
15:19:16.868 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:16.868 -> [ DEBUG ] free heap: 169004
15:19:18.949 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:18.949 -> [ DEBUG ] free heap: 169004
15:19:20.909 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:20.909 -> [ DEBUG ] free heap: 169004
15:19:22.869 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:22.869 -> [ DEBUG ] free heap: 169004
15:19:24.950 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:24.950 -> [ DEBUG ] free heap: 169004
15:19:26.950 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:26.950 -> [ DEBUG ] free heap: 169008
15:19:28.910 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:28.910 -> [ DEBUG ] free heap: 169020
15:19:30.950 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:30.990 -> [ DEBUG ] free heap: 169016
15:19:32.950 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:32.950 -> [ DEBUG ] free heap: 168860
15:19:34.910 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:34.910 -> [ DEBUG ] free heap: 169024
15:19:36.990 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:36.990 -> [ DEBUG ] free heap: 169016
15:19:38.990 -> [ WEB ] Status send: {"device_model":"E465B870189CBC2","model":"BC2","name":"име","lan_ip":"192.168.7.78","wifi_ip":"0.0.0.0","izvestitel_ps":207,"izvestitel_fs":0,"izvestitel_fc":0}
15:19:38.990 -> [ DEBUG ] free heap: 169004
15:19:40.750 -> ..

Other Steps to Reproduce

guess the way to reproduce the bug is to send my whole sketch

I have checked existing issues, online documentation and the Troubleshooting Guide