Unable to use SPIFFS
up vote
0
down vote
favorite
I'm working with Arduino and an ESP32 board. I need to write some files in my ESP32.
but the problem is, SPIFFS doesn't work anymore. I don't know why... It worked till the day before yesterday.
But now when I use SPIFFS_Test from Arduino-Examples or this code:
#include "SPIFFS.h"
void setup() {
Serial.begin(115200);
if (!SPIFFS.begin(true)) {
Serial.println("An Error has occurred while mounting SPIFFS");
return;
}
File file = SPIFFS.open("/test.txt", FILE_WRITE);
if (!file) {
Serial.println("There was an error opening the file for writing");
return;
}
if (file.print("TEST")) {
Serial.println("File was written");
} else {
Serial.println("File write failed");
}
file.close();
Serial.println(SPIFFS.exists("/test.txt"));
Serial.println(SPIFFS.exists("/nonexisting.txt"));
}
void loop() {}
I just get the "FAILED ERROR."
What could be the reason?
arduino esp32 spiffs
add a comment |
up vote
0
down vote
favorite
I'm working with Arduino and an ESP32 board. I need to write some files in my ESP32.
but the problem is, SPIFFS doesn't work anymore. I don't know why... It worked till the day before yesterday.
But now when I use SPIFFS_Test from Arduino-Examples or this code:
#include "SPIFFS.h"
void setup() {
Serial.begin(115200);
if (!SPIFFS.begin(true)) {
Serial.println("An Error has occurred while mounting SPIFFS");
return;
}
File file = SPIFFS.open("/test.txt", FILE_WRITE);
if (!file) {
Serial.println("There was an error opening the file for writing");
return;
}
if (file.print("TEST")) {
Serial.println("File was written");
} else {
Serial.println("File write failed");
}
file.close();
Serial.println(SPIFFS.exists("/test.txt"));
Serial.println(SPIFFS.exists("/nonexisting.txt"));
}
void loop() {}
I just get the "FAILED ERROR."
What could be the reason?
arduino esp32 spiffs
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm working with Arduino and an ESP32 board. I need to write some files in my ESP32.
but the problem is, SPIFFS doesn't work anymore. I don't know why... It worked till the day before yesterday.
But now when I use SPIFFS_Test from Arduino-Examples or this code:
#include "SPIFFS.h"
void setup() {
Serial.begin(115200);
if (!SPIFFS.begin(true)) {
Serial.println("An Error has occurred while mounting SPIFFS");
return;
}
File file = SPIFFS.open("/test.txt", FILE_WRITE);
if (!file) {
Serial.println("There was an error opening the file for writing");
return;
}
if (file.print("TEST")) {
Serial.println("File was written");
} else {
Serial.println("File write failed");
}
file.close();
Serial.println(SPIFFS.exists("/test.txt"));
Serial.println(SPIFFS.exists("/nonexisting.txt"));
}
void loop() {}
I just get the "FAILED ERROR."
What could be the reason?
arduino esp32 spiffs
I'm working with Arduino and an ESP32 board. I need to write some files in my ESP32.
but the problem is, SPIFFS doesn't work anymore. I don't know why... It worked till the day before yesterday.
But now when I use SPIFFS_Test from Arduino-Examples or this code:
#include "SPIFFS.h"
void setup() {
Serial.begin(115200);
if (!SPIFFS.begin(true)) {
Serial.println("An Error has occurred while mounting SPIFFS");
return;
}
File file = SPIFFS.open("/test.txt", FILE_WRITE);
if (!file) {
Serial.println("There was an error opening the file for writing");
return;
}
if (file.print("TEST")) {
Serial.println("File was written");
} else {
Serial.println("File write failed");
}
file.close();
Serial.println(SPIFFS.exists("/test.txt"));
Serial.println(SPIFFS.exists("/nonexisting.txt"));
}
void loop() {}
I just get the "FAILED ERROR."
What could be the reason?
arduino esp32 spiffs
arduino esp32 spiffs
asked Nov 8 at 8:38
Milad
264
264
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
I checked the directory and found some files that I created before.
I deleted them and it works again!
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
I checked the directory and found some files that I created before.
I deleted them and it works again!
add a comment |
up vote
0
down vote
I checked the directory and found some files that I created before.
I deleted them and it works again!
add a comment |
up vote
0
down vote
up vote
0
down vote
I checked the directory and found some files that I created before.
I deleted them and it works again!
I checked the directory and found some files that I created before.
I deleted them and it works again!
answered Nov 8 at 8:57
Milad
264
264
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53204083%2funable-to-use-spiffs%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown