esp_http_client stream loosing connection after some time

schieberegister
Posts: 1
Joined: Mon Feb 13, 2023 3:21 pm

esp_http_client stream loosing connection after some time

Postby schieberegister » Mon Feb 13, 2023 4:09 pm

Hi guys,

I am consuming a https stream (text/event-stream) with esp_http_client_perform(). It works fine if there is a constant stream of data (I am processing the data in an event handler). But if there is no message for around 20 minutes, data will not be processed further and the connection seems to have died.

This is my configuration:

Code: Select all

esp_http_client_config_t http_config = {
	.timeout_ms = -1, // seems to disable the tcp timeout
	.keep_alive_enable = true,
	.keep_alive_idle = 10,
	.keep_alive_interval = 10,
	.keep_alive_count = 2,
	.transport_type = HTTP_TRANSPORT_OVER_SSL,
	.method = HTTP_METHOD_GET,
};
I have tried to find an error message by activating the mbedtls and lwip ip logs, but they seem not to notice the connection drop.
The last message from lwip states that it is using lwip_select() am I missing a timeout or something related?

Can someone give me hints on how to solve this or further debugging steps?
I appreciate your help and greetings.

Schieberegister.

ESP_YJM
Posts: 300
Joined: Fri Feb 26, 2021 10:30 am

Re: esp_http_client stream loosing connection after some time

Postby ESP_YJM » Thu Feb 16, 2023 8:23 am

Could you please show the log, error message here?

Who is online

Users browsing this forum: No registered users and 80 guests