You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have read the documentation at readthedocs and the issue is not addressed there.
I have tested that the issue is present in current master branch (aka latest git).
I have searched the issue tracker for a similar issue.
If there is a stack dump, I have decoded it.
I have filled out all fields below.
Platform
Hardware: [ESP-12F]
Core Version: [3.0.2]
Development Env: [VSMicro]
Operating System: [Windows]
Settings in IDE
Module: [LOLIN(WEMOS) D1 D2 & mini]
Flash Mode: [DIO]
Flash Size: [4MB]
lwip Variant: [Higher Bandwidth]
Reset Method: [nodemcu]
Flash Frequency: [40Mhz]
CPU Frequency: [80Mhz]
Upload Using: [SERIAL]
Upload Speed: [921600] (serial upload only)
Problem Description
Attempting to use HTTPClient to stream directly to a LittleFS File times out with error code -11. This is due to the LittleFSFileImpl not implementing availableForWrite(), so the base implementation returns 0 and the streaming can't write and times out. I added this implementation but I do not know if this is the right thing to return. It probably isn't but hey it works! It would probably work even if I returned 1 so I'm not going to throw myself a parade or anything for getting it working.
// in LittleFS.h LittleFSFileImpl
int availableForWrite() override {
if (!_opened || !_fd) {
return 0;
}
return _fs->_lfs_cfg.block_size;
}
@CapnBry thanks for reporting this issue to us.
LittleFS wrapper indeed lacks of this implementation.
Returning block_size unlocks Stream*Send() methods but this may be a little too rough.
We'll address a fix very soon.
Awesome, thanks for the reply. Yeah I wasn't sure what value to return considering it could be up to the remaining space of the entire partition! Or be really inefficient and return as low as 1 haha.
Appreciate you putting this on your radar for a proper fox and thanks so much for all the other tons of code that makes my projects just an include and a few lines.
Basic Infos
Platform
Settings in IDE
Problem Description
Attempting to use HTTPClient to stream directly to a LittleFS
File
times out with error code -11. This is due to theLittleFSFileImpl
not implementingavailableForWrite()
, so the base implementation returns 0 and the streaming can't write and times out. I added this implementation but I do not know if this is the right thing to return. It probably isn't but hey it works! It would probably work even if I returned 1 so I'm not going to throw myself a parade or anything for getting it working.MCVE Sketch
Debug Messages
The text was updated successfully, but these errors were encountered: