-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
httpupdateserver filesystem update "Update error: Bad Size Given" for 8MB version of ESP32 #9967
Comments
What does your html look like? That error happens when the file size is not provided. |
@lbernstone It is a bunch of html files (each with html, js, css, etc), image files,json files, etc that went through the mkspiffs tool, resulting in a .bin file. This is the same .bin file that was generated and successfully uploaded to the board using the ESP32 Spiffs update tool. Not sure where the file size need to be provided? |
@lbernstone Just checking in. Could you kindly clarify where the file size need to be provided? |
The OTAWebUpdater example shows how to get the browser to add the file size to your request, and then have the Update library use the file size. |
@lbernstone Thank you. I am a bit confused. Some thoughts/ findings:
a. Firmware update already works fine in the Examples>WebUpdater.ino in question, without submitting the filesize.
and it goes on to
So, why does
Does this make sense? Or am I missing something here? Thank you again, for your time. |
I'm not going to update that library. It probably just needs to be retired.
|
@lbernstone Just thought I will check back on if you had the chance to perform the stress tests on this? I would like to make a suggestion. In the Examples>WebUpdater.ino it offered two different file select options, one for firmware, one for spiffs. The benefit is that the process does not make it necessary that the filename has "spiffs" or "ffat" in it. In my opinion, this would be a nice feature to keep, when you get to work on the OTAWebUpdater example. |
These are intended to be examples of esp32 code, not html. Those filenames are the format that the file system extension uses, so will likely be the filenames anyhow. |
Sure, I agree. It is just that, even when the spiffs spits out a file that has .spiffs in the file name, I (and possibly others) may rename the file to some naming convention that does not have the spiffs/ ffat in the name. In my opinion, keeping them independent of file name does not look hard, we can simply update the html file to have two inputs and have the form field hold the name. Regardless, I appreciate your/ team in all your efforts, however you find it fitting in this case :) |
@lbernstone It seems to me, SPIFFS.totalBytes() is not returning the correct value. In a use case where 1.5MB spiffs is selected, SPIFFS.totalBytes() is returning 1438481 where as the actual value should be 1572864. |
You shouldn't use SPIFFS any more, it is highly inefficient. LittleFS has replaced it. |
Unfortunately, I have to support an existing project, which uses spiffs. Not for a new one. Is it reasonable to expect that the issue at hand will have a resolution? |
What issue? That SPIFFS doesn't provide the full amount of space in a partition or the original issue on this ticket? AFAIK, SPIFFS is no longer under development. Please note, I don't work for Espressif. If you have production code which is impacted by an issue here, you need to speak to a sales rep/engineer. |
OK, Because you are the only one who responded to the issue, and you suggested that you were not going to fix WebUpdater.ino, rather, do a PR on OTAWebUpdater example, I took it that you were part of the team. Did nt know otherwise, and did nt mean to bother you with later messages had I known that :) As to "what issue", It looks to me the same. The reason why WebUpdater.ino is failing for bad size given is because in the Updater library, SPIFFS.totalBytes() is returning incorrect value AFAIK @me-no-dev or @SuGlider Tagging you for your kind attention. Is the issue in this thread fixable? |
SPIFFS.totalBytes does not return the partition size, but the maximum amount of data that could be stored (this comes from upstream). The code really should be changed to get the partition information. If you just want to get it working without writing any code, then change https://github.com/espressif/arduino-esp32/blob/master/libraries/HTTPUpdateServer/src/HTTPUpdateServer.h#L107 to |
Thanks, I do understand the workaround. Even If I move to littleFS, the filesystem update method would still be the same, and need this workaround, correct? In that case, If you are recommending that I just make this change locally, everytime there is a new release, I have to keep making this custom modification. Not a good situation to have. If the general agreement is that SPIFFS.totalbytes() is not going to work, and will not be updated, would it make sense to update to the source to reflect the change you mentioned in L107? |
LittleFS gives the partition size for LittleFS.totalBytes(), so it should just work. |
Board
ESP32 Dev Module, 8MB Flash
Device Description
ESP32 Dev Module, 8MB flash
Hardware Configuration
8MB ESP32 Dev Module. No attachments
Version
latest master (checkout manually)
IDE Name
Arduino IDE 2.3.2
Operating System
Windows 11
Flash frequency
40MHz
PSRAM enabled
no
Upload speed
921600
Description
I am using 8MB ESP32 Dev Module, with the following IDE settings.
I use arduino IDE 2.3.2 for firmware but go back to 1.8.9 to use the ESP32 Sketch Data Upload Tool using spiffs. This works fine when using the IDE. But if I take the same spiffs file that is generated using the mkspiffs tool, use the webupdater.ino example, and use the Filesystem update option, It throws
Update error: Bad Size Given
Sketch
Debug Message
When trying to access /update
When selecting SPIFFS FILE and submitting
On the webpage,
Other Steps to Reproduce
Tried on few different boards, similar result.
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: