FS.h errors when compiling. Any ideas?

I eliminated all errors in my code but for some reason I’m getting these errors in FS.h when I compile. I’m stumped. Any ideas what is going on and how to fix it?

Screen Shot 2020-08-21 at 4.21.24 AM

> Executing task: platformio run <

Processing d1_mini_pro (platform: espressif8266; board: d1_mini_pro; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini_pro.html
PLATFORM: Espressif 8266 2.6.2 > WeMos D1 mini Pro
HARDWARE: ESP8266 80MHz, 80KB RAM, 16MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 3.20704.0 (2.7.4) 
 - tool-esptool 1.413.0 (4.13) 
 - tool-esptoolpy 1.20800.0 (2.8.0) 
 - toolchain-xtensa 2.40802.200502 (4.8.2)
Converting main.ino
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 30 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESP8266WiFi> 1.0
|-- <ESPWebDAV>
|   |-- <ESP8266WiFi> 1.0
|   |-- <Hash> 1.0
|   |-- <SDFS> 0.1.0
|   |   |-- <SPI> 1.0
|   |   |-- <ESP8266SdFat> 1.1.0
|   |   |   |-- <SPI> 1.0
|   |-- <LittleFS(esp8266)> 0.1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
Building in release mode
Compiling .pio/build/d1_mini_pro/src/main.ino.cpp.o
Archiving .pio/build/d1_mini_pro/liba43/libESP8266WiFi.a
Indexing .pio/build/d1_mini_pro/liba43/libESP8266WiFi.a
Archiving .pio/build/d1_mini_pro/libc86/libLittleFS.a
Indexing .pio/build/d1_mini_pro/libc86/libLittleFS.a
Compiling .pio/build/d1_mini_pro/libe72/ESPWebDAV/ESPWebDAV.cpp.o
Compiling .pio/build/d1_mini_pro/lib62d/ESP8266mDNS/ESP8266mDNS.cpp.o
Compiling .pio/build/d1_mini_pro/lib62d/ESP8266mDNS/ESP8266mDNS_Legacy.cpp.o
Compiling .pio/build/d1_mini_pro/lib62d/ESP8266mDNS/LEAmDNS.cpp.o
Compiling .pio/build/d1_mini_pro/lib62d/ESP8266mDNS/LEAmDNS_Control.cpp.o
Compiling .pio/build/d1_mini_pro/lib62d/ESP8266mDNS/LEAmDNS_Helpers.cpp.o
Compiling .pio/build/d1_mini_pro/lib62d/ESP8266mDNS/LEAmDNS_Structs.cpp.o
Compiling .pio/build/d1_mini_pro/lib62d/ESP8266mDNS/LEAmDNS_Transfer.cpp.o
In file included from /Users/jjohnston/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src/CertStoreBearSSL.h:26:0,
                 from /Users/jjohnston/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h:30,
                 from /Users/jjohnston/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src/WiFiClientSecure.h:41,
                 from /Users/jjohnston/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src/WiFiServerSecure.h:20,
                 from /Users/jjohnston/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src/ESP8266WiFi.h:41,
                 from lib/ESPWebDAV/ESPWebDAV.cpp:4:
/Users/jjohnston/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.h: In instantiation of 'size_t fs::File::write(T&) [with T = unsigned char [512]; size_t = unsigned int]':
lib/ESPWebDAV/ESPWebDAV.cpp:402:24:   required from here
/Users/jjohnston/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.h:92:30: error: request for member 'available' in 'src', which is of non-class type 'unsigned char [512]'
       while (src.available() > sizeof(obuf)){
                              ^
/Users/jjohnston/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.h:93:9: error: request for member 'read' in 'src', which is of non-class type 'unsigned char [512]'
         src.read(obuf, sizeof(obuf));
         ^
/Users/jjohnston/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.h:101:38: error: request for member 'available' in 'src', which is of non-class type 'unsigned char [512]'
       size_t leftLen = src.available();
                                      ^
/Users/jjohnston/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.h:102:7: error: request for member 'read' in 'src', which is of non-class type 'unsigned char [512]'
       src.read(obuf, leftLen);
       ^
/Users/jjohnston/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.h:90:11: warning: unused variable 'i' [-Wunused-variable]
       int i;
           ^
*** [.pio/build/d1_mini_pro/libe72/ESPWebDAV/ESPWebDAV.cpp.o] Error 1

How is src defined? Something like unsigned char src[512]; Given the errors, I suspect so.

What code is in one, or more, of the lines flagged as errors? It looks like the code is doing something like xxx = src.read(); which makes the error appear as a character array/string has no member function named read() etc.

Cheers,
Norm.

Looks like I was calling the wrong File.write function. I was only passing the buffer but when I passed the buffer and sizeof(buffer) the errors cleared. All seems good now. :slight_smile:

I’m modifying ESPWebDAV so you can use it not only with an SD Card for storage but with flash storage too (SPIFFS or LittleFS).

Here’s my branch with the modifications. Testing now but looking good.
https://github.com/idolpx/ESPWebDAV/tree/flash_fs

1 Like