Skip to content

Commit

Permalink
esp32_camera_web_server improve timeouts and sockets
Browse files Browse the repository at this point in the history
  • Loading branch information
ayufan committed Sep 2, 2021
1 parent 6f5e273 commit 0967090
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion components/esp32_camera_web_server/web_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace esphome {
namespace esp32_camera_web_server {

static const int IMAGE_REQUEST_TIMEOUT = 500;
static const int IMAGE_REQUEST_TIMEOUT = 2000;
static const char *TAG = "esp32_camera_web_server2";

// esp32_camera::global_esp32_camera
Expand Down Expand Up @@ -54,6 +54,9 @@ void WebServer::setup() {
httpd_config_t config = HTTPD_DEFAULT_CONFIG();
config.server_port = this->stream_port_;
config.ctrl_port = this->stream_port_;
config.max_open_sockets = 1;
config.backlog_conn = 1;

if (httpd_start(&this->stream_httpd_, &config) == ESP_OK) {
httpd_uri_t uri = {
.uri = "/",
Expand All @@ -71,6 +74,9 @@ void WebServer::setup() {
httpd_config_t config = HTTPD_DEFAULT_CONFIG();
config.server_port = this->snapshot_port_;
config.ctrl_port = this->snapshot_port_;
config.max_open_sockets = 1;
config.backlog_conn = 4;

if (httpd_start(&this->snapshot_httpd_, &config) == ESP_OK) {
httpd_uri_t uri = {
.uri = "/",
Expand Down

0 comments on commit 0967090

Please sign in to comment.