Page 1 of 1

http.POST() api hung after few calls

Posted: Sun Jun 21, 2020 1:31 pm
by senthilkarur
Hi,

Our project uses ESP32 Wroom 32D device and we are pushing some JSON data to local http server.

We are using http.POST() to send simple Json file to locally mounted http server. It is working fine for some time (This time is variable and it hung immediately or some time even works for 2 hrs) and suddenly hung inside this api and even not returning with any failures. I want to integrate this solution in real time and because of this failure the reliability of our solution is question marked. Can i get some lead to fix this issue?

After checking with many forums i came to know this issue is faced widely by many people. But not found and good fix for this issue. That is the reason i am raising it here.

Regards,
KSK

Re: http.POST() api hung after few calls

Posted: Mon Jun 22, 2020 5:15 pm
by PeterR
(1) Add Ethernet/Wifi event handlers and print every events code & state.
(2) Set a reasonable esp_http_client_config_t timeout, say 10 seconds and print POST response code if not ok.
(3) When it fails; how do you know that the problem is ESP or server?

If I were a beting man I would say that; you are Wifi, that the connection fails (even my PC drops Wifi every now and then) & that you do not correctly restart stuff after disconnect.