Page 1 of 1

AT+HTTPCPOST timeout

Posted: Wed Mar 16, 2022 2:39 pm
by Stephan
Trying to reach a server that needs about 8 seconds to reply, but AT+HTTPCPOST always returns with "SEND FAIL" after 5 seconds already. How to change this timeout with AT+ commands??

We cannot adjust the timing somewhere in a .h file, because it's about units in the field, not in the lab.

(when we address the server "manually" with AT TCP/IP commands, the answer is well received, after 8 to 10 seconds).

Re: AT+HTTPCPOST timeout

Posted: Fri Mar 18, 2022 2:35 am
by ESP_Sun
You can change

Code: Select all

static const int DEFAULT_TIMEOUT_MS = 5000
in esp-at/esp-idf/components/esp_http_client/esp_http_client.c file.

Code: Select all

static const int DEFAULT_TIMEOUT_MS = 5000
This configuration is to set the timeout time of the AT+HTTPCPOST command.
If you don't want to change the source code, you can make an HTTP package and use AT+CIPSTART and AT+CIPSEND commands instead of AT+HTTPCPOST command.