simple_ota_example pb with ESP-IDF 4.0

adesandr
Posts: 22
Joined: Sat May 05, 2018 10:51 am

simple_ota_example pb with ESP-IDF 4.0

Postby adesandr » Sat Mar 28, 2020 12:15 pm

Hi,

I'm trying to run the simple_ota_example.
All seems good (certicate handskake, upload, etc), but at the end, I face with a tls problem.

I (3134) tcpip_adapter: sta ip: 192.168.1.45, mask: 255.255.255.0, gw: 192.168.1.1
I (3634) example_connect: Connected to ADesandre
I (3634) example_connect: IPv4 address: 192.168.1.45
I (3634) example_connect: IPv6 address: fe80:0000:0000:0000:32ae:a4ff:fe6c:3fd0
I (3644) simple_ota_example: Starting OTA example
I (6124) esp_https_ota: Starting OTA...
I (6124) esp_https_ota: Writing to partition subtype 16 at offset 0x110000
E (7354) esp-tls: read error :-76:
E (7354) TRANS_SSL: esp_tls_conn_read error, errno=Socket is not connected
I (7354) esp_https_ota: Connection closed, all data received
I (7364) boot_comm: chip revision: 1, min. application chip revision: 0
I (7374) esp_image: segment 0: paddr=0x00110020 vaddr=0x3f400020 size=0x05824 ( 22564) map
E (7384) esp_image: invalid segment length 0xffffffff
E (7394) simple_ota_example: Firmware upgrade failed

Any idea ?

Thank you in advance for your help

Regards.

adesandr
Posts: 22
Joined: Sat May 05, 2018 10:51 am

Re: simple_ota_example pb with ESP-IDF 4.0

Postby adesandr » Sun Mar 29, 2020 11:23 am

Hi,

I've tried to run the native_ota_example, and i've obtained the same issue :

I (3425) tcpip_adapter: sta ip: 192.168.1.44, mask: 255.255.255.0, gw: 192.168.1.1
I (3925) example_connect: Connected to ADesandre
I (3925) example_connect: IPv4 address: 192.168.1.44
I (3925) example_connect: IPv6 address: fe80:0000:0000:0000:32ae:a4ff:fe84:71d0
I (3935) native_ota_example: Starting OTA example
I (3935) native_ota_example: Running partition type 0 subtype 0 (offset 0x00010000)
I (6275) native_ota_example: Writing to partition subtype 16 at offset 0x110000
I (6275) native_ota_example: New firmware version: 1
I (6285) native_ota_example: Running firmware version: 2
I (6785) native_ota_example: esp_ota_begin succeeded
E (7125) esp-tls: read error :-76:
E (7125) TRANS_SSL: esp_tls_conn_read error, errno=Socket is not connected
I (7125) native_ota_example: Connection closed,all data received
I (7135) native_ota_example: Total Write binary data length : 15421
I (7135) boot_comm: chip revision: 1, min. application chip revision: 0
I (7145) esp_image: segment 0: paddr=0x00110020 vaddr=0x3f400020 size=0x053fc ( 21500) map
E (7165) esp_image: invalid segment length 0xffffffff
E (7165) native_ota_example: esp_ota_end failed!
E (7165) native_ota_example: Exiting task due to fatal error...

Has indicated in the exemple, i'm runnint the hhtp server with 'openssl s_server -WWW -key ca_key.pem -cert ca_cert.pem -port 8070'

my version off openssl is 1.1.1a 20 nov 2018.

If you have any idea ?

Regards.

chegewara
Posts: 2230
Joined: Wed Jun 14, 2017 9:00 pm

Re: simple_ota_example pb with ESP-IDF 4.0

Postby chegewara » Sun Mar 29, 2020 3:45 pm

You have 2 situations here.
1. problem with secured connection
E (7125) esp-tls: read error :-76:
E (7125) TRANS_SSL: esp_tls_conn_read error, errno=Socket is not connected
2. i doubt you binary file has on 15421 bytes, so what you are downloading and flashing?
I (7125) native_ota_example: Connection closed,all data received
I (7135) native_ota_example: Total Write binary data length : 15421

adesandr
Posts: 22
Joined: Sat May 05, 2018 10:51 am

Re: simple_ota_example pb with ESP-IDF 4.0

Postby adesandr » Tue Mar 31, 2020 4:44 am

Hi,

Thanks for your answer.
I’ve solved this issue.
All my previous tests were done using Git Bash and his embedded ming64 distribution.
I’ve tried to install msys2 to do the test using OpenSSL 1.1.1e, and both simple_ota and native_ota work fine.
Maybe a problem with the OpenSSL version in Git Bash, but i can’t explain why.

chegewara
Posts: 2230
Joined: Wed Jun 14, 2017 9:00 pm

Re: simple_ota_example pb with ESP-IDF 4.0

Postby chegewara » Tue Mar 31, 2020 5:50 am

Thats possible. Maybe default size of certificate is the issue. esp32 is accepting 2048 bytes key IIRC, but doesnt accept 4096.

Who is online

Users browsing this forum: StanInexeon and 143 guests