Closed jbrepogmailcom closed 4 years ago
I've been skipping through your code a few times, but it is hardly the minimal code to show the issue. Where do you try to store the OTA binary? It looks like you're using the standard OTA library, which does not store the temp binary on the SPIFFS filesystem, but on the unused area between active sketch and SPIFFS. If you have split your 4M flash into 1M sketch and 3M SPIFFS, then you have 1M for the active sketch + OTA image (and a few kB for other things that get stored)
@jbrepogmailcom please reduce your sketch to something "M"inimal and "C"omplete with which we can "V"erify the issue.
Problem solved. It turned out that after flash on first http update the ESP module downloaded whole update over 400kB correctly and updated. However, on all subsequential updates, it only downloaded first 10-15kB and then reported error "New bin does not fit". It is quite strange, because http server's error log did not show any problem. ESP just cut off downloading of bin and gave an error. I fixed it by changing this:
HTTPClient httpClient; httpClient.begin( fwVersionURL ); .... some code .... t_httpUpdate_return ret = ESPhttpUpdate.update( fwImageURL );
to this
WiFiClient wclient; t_httpUpdate_return ret = ESPhttpUpdate.update( wclient, fwImageURL );
I would be glad if someone can explain me why it helped
Hello, unfortunately the issue is not resolved. I am not using any SPIFFS. I would say that main problem is that download from server gets cut off after about 13kB, server responds with code 200 (OK) and ESP reports the bin does not fit. In the reality the bin should have around 450kB.
I will reopen after I confirm it is not server or router problem
Facing the same issue, have you solved it?
Not yet. Seems that OTA example is working, but when used in real sketch it does not. If you can, please check your apache log to see if the bin file is sent completely or if server logs smaller file with OK 200 response code. Thanks
In one case it clearly helped adding wclient to ESPhttpUpdate.update( wclient, fwImageURL ); as in post above, in other case the update is still not working
I use ESP8266 and I get an error when updating the firmware HTTP_UPDATE_FAILED Error (-107): New Binary Does Not Fit Flash Size while Sketch uses 326240 bytes (31%) of program storage space. Maximum is 1044464 bytes. Is there any way to fix it? Thank
Basic Infos
Platform
Settings in IDE
Problem Description
Detailed problem description goes here.
binary downloaded over OTA does not fit into available space. bin is 409kB, available space 3.7MB. Other similar sketch that has about 390kb works fine on same hardware.
[httpUpdate] Header read fin. [httpUpdate] Server header: [httpUpdate] - code: 200 [httpUpdate] - len: 459248 [httpUpdate] ESP8266 info: [httpUpdate] - free Space: 3710976 [httpUpdate] - current Sketch Size: 462640 [httpUpdate] runUpdate flash... [httpUpdate] New binary does not fit SPI Flash size
MCVE Sketch that is causing the problem. Compiled about 409000 bytes
Debug Messages