完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
您好,
我在读取使用 ESP8266FS 上传的文件时遇到问题。 上传文件,一切正常...(注意:我正在上传一个名为“index.html”的文件) 代码:全选[SPIFFS] data : C:UsersharolOneDriveDocumentsArduinouploaddata [SPIFFS] size : 2024 [SPIFFS] page : 256 [SPIFFS] block : 8192 /index.html [SPIFFS] upload : C:UsersharolAppDataLocalTemparduino_build_598521/upload.spiffs.bin [SPIFFS] address : 0x200000 [SPIFFS] reset : --before default_reset --after hard_reset [SPIFFS] port : COM4 [SPIFFS] speed : 115200 [SPIFFS] python : C:UsersharolAppDataLocalArduino15packagesesp8266toolspython33.7.2-post1python3.exe [SPIFFS] uploader : C:UsersharolAppDataLocalArduino15packagesesp8266hardwareesp82662.7.4toolsupload.py esptool.py v2.8 Serial port COM4 Connecting.... Chip is ESP8266EX Features: WiFi Crystal is 26MHz MAC: 5c:cf:7f:24:7b:23 Uploading stub... Running stub... Stub running... Configuring flash size... Auto-detected Flash size: 4MB Compressed 2072576 bytes to 2730... Wrote 2072576 bytes (2730 compressed) at 0x00200000 in 0.2 seconds (effective 67815.2 kbit/s)... Hash of data verified. Leaving... Hard resetting via RTS pin... 但是,当我使用以下草图查看文件是否打开时...... 代码:全选#include "LittleFS.h" void setup() { Serial.begin(115200); Serial.println(":mount_fs"); Serial.print(F("mounting file system...")); if (LittleFS.begin()){ Serial.print(F("done.n")); } else{ Serial.print(F("failed.n")); } File file = LittleFS.open("./index.html", "r"); if(!file){ Serial.println("Failed to open file for reading"); return; } Serial.println(); Serial.println("File Content:"); while(file.available()){ Serial.write(file.read()); } file.close(); } void loop() { // put your main code here, to run repeatedly: } |
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
147个成员聚集在这个小组
加入小组540浏览 6评论
451浏览 5评论
有没有办法在不使用混杂模式的情况下实现Wifi驱动程序接收缓冲区访问中断呢?
434浏览 5评论
435浏览 4评论
407浏览 4评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-15 12:24 , Processed in 0.526595 second(s), Total 40, Slave 35 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号