I think the v4.1-dev has an issue with OTA.
I am using version v4.1-dev-1770-g71b4768df-dirty.
Previously, I tested the version v4.0-beta2, and the simple_ota_example is working correctly when I followed this https://github.com/espressif/esp-idf/tr ... system/ota
Due to the problem of secure boot and flash encryption, I have to use version v4.1-dev, and it broke my OTA code.
I went back the example and ran it it is also broke.
I (4120) simple_ota_example: Starting OTA example
I (5830) esp_https_ota: Starting OTA...
I (5830) esp_https_ota: Writing to partition subtype 16 at offset 0x110000
D (11600) HTTP_CLIENT: esp_transport_read returned:-1 and errno:128
E (11610) esp_https_ota: Connection closed3, errno = 80
I (11610) esp_image: segment 0: paddr=0x00110020 vaddr=0x3f400020 size=0x04bd8 ( 19416) map
I (11620) esp_image: segment 1: paddr=0x00114c00 vaddr=0x3ffb0000 size=0x01940 ( 6464)
I (11620) esp_image: segment 2: paddr=0x00116548 vaddr=0x40080000 size=0x00404 ( 1028)
0x40080000: _WindowOverflow4 at C:/esplatest/esp-idf/components/freertos/xtensa_vectors.S:1778
I (11630) esp_image: segment 3: paddr=0x00116954 vaddr=0x40080404 size=0x08bcc ( 35788)
I (11650) esp_image: segment 4: paddr=0x0011f528 vaddr=0x00000000 size=0x00af0 ( 2800)
I (11650) esp_image: segment 5: paddr=0x00120020 vaddr=0x400d0020 size=0x12800 ( 75776) map
0x400d0020: _stext at ??:?
E (11690) simple_ota_example: Firmware upgrade failed
I tried to trace back where the error was I saw the code
Code: Select all
case ESP_HTTPS_OTA_IN_PROGRESS:
data_read = esp_http_client_read(handle->http_client,
handle->ota_upgrade_buf,
handle->ota_upgrade_buf_size);
if (data_read == 0) {
/*
* As esp_http_client_read never returns negative error code, we rely on
* `errno` to check for underlying transport connectivity closure if any
*/
if (errno == ENOTCONN || errno == ECONNRESET) {
ESP_LOGE(TAG, "Connection closed3, errno = %x", errno);
return ESP_FAIL;
}
I found ENOTCONN = 126 and ECONNRESET=108; neither of these was 128. Is there anything that miss? I don't understand since the errno should not return ESP_FAIL.
I also found #define ENOTSOCK 128 from header file errno.h, which is "Socket operation on non-socket" that is not in the directory of the project.
Please let me know if you encounter the same issue and please suggest where can I go next to fix the problem.