SdFat-beta icon indicating copy to clipboard operation
SdFat-beta copied to clipboard

RTCTimeStampTest does not compile with ESP8266WiFi.h included

Open Primus007 opened this issue 5 years ago • 4 comments

Using Arduino IDE.

The Sample RTCTimeStampTest (and some others examples also) does not compile with ESP8266WiFi.h included

#include <ESP8266WiFi.h>

if (!file.open("RtcTest.txt", FILE_WRITE)) { exit status 1 'class fs::File' has no member named 'open'

How can i fix it?

Primus007 avatar May 18 '20 20:05 Primus007

Looks like there is a conflict for the class File in esp8266 core.


C:\Users\bill\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.2\cores\esp8266/FS.h:52:7: note: previous declaration 'class fs::File'

 class File : public Stream

Guess you can't use SdFat with #include <ESP8266WiFi.h>.

Use the esp8266 SD.h package, it defines open for esp8266.

Looks like I need to drop support for ESP.

There is a very old version of SdFat in esp8266 and esp8266 will use that version.

greiman avatar May 19 '20 13:05 greiman

esp8266 SD.h does not support timestamp. It is very difficult to find a good library that supports timestamp for files and runs with ESP8266WiFi.h

Primus007 avatar May 19 '20 14:05 Primus007

The SdFat timestamp code in in esp8266 core but I don't see how a user can access it.

Here is the location of the version of SdFat used in ESP8266 SD.h:

/esp8266/hardware/esp8266/2.7.1/libraries/ESP8266SdFat

greiman avatar May 19 '20 17:05 greiman

it should work with: SdFile::dateTimeCallback(dateTime); There is an example scetch "Timestamp" I have not tested it.

Primus007 avatar May 19 '20 18:05 Primus007