完善资料让更多小伙伴认识你,还能领取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: } |
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
1138 浏览 1 评论
576浏览 6评论
477浏览 5评论
有没有办法在不使用混杂模式的情况下实现Wifi驱动程序接收缓冲区访问中断呢?
461浏览 5评论
462浏览 4评论
437浏览 4评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 15:27 , Processed in 0.736259 second(s), Total 73, Slave 56 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号