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

File size limitation of 4kB #5

Open
purehunter1 opened this issue Feb 12, 2024 · 2 comments
Open

File size limitation of 4kB #5

purehunter1 opened this issue Feb 12, 2024 · 2 comments

Comments

@purehunter1
Copy link

Hi palmerr23,

Firstly: I really appreciate your work in this project! It does exactly what I was looking for :-)

After implementation in my project, I found, that there is a file size limitation of about 4kB which is too low for my application. I need at least about 8kB.
And this is not noted in the "Limitations".

To solve the problem, in a first step I thought, there is the line
#define FILEBUFSIZ 4096
which I have just to modify to allocate more buffer. But when I increase this buffer, the program crashes immediately. No need to transmit data. Running on a ESP32-S2 with a low percentage of allocated RAM.
After browsing the whole web for hours, I found, that there are limitations in the (synchronous) Arduino Webserver which I guess is the underlaying problem. But as an "Arduino Grade" programmer, it is out of reach for me to do anything on this level.

Do you have an idea how to improve this in your project? Or ist it possible to port this great project to an (async ?) webserver which is capable of handling bigger files?
If there was a solution, it would lift this great project on the next level! :-)

purehunter

@purehunter1
Copy link
Author

Hi palmerr23,

after more investigation, I found that the limitation is the same when running only your original example which I'm referring to here.
Even though there should be plenty of RAM, the program crashes.

I now made a try with the filebuf[FILEBUFSIZ] defined as a global variable - instead of the original local definition in handleMain() -
AND:... as you terminate the written content with '\0' it works pretty well, even w/o an additional initialisation in handleMain() !
I'm not sure what the reason for this limitation is.

For the moment I will use it in this way. Thanks again!

purehunter

@palmerr23
Copy link
Owner

Thanks for the feedback.

Yes, I have a version that works with Async, however it is embedded in another program.

I've used it to upload files of 16kB or more. It has only been tested on a PicoW at this point.

I've put the relevant files n the PICOW_Async_New folder, if you care to experiment.

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