我试图检查ESP8266上Flash文件系统的总大小和使用的字节。
我使用Arduino IDE (2.0.1)和"esp8266 by ESP8266 Community“(3.0.2)
我在不同的教程中发现了这些命令
#import <FS.h>
SPIFFS.usedBytes();
SPIFFS.totalBytes();我还在arduino-esp32 32-文档中找到了这个函数,但是编译器说:
In file included from C:\Users\...\esp8266_temp_humid_log_with_http.ino:38:
C:\Users\...\http_serving.h: In function 'void showFilesize()':
C:\Users\...\http_serving.h:42:24: error: 'class fs::FS' has no member named 'totalBytes'
42 | int tBytes = SPIFFS.totalBytes();
| ^~~~~~~~~~
C:\Users\...\http_serving.h:45:25: error: 'class fs::FS' has no member named 'usedBytes'
45 | int uBytes = SPIFFS.usedBytes();
| ^~~~~~~~~
exit status 1
Compilation error: 'class fs::FS' has no member named 'totalBytes'我知道,尖峰是被破坏的。我也用同样的结果尝试了LittleFS。不幸的是,我找不到我的文件夹上的图书馆来查看它。
我不明白,为什么这个功能不可用。
有人想办法解决这个问题吗?
非常感谢。
发布于 2022-11-03 06:09:44
Juraj的评论帮助我解决了这个问题:
FSInfo fs_info;
SPIFFS.info(fs_info);
long usedBytes = fs_info.usedBytes;
long totalBytes = fs_info.totalBytes;谢谢你的帮助。
https://stackoverflow.com/questions/74291599
复制相似问题