Skip to content

HTTPUpdate read Timeout #9823

Closed
Closed
@hitecSmartHome

Description

@hitecSmartHome

Board

ESP32-Wrover

Device Description

Hardware Configuration

Version

v2.0.17

IDE Name

PlatformIO

Operating System

Windows10

Flash frequency

80

PSRAM enabled

yes

Upload speed

115200

Description

I want to perform a HTTPUpdate which was working fine before but suddenly I got read Timeout.

Sketch

WiFiClientSecure secureClient;
HTTPUpdate Updater;

secureClient.setInsecure();
secureClient.setTimeout(35);

Updater.rebootOnUpdate(false);
Updater.setFollowRedirects(HTTPC_FORCE_FOLLOW_REDIRECTS);

Updater.onStart([this]() { updateStart(); });
Updater.onEnd([this]() { updateSuccess(); });
Updater.onError([this](int err) { updateError(err); });
Updater.onProgress([this](int current, int total) {
    updateProgressReport(100.0 * current / total);
});

void VersionHandler::startFirmware(){
    updateStage = FIRMWARE_STAGE;
    std::string url = std::string(config.serverBaseURL) + "version?version=" + versionToDownload;
    printf("[VersionHandler] - Stage 1. Start: %s\n", url.c_str());
    HTTPUpdateResult result = Updater.update(secureClient, url.c_str(), "", [](HTTPClient *http) {
        http->addHeader("identity", config.jsonKey.c_str());
        http->addHeader("Accept", "application/octet-stream");
    });
    if( result != HTTP_UPDATE_OK ){ updateError(result); }else{
        startFileSystem();
    }
}

Debug Message

[VersionHandler] - Download task started. New version: 1.0.39

[VersionHandler] - Download task started

[VersionHandler] - Stage 1. Start: https://test.hshTest.hu/version?version=1.                                 0.39

[824832][V][HTTPClient.cpp:252] beginInternal(): url: https://test.hshTest.hu/version?version=1.0.39

[824855][D][HTTPClient.cpp:303] beginInternal(): protocol: https, host: test.hshTest.hu port:                                  443 url: /version?version=1.0.39

[826704][D][HTTPClient.cpp:598] sendRequest(): request type: 'GET' redirCount: 0



[826877][V][ssl_client.cpp:62] start_ssl_client(): Free internal heap before TLS 124311

[826885][V][ssl_client.cpp:68] start_ssl_client(): Starting socket

[826924][V][ssl_client.cpp:146] start_ssl_client(): Seeding the random number generator

[826933][V][ssl_client.cpp:155] start_ssl_client(): Setting up the SSL/TLS structure...

[826941][D][ssl_client.cpp:176] start_ssl_client(): WARNING: Skipping SSL Verification. INSECURE!

[826949][V][ssl_client.cpp:254] start_ssl_client(): Setting hostname for TLS session...

[826961][V][ssl_client.cpp:269] start_ssl_client(): Performing the SSL/TLS handshake...

[827532][V][ssl_client.cpp:290] start_ssl_client(): Verifying peer X.509 certificate...

[827540][V][ssl_client.cpp:298] start_ssl_client(): Certificate verified.

[827546][V][ssl_client.cpp:313] start_ssl_client(): Free internal heap after TLS 122551

[827555][D][HTTPClient.cpp:1170] connect():  connected to test.hshTest.hu:443

[827563][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 597 bytes...

[835582][D][HTTPClient.cpp:642] sendRequest(): sendRequest code=-11



[835588][W][HTTPClient.cpp:1483] returnError(): error(-11): read Timeout

[835595][D][HTTPClient.cpp:1485] returnError(): tcp stop

[835601][V][ssl_client.cpp:321] stop_ssl_socket(): Cleaning SSL connection.

[835610][E][HTTPUpdate.cpp:234] handleUpdate(): HTTP error: read Timeout



[835617][D][HTTPClient.cpp:408] disconnect(): tcp is closed



[835622][V][ssl_client.cpp:321] stop_ssl_socket(): Cleaning SSL connection.

[VersionHandler] - Stage 1/2 error code: 0
[VersionHandler] - HTTP error: read Timeout

Other Steps to Reproduce

No response

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

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions