-
Notifications
You must be signed in to change notification settings - Fork 13.3k
LittleFS files can not be accessed using ESP8266FtpServer #6775
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
Comments
Without an example you're not going to be able to get much help. That said, the FTP server library probably simply needs to have a search/replace done on SPIFFS->LittleFS. File opens, directory lists, etc. all come from the FS object, and it probably is hardcoded in the library as SPIFFS. The LittleFS API is the same, so it's a matter of search and replace (possibly including <LittleFS.h> in the source files of course). |
@earlephilhower So you are saying the LittleFS library needs to be modified or the FTP Library needs to be modified for my needs? |
FTP library needs to use LittleFS.openDir()/etc. instead of SPIFFS.openDir(). A good library would take the FS* as an input on creation, and just use that and let you go between as you choose (it would also then work with SD cards, too, with SDFS). |
@earlephilhower Got It, I will write up a sketch illustrating the problem. It should only take a few minutes. ** EDIT Original post now contains an example. |
@bill-orange Got it, but the problem lies not in the Arduino code, but in the ftpServer itself. I assume the lib is here: https://github.com/nailbuster/esp8266FTPServer If you look at the library, it hardcodes SPIFFS.xxxx everywhere. Just edit that library to swap in LittleFS.xxx and you have a reasonably good chance of making it work. Nothing we can do on our end if the library is specifically calling SPIFFS.xxxx. |
I don't see a core issue here. Closing. On a side note, I wasn't aware of that ftp lib. It looks good, but needs some work to improve it in terms of language use, heap use, generalization of the FS to use, and externalization of the specific WiFiClient/server object to use (e.g.: allow passing a WiFiClientSecure, like HttpClient). It would be interesting if somebody pursued that. |
@earlephilhower Sadly, it does not appear to be that simple. I substituted LittleFS for SPIFFS wherever it was used and added the LittleFS library to the .cpp file. It compiles and runs but the directory lists hello.txt as ello.txt and it is inaccessible. This is likely to be beyond my skill level to fix. |
Hi. |
Updated it to do LITTLEFS/SPIFFS on ESP8266/ESP32: https://github.com/jmwislez/ESP32FtpServer |
Works like a charm. Thanks!
…Sent from my iPhone
On Oct 13, 2020, at 10:47 AM, jmwislez ***@***.***> wrote:
Updated it to do LITTLEFS/SPIFFS on ESP8266/ESP32: https://github.com/jmwislez/ESP32FtpServer
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
|
I am using FTP for files around 120k just fine. Could you post a sketch that is not working for you? I can give it a try. |
A simple sketch. ftp works and all files are visible, but files larger than 4 KB are written with an error. |
Ah, I am using a different littleFS library. Try this one (note the caps in the .h file). https://github.com/lorol/LITTLEFS This code runs fine with bigger files.
|
I solved my problem with this library https://github.com/jmwislez/ESPFtpServer
Now it works fine. |
Thank you @kmsmi ! I applied your patch in https://github.com/jmwislez/ESPFtpServer. |
Settings in IDE
Problem Description: Files system created with LittleFS can not be accessed with FTPServer
To avoid the possibility of weird memory interactions, I started with the Huzzah completely erased from the command line.
Detailed problem description: Both LittleFS and FTP file Server appear to be running normally. Files in LittleFS can be created and appended as expected. FTP Server appears to run normally. A connection to it can be quickly achieved. The problem is that the files created with LittleFS are not 'seen' by the FTP Sever. In other words the FTP server directory is empty.
Example:
Additional Information:
Is LittleFS not designed to work with FTP Server? Should another FTP Server library be used? Is there an FTP setting beyond the defaults that must be adjusted.
The text was updated successfully, but these errors were encountered: