Display txt file on async Webserver using esp8266

Hey,
I have several txt files on my SD card that I would like to output to my async webserver. I use the ESP8266 for this.
I have tried it with the following call. However, an error is then displayed.
It also says that two SD.h libraries were found:

Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/SD

/Applications/Arduino.app/Contents/Java/libraries/SD

the latter is not used.

The error I get is the following:
no matching function for call to 'AsyncWebServerRequest::send(SDClass&, const char [12], const char [10])'

how can I solve this problem?

  server.on("/getdata", HTTP_GET, [](AsyncWebServerRequest *request){
    request->send(SD, "/subj1_1.txt", "text/plain");
  });

update the Arduino IDE

i am on the latest version

R u using The latest version which is Version 2.0?

yes

Basically Version 2.0 is a beta version and still need some update Try doing the same thing in version 1.8.57.0 and then check does the same error is still occurring

what the heck is version 1.8.57?

Is this a more stable "release-candidate" than the actual Arduino 2.0 beta RC
I haven't tested Arduino 2.0 but as it is a beta I expected still a lot of trouble trying to using it.

Be the change you want to see in the world
best regards Stefan

on both versions I have got the same error

how about using version 1.8.19 ?

Also the same

Ya U r correct but there are currently a lot of minor bug so if anyone facing an issue we should tell about that error in the software

As long as you are as unspecific as "tell about that error in the software" this does not help at all

which error

  • using the wrong SD library?
  • you using a deprecated library?
  • you; having configured your libraries wrong?

in which "software"

  • The Arduino IDE?
    -- if yes which version?

  • SD-library itself?
    -- if yes which version are you using?

Be the change you want to see in the world
best regards Stefan

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.