Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get httpUpdate to work with 832k load #2160

Closed
ericmnel opened this issue Dec 5, 2018 · 2 comments
Closed

Can't get httpUpdate to work with 832k load #2160

ericmnel opened this issue Dec 5, 2018 · 2 comments

Comments

@ericmnel
Copy link

ericmnel commented Dec 5, 2018

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

@Jeroen88
Copy link
Contributor

Jeroen88 commented Dec 5, 2018

You are right, I just fixed it with PR #2161.

@ericmnel
Copy link
Author

ericmnel commented Dec 5, 2018

Thanks!

@ericmnel ericmnel closed this as completed Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants