-
Notifications
You must be signed in to change notification settings - Fork 128
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
USING FTPSERVER with SDFat.h lib causes: error:'File' is already declared in this scope using fs::File #18
Comments
There was a breaking change on the SD library due to keywords collisions with SPIFFS. Both were using the Now old SD keywords need to be prefixed i.e. Depending on the complexity of your other project you have two choices:
|
I found a working solution of SD.h lib reworked by : http://mcutry.tistory.com/47 |
Well it's using the namespaced version too, and the problem has already been partially adressed (you still need to edit your sketch though) by using a define just before including |
Better ! thanks. and similarly to: |
not exactly, SD syntax is unchanged so you can keep this:
however when using SPIFFS, you'll have to use this:
|
Thank you a lot..! |
Do you know if there is a porting to SDFat.h library in order to use it together with ESP8266FtpServer.h solving the SD card access instead of SPIFFS access ? |
I only use SDFat.h with Atmega chips, essentially because it has a small memory footprint and can fit in a bootloader. Now you don't have to modify SD.h; this tutorial does not use a specific SD.h library other than the one you can get from your library manager: http://mcutry.tistory.com/47 The article hint you at modifying the actual esp8266FTPServer library so it calls SD methods instead of SPIFFS methods, and this implies some small changes. If you comment out every #include "FS.h" and implement the changes from the article (marked in yellow), it should work as described, provided you selected the correct version of the library in the Arduino library manager. |
Actually, the SD.h modified by the article, with ESP8266FTPServer , works correctly. |
It's the official SDFat.h, I haven't tried it with ESP8266 The official updated SD.h from the Arduino Library manager is better for your needs, and it does not default to 8.3 filenames, why wouldn't you use it? It does implement the changes you're talking about after all. I just diffed the modified library from the article, and there's only one change in one file: File.cpp
If you look at ~/Arduino/libraries/SD/File.cpp from the Arduino library folder (SD Built-in by Arduino SparkFun) you'll see those changes are there too, only they're at the end of the file. So basically you can delete the custom SD directory from your ~/Arduino/libraries folder, go to your Arduino Library manager, search "SD", select the version |
btw from the network page it seems like somebody already did this a year ago |
But I tried and it did't work. So, something is still missing with joined use of SDFAt and ESP8266FTPServer. Anyway, I will try your previuous suggestion. Did you furthermore told that new SD lib support long file name?? It should be great. |
Hello. I'm a new user of esp8266, and sice few months ago I started to develop a data logger with ESP-12E module.
All worked since I decided to add the FTP feature to my project (where I use library #include "SdFat.h")
Now I added your library <ESP8266FtpServer.h> and when I compile the scketch I obtain this error:
sp8266/FS.h:136:11: error: 'File' is already declared in this scope
using fs::File;
^
I found here me-no-dev/ESPAsyncWebServer#112 , an old discussion on similar issue, but I was now able to implement to your libary and to solve the issue.
Could you help me ?
thanks Alessandro
The text was updated successfully, but these errors were encountered: