Description
Hardware:
Board: Adafruit feather
Core Installation/update date: Dec 1, 2018
IDE name: Arduino IDE 1.8.7
Computer OS: Ubuntu 18.04
Description:
I'm trying to use httpUpdate to an Adafruit esp32 feather with an 832k load hosted on an external server, and it isn't working the way I expected it to.
Looking at the code in packages/esp32/hardware/esp32/1.0.1-rc1:
The error happens because ESP.getFreeSketchSpace() is too small. I was expecting that the new ota load would be put into the non-boot partition which has plenty of space (1.3M), and instead I think it is using the boot partition that already has a load in it and only has 456k left to use.
Am I using the ota tool wrong, or do I need to change my system to have a single larger partition instead of two small ones?
partition table
0 - 10 - 10000 - 140000 - app0 - 0
0 - 11 - 150000 - 140000 - app1 - 0
1 - 2 - 9000 - 5000 - nvs - 0
1 - 0 - e000 - 2000 - otadata - 0
1 - 99 - 290000 - 1000 - eeprom - 0
1 - 82 - 291000 - 16f000 - spiffs - 0
Sketch:
#include <Arduino.h>
void setup() {
WiFiClient client;
httpUpdate.update(client, your-path-here)
}
void loop() {
}
Debug Messages:
[V][HTTPClient.cpp:224] beginInternal(): url: [url]
[D][HTTPClient.cpp:265] beginInternal(): host: [domain name] port: 80 url: [url]
[E][WiFiClient.cpp:236] setSocketOption(): 1006 : 9
[D][HTTPClient.cpp:977] connect(): connected to [domain name]
[V][HTTPClient.cpp:1072] handleHeaderResponse(): RX: 'HTTP/1.1 200 OK'
[V][HTTPClient.cpp:1072] handleHeaderResponse(): RX: 'Server: nginx/1.10.3 (Ubuntu)'
[V][HTTPClient.cpp:1072] handleHeaderResponse(): RX: 'Date: Wed, 05 Dec 2018 17:59:33 GMT'
[V][HTTPClient.cpp:1072] handleHeaderResponse(): RX: 'Content-Type: application/octet-stream'
[V][HTTPClient.cpp:1072] handleHeaderResponse(): RX: 'Content-Length: 853568'
[V][HTTPClient.cpp:1072] handleHeaderResponse(): RX: 'Connection: close'
[V][HTTPClient.cpp:1072] handleHeaderResponse(): RX: 'X-Frame-Options: SAMEORIGIN'
[V][HTTPClient.cpp:1072] handleHeaderResponse(): RX: 'X-XSS-Protection: 1; mode=block'
[V][HTTPClient.cpp:1072] handleHeaderResponse(): RX: 'X-Content-Type-Options: nosniff'
[V][HTTPClient.cpp:1072] handleHeaderResponse(): RX: 'X-Download-Options: noopen'
[V][HTTPClient.cpp:1072] handleHeaderResponse(): RX: 'X-Permitted-Cross-Domain-Policies: none'
[V][HTTPClient.cpp:1072] handleHeaderResponse(): RX: 'Referrer-Policy: strict-origin-when-cross-origin'
[V][HTTPClient.cpp:1072] handleHeaderResponse(): RX: 'Content-Disposition: attachment'
[V][HTTPClient.cpp:1072] handleHeaderResponse(): RX: 'Content-Transfer-Encoding: binary'
[V][HTTPClient.cpp:1072] handleHeaderResponse(): RX: 'Cache-Control: private'
[V][HTTPClient.cpp:1072] handleHeaderResponse(): RX: 'ETag: W/"ac15b364c5a17a4982fc0a73b31212d2"'
[V][HTTPClient.cpp:1072] handleHeaderResponse(): RX: 'X-Request-Id: c134e61a-ec3b-4ca8-ac50-2ef3e173fa16'
[V][HTTPClient.cpp:1072] handleHeaderResponse(): RX: 'X-Runtime: 0.025584'
[V][HTTPClient.cpp:1072] handleHeaderResponse(): RX: ''
[D][HTTPClient.cpp:1102] handleHeaderResponse(): code: 200
[D][HTTPClient.cpp:1105] handleHeaderResponse(): size: 853568
[D][HTTPUpdate.cpp:210] handleUpdate(): Header read fin.
[D][HTTPUpdate.cpp:211] handleUpdate(): Server header:
[D][HTTPUpdate.cpp:212] handleUpdate(): - code: 200
[D][HTTPUpdate.cpp:213] handleUpdate(): - len: 853568
[D][HTTPUpdate.cpp:219] handleUpdate(): ESP32 info:
[D][HTTPUpdate.cpp:220] handleUpdate(): - free Space: 456912
[D][HTTPUpdate.cpp:221] handleUpdate(): - current Sketch Size: 853808
[E][HTTPUpdate.cpp:239] handleUpdate(): FreeSketchSpace to low (456912) needed: 853568
[D][HTTPClient.cpp:349] disconnect(): still data in buffer (6587), clean up.
[D][HTTPClient.cpp:358] disconnect(): tcp stop