如何使用ESP8266在异步网络服务器上显示文本文件

发布于 01-21 14:00 字数 568 浏览 6 评论 0原文

我的SD卡上有几个TXT文件,我想将其输出到异步网络服务器。我为此使用了ESP8266。 我尝试了以下电话。但是,然后显示错误。 它还说发现了两个SD.H库:

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

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

未使用后者。

我得到的错误如下:

no matching function for call to 'AsyncWebServerRequest::send(SDClass&, const char [12], const char [10])'

如何解决此问题?

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

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");
});

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文