esp-tls read error: -76 and errno 11 for OTA esp-idf 4.0

pushtoopen
Posts: 10
Joined: Sun Feb 25, 2018 4:11 pm

esp-tls read error: -76 and errno 11 for OTA esp-idf 4.0

Postby pushtoopen » Tue Aug 20, 2019 5:06 pm

Hi all, attempting to get the simple_ota_example working and the device seems to have problems mid download of the hello-world.bin that the readme.md suggests using as a sample file.

Running: v4.0-dev-1443-g39f090a4f

I used the hello_world example and complied the file after running idf.py menuconfig. I copied hello-world.bin over to the folder that im running the openssl file server out of.

I had to setup the linux firewall to pass through port 8070. i used:
sudo firewall-cmd --permanant --add-port=8070/tcp
This allowed the ESP32 to see the fileserver

I am able to get the device to connect to the wifi network and get an I.P address. Once that's complete, the device is able to ping my openssl fileserver and it attempts to serve up the hello-world.bin file. The fileserver outputs (FILE:hello-world.bin, ACCEPT).



Once that begins, i get the following output over serial from the ESP32:

I (10121) simple_ota_example: Starting OTA example
I (14921) esp_https_ota: Starting OTA...
I (14921) esp_https_ota: Writing to partition subtype 16 at offset 0x110000
E (23371) esp-tls: read error :-76:
E (23371) TRANS_SSL: esp_tls_conn_read error, errno=No more processes
W (23371) HTTP_CLIENT: esp_transport_read returned : -76 and errno : 11
E (30341) esp-tls: read error :-76:
E (30341) TRANS_SSL: esp_tls_conn_read error, errno=No more processes
W (30341) HTTP_CLIENT: esp_transport_read returned : -76 and errno : 11
I (30341) esp_https_ota: Connection closed, all data received
I (30361) esp_image: segment 0: paddr=0x00110020 vaddr=0x3f400020 size=0x0a14c ( 41292) map
E (30391) esp_image: invalid segment length 0xffffffff
E (30401) simple_ota_example: Firmware upgrade failed

does anyone have any thoughts on why im getting an invalid segment length?

if i run curl or use a web browser, i am able to succesfully get the hello-world.bin file and its the same size post-download as what it orginally was.

When running wireshark, i get the following packets captured (esp32 is 192.168.1.5, while the file server is 192.168.1.3)

No. Time Source Destination Protocol Length Info
1 0 78:d2:94:71:e4:48 Broadcast ARP 60 Who has 192.168.1.5? Tell 192.168.1.1
2 0.922478637 c4:4f:33:18:0c:71 Broadcast ARP 42 Who has 192.168.1.5? Tell 0.0.0.0
3 0.922489758 c4:4f:33:18:0c:71 Broadcast ARP 42 Who has 192.168.1.5? Tell 0.0.0.0
4 1.432804737 c4:4f:33:18:0c:71 Broadcast ARP 42 Gratuitous ARP for 192.168.1.5 (Request)
5 1.43390955 c4:4f:33:18:0c:71 Broadcast ARP 42 Who has 192.168.1.3? Tell 192.168.1.5
6 1.433918823 IntelCor_b8:f5:01 c4:4f:33:18:0c:71 ARP 42 192.168.1.3 is at 44:85:00:b8:f5:01
7 1.442075241 192.168.1.5 192.168.1.3 TCP 58 50685 > 8070 [SYN] Seq=0 Win=5744 Len=0 MSS=1440
8 1.442124519 192.168.1.3 192.168.1.5 TCP 58 8070 > 50685 [SYN, ACK] Seq=0 Ack=1 Win=29200 Len=0 MSS=1460
9 1.449926964 192.168.1.5 192.168.1.3 TCP 54 50685 > 8070 [ACK] Seq=1 Ack=1 Win=5744 Len=0
10 1.457632933 192.168.1.5 192.168.1.3 TCP 294 50685 > 8070 [PSH, ACK] Seq=1 Ack=1 Win=5744 Len=240
11 1.457651891 192.168.1.3 192.168.1.5 TCP 54 8070 > 50685 [ACK] Seq=1 Ack=241 Win=30016 Len=0
12 1.460411851 192.168.1.3 192.168.1.5 TCP 1305 8070 > 50685 [PSH, ACK] Seq=1 Ack=241 Win=30016 Len=1251
13 1.667731553 192.168.1.3 192.168.1.5 TCP 1305 [TCP Retransmission] 8070 > 50685 [PSH, ACK] Seq=1 Ack=241 Win=30016 Len=1251
14 1.680791177 192.168.1.5 192.168.1.3 TCP 54 50685 > 8070 [ACK] Seq=241 Ack=1252 Win=4493 Len=0
15 1.68587503 192.168.1.5 192.168.1.3 TCP 54 [TCP Dup ACK 14#1] 50685 > 8070 [ACK] Seq=241 Ack=1252 Win=4493 Len=0
16 1.945146358 c4:4f:33:18:0c:71 Broadcast ARP 42 Gratuitous ARP for 192.168.1.5 (Request)
17 2.151936914 192.168.1.5 192.168.1.3 TCP 129 50685 > 8070 [PSH, ACK] Seq=241 Ack=1252 Win=4493 Len=75
18 2.191722543 192.168.1.3 192.168.1.5 TCP 54 8070 > 50685 [ACK] Seq=1252 Ack=316 Win=30016 Len=0
19 2.257626616 192.168.1.5 192.168.1.3 TCP 105 50685 > 8070 [PSH, ACK] Seq=316 Ack=1252 Win=4493 Len=51
20 2.257696405 192.168.1.3 192.168.1.5 TCP 54 8070 > 50685 [ACK] Seq=1252 Ack=367 Win=30016 Len=0
21 2.257876645 192.168.1.3 192.168.1.5 TCP 296 8070 > 50685 [PSH, ACK] Seq=1252 Ack=367 Win=30016 Len=242
22 2.27412856 192.168.1.5 192.168.1.3 TCP 54 50685 > 8070 [ACK] Seq=367 Ack=1494 Win=5693 Len=0
23 2.283613751 192.168.1.5 192.168.1.3 TCP 189 50685 > 8070 [PSH, ACK] Seq=367 Ack=1494 Win=5693 Len=135
24 2.283735181 192.168.1.3 192.168.1.5 TCP 1494 8070 > 50685 [ACK] Seq=1494 Ack=502 Win=31088 Len=1440
25 2.283746756 192.168.1.3 192.168.1.5 TCP 1494 8070 > 50685 [PSH, ACK] Seq=2934 Ack=502 Win=31088 Len=1440
26 2.29084463 192.168.1.3 192.168.1.5 TCP 1494 8070 > 50685 [ACK] Seq=4374 Ack=502 Win=31088 Len=1440
27 2.328870354 192.168.1.5 192.168.1.3 TCP 54 50685 > 8070 [ACK] Seq=502 Ack=2934 Win=5744 Len=0
28 2.328907818 192.168.1.3 192.168.1.5 TCP 1494 8070 > 50685 [PSH, ACK] Seq=5814 Ack=502 Win=31088 Len=1440
29 2.542759538 192.168.1.3 192.168.1.5 TCP 1494 [TCP Retransmission] 8070 > 50685 [PSH, ACK] Seq=2934 Ack=502 Win=31088 Len=1440
30 2.551027626 192.168.1.5 192.168.1.3 TCP 54 [TCP Dup ACK 27#1] 50685 > 8070 [ACK] Seq=502 Ack=2934 Win=5744 Len=0
31 2.7664374 192.168.1.5 192.168.1.3 TCP 54 50685 > 8070 [ACK] Seq=502 Ack=4374 Win=5744 Len=0
32 2.766484884 192.168.1.3 192.168.1.5 TCP 1494 8070 > 50685 [ACK] Seq=7254 Ack=502 Win=31088 Len=1440
33 2.869681684 192.168.1.5 192.168.1.3 TCP 54 [TCP Dup ACK 31#1] 50685 > 8070 [ACK] Seq=502 Ack=4374 Win=5744 Len=0
34 2.869732142 192.168.1.3 192.168.1.5 TCP 1494 [TCP Retransmission] 8070 > 50685 [ACK] Seq=4374 Ack=502 Win=31088 Len=1440
35 2.869750693 192.168.1.3 192.168.1.5 TCP 1494 [TCP Retransmission] 8070 > 50685 [PSH, ACK] Seq=5814 Ack=502 Win=31088 Len=1440
36 2.89775228 192.168.1.5 192.168.1.3 TCP 54 50685 > 8070 [ACK] Seq=502 Ack=8694 Win=5744 Len=0
37 2.897790937 192.168.1.3 192.168.1.5 TCP 1494 8070 > 50685 [PSH, ACK] Seq=8694 Ack=502 Win=31088 Len=1440
38 2.897803502 192.168.1.3 192.168.1.5 TCP 1494 8070 > 50685 [ACK] Seq=10134 Ack=502 Win=31088 Len=1440
39 2.910117693 192.168.1.3 192.168.1.5 TCP 1494 8070 > 50685 [PSH, ACK] Seq=11574 Ack=502 Win=31088 Len=1440
40 2.968736293 c4:4f:33:18:0c:71 Broadcast ARP 42 Gratuitous ARP for 192.168.1.5 (Request)
41 2.985256527 192.168.1.5 192.168.1.3 TCP 54 [TCP Dup ACK 36#1] 50685 > 8070 [ACK] Seq=502 Ack=8694 Win=5744 Len=0
42 2.988754897 192.168.1.3 192.168.1.5 TCP 1494 [TCP Retransmission] 8070 > 50685 [PSH, ACK] Seq=8694 Ack=502 Win=31088 Len=1440
43 3.025147181 192.168.1.5 192.168.1.3 TCP 54 50685 > 8070 [ACK] Seq=502 Ack=10134 Win=5744 Len=0
44 3.025166913 192.168.1.3 192.168.1.5 TCP 1494 [TCP Retransmission] 8070 > 50685 [ACK] Seq=10134 Ack=502 Win=31088 Len=1440
45 3.025180874 192.168.1.3 192.168.1.5 TCP 1494 8070 > 50685 [ACK] Seq=13014 Ack=502 Win=31088 Len=1440
46 3.06204647 192.168.1.5 192.168.1.3 TCP 54 [TCP Dup ACK 43#1] 50685 > 8070 [ACK] Seq=502 Ack=10134 Win=5744 Len=0
47 3.453769074 192.168.1.3 192.168.1.5 TCP 1494 [TCP Retransmission] 8070 > 50685 [ACK] Seq=10134 Ack=502 Win=31088 Len=1440
48 3.491407317 192.168.1.5 192.168.1.3 TCP 54 50685 > 8070 [ACK] Seq=502 Ack=14454 Win=5744 Len=0
49 3.491440817 192.168.1.3 192.168.1.5 TCP 1494 8070 > 50685 [PSH, ACK] Seq=14454 Ack=502 Win=31088 Len=1440
50 3.491453604 192.168.1.3 192.168.1.5 TCP 1494 8070 > 50685 [ACK] Seq=15894 Ack=502 Win=31088 Len=1440
51 3.494282823 192.168.1.3 192.168.1.5 TCP 1494 8070 > 50685 [ACK] Seq=17334 Ack=502 Win=31088 Len=1440
52 3.591908383 192.168.1.5 192.168.1.3 TCP 54 [TCP Dup ACK 48#1] 50685 > 8070 [ACK] Seq=502 Ack=14454 Win=5744 Len=0
53 3.890504954 c4:4f:33:18:0c:71 Broadcast ARP 42 Gratuitous ARP for 192.168.1.5 (Request)
54 4.349773589 192.168.1.3 192.168.1.5 TCP 1494 [TCP Retransmission] 8070 > 50685 [PSH, ACK] Seq=14454 Ack=502 Win=31088 Len=1440
55 4.408768623 192.168.1.5 192.168.1.3 TCP 54 50685 > 8070 [ACK] Seq=502 Ack=15894 Win=5744 Len=0
56 4.408823698 192.168.1.3 192.168.1.5 TCP 1494 [TCP Retransmission] 8070 > 50685 [ACK] Seq=15894 Ack=502 Win=31088 Len=1440
57 4.408840083 192.168.1.3 192.168.1.5 TCP 1494 [TCP Retransmission] 8070 > 50685 [ACK] Seq=17334 Ack=502 Win=31088 Len=1440
58 4.458969139 192.168.1.5 192.168.1.3 TCP 54 [TCP Dup ACK 55#1] 50685 > 8070 [ACK] Seq=502 Ack=15894 Win=5744 Len=0
59 6.121764081 192.168.1.3 192.168.1.5 TCP 1494 [TCP Retransmission] 8070 > 50685 [ACK] Seq=15894 Ack=502 Win=31088 Len=1440
60 6.14985561 192.168.1.5 192.168.1.3 TCP 54 50685 > 8070 [ACK] Seq=502 Ack=18774 Win=4877 Len=0
61 6.149885276 192.168.1.3 192.168.1.5 TCP 1494 8070 > 50685 [ACK] Seq=18774 Ack=502 Win=31088 Len=1440
62 6.149897547 192.168.1.3 192.168.1.5 TCP 1494 8070 > 50685 [PSH, ACK] Seq=20214 Ack=502 Win=31088 Len=1440
63 6.158502628 192.168.1.3 192.168.1.5 TCP 1494 8070 > 50685 [ACK] Seq=21654 Ack=502 Win=31088 Len=1440
64 9.216903976 192.168.1.5 192.168.1.3 TCP 54 [TCP Dup ACK 60#1] 50685 > 8070 [ACK] Seq=502 Ack=18774 Win=4877 Len=0
65 9.577770108 192.168.1.3 192.168.1.5 TCP 1494 [TCP Retransmission] 8070 > 50685 [ACK] Seq=18774 Ack=502 Win=31088 Len=1440
66 9.632344348 192.168.1.5 192.168.1.3 TCP 54 50685 > 8070 [ACK] Seq=502 Ack=20214 Win=5744 Len=0
67 9.632378302 192.168.1.3 192.168.1.5 TCP 1494 [TCP Retransmission] 8070 > 50685 [PSH, ACK] Seq=20214 Ack=502 Win=31088 Len=1440
68 9.632390853 192.168.1.3 192.168.1.5 TCP 1494 [TCP Retransmission] 8070 > 50685 [ACK] Seq=21654 Ack=502 Win=31088 Len=1440
69 9.679974779 192.168.1.5 192.168.1.3 TCP 54 [TCP Dup ACK 66#1] 50685 > 8070 [ACK] Seq=502 Ack=20214 Win=5744 Len=0
70 16.489769587 192.168.1.3 192.168.1.5 TCP 1494 [TCP Retransmission] 8070 > 50685 [PSH, ACK] Seq=20214 Ack=502 Win=31088 Len=1440
71 16.692782641 192.168.1.5 192.168.1.3 TCP 54 50685 > 8070 [ACK] Seq=502 Ack=23094 Win=5744 Len=0
72 16.692838818 192.168.1.3 192.168.1.5 TCP 1494 8070 > 50685 [PSH, ACK] Seq=23094 Ack=502 Win=31088 Len=1440
73 16.69287129 192.168.1.3 192.168.1.5 TCP 1494 8070 > 50685 [ACK] Seq=24534 Ack=502 Win=31088 Len=1440
74 16.705911478 192.168.1.3 192.168.1.5 TCP 1494 8070 > 50685 [PSH, ACK] Seq=25974 Ack=502 Win=31088 Len=1440
75 16.823653432 192.168.1.5 192.168.1.3 TCP 54 [TCP Dup ACK 71#1] 50685 > 8070 [ACK] Seq=502 Ack=23094 Win=5744 Len=0
76 21.710351592 192.168.1.5 192.168.1.3 TCP 54 50685 > 8070 [FIN, ACK] Seq=502 Ack=23094 Win=5744 Len=0
77 21.749780071 192.168.1.3 192.168.1.5 TCP 54 8070 > 50685 [ACK] Seq=27414 Ack=503 Win=31088 Len=0
78 30.409784048 192.168.1.3 192.168.1.5 TCP 1494 [TCP Retransmission] 8070 > 50685 [PSH, ACK] Seq=23094 Ack=503 Win=31088 Len=1440
79 30.518885636 192.168.1.5 192.168.1.3 TCP 54 50685 > 8070 [RST, ACK] Seq=503 Ack=24534 Win=28694 Len=0
80 51.916893421 c4:4f:33:18:0c:71 Broadcast ARP 42 Gratuitous ARP for 192.168.1.5 (Request)
81 111.922842154 c4:4f:33:18:0c:71 Broadcast ARP 42 Gratuitous ARP for 192.168.1.5 (Request)

pushtoopen
Posts: 10
Joined: Sun Feb 25, 2018 4:11 pm

Re: esp-tls read error: -76 and errno 11 for OTA esp-idf 4.0

Postby pushtoopen » Wed Aug 21, 2019 1:09 am

I reverted back to esp-idf v3.3-rc and this is no longer an issue. the OTA update over HTTPS completed successfully.

Please note that this is a legitimate failure in the esp-idf 4.0 toolchain.

Who is online

Users browsing this forum: Bing [Bot] and 19 guests