Hieromon / AutoConnect

An Arduino library for ESP8266/ESP32 WLAN configuration at runtime with the Web interface
https://hieromon.github.io/AutoConnect/
MIT License
900 stars 188 forks source link

about SDcard #306

Closed nowzenith closed 2 years ago

nowzenith commented 3 years ago

i found some error when i use SD library and i don't know how to fix it i use esp32

this is a error text

In file included from C:\Users\nowze\Desktop\temp2_v_1_3\temp2_v_1_3.ino:10:0: C:\Users\nowze\Documents\Arduino\libraries\esp32-micro-sdcard/mySD.h:32:7: error: redefinition of 'class fs::File' class File : public Stream { ^ In file included from C:\Users\nowze\Documents\Arduino\libraries\AutoConnect-master\src/AutoConnectOTA.h:24:0, from C:\Users\nowze\Documents\Arduino\libraries\AutoConnect-master\src/AutoConnect.h:39, from C:\Users\nowze\Desktop\temp2_v_1_3\temp2_v_1_3.ino:6: C:\Users\nowze\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\FS\src/FS.h:47:7: error: previous definition of 'class fs::File' class File : public Stream ^

Hieromon commented 3 years ago

@nowzenith Would you please post all #include directive statements for your sketch that encountered this error? I'll consider a workaround.

nowzenith commented 3 years ago

include

include

include

include

include

include

include

include

include

include

include

include

include

include "DHT.h"

include

include

include

include

nowzenith commented 3 years ago

for download sdcard library https://kmitlthailand-my.sharepoint.com/:u:/g/personal/63010881_kmitl_ac_th/Edpb8LMSaK5Ls4SvHkOFfuUBk_W2S06YG99xDBztK0wI2g?e=wupRAB

https://kmitlthailand-my.sharepoint.com/:u:/g/personal/63010881_kmitl_ac_th/ESlvaGkrRqdKmwkPQWYoljQBadnLfDHHQXHklIP4aqAaAQ?e=FRMdPS

Hieromon commented 3 years ago

@nowzenith Since mySD.h defines the File class as global, it conflicts with FS.h provided by the ESP32 Arduino core as standard.

The main reason is that the SD_Extension class depends on mySD.h. Does the SD_Extension library have compatible with the ESP32 Arduino core? In my view, if the sketch uses the filesystem with FS.h provided by the ESP32 Arduino core, including SD_Extension.h will cause a compilation error always in the sketch. It's not just about AutoConnect.

The filesystem of the ESP32 Arduino core is separated from the physical media, and the physical IO layer as a lower layer provides an API that can be accessed in the same procedure regardless of whether it is EEPROM or SD. https://github.com/espressif/arduino-esp32/tree/master/libraries/SD

SD_Extension should be ported to follow this structure.

nowzenith commented 3 years ago

Thank you so much

Hieromon commented 2 years ago

Closed once due to no activity. It will reopen with a new post.