I am not able to write / access files in SPIFFS in ESP8266

1.5k Views Asked by At

I am trying to store text file into SPIFFS memory. I get an error whenever I try to format or to write file into SPIFFS.

Here is the code to format the SPIFFS.

#include<FS.h>


void setup() {
  Serial.begin(9600);
  SPIFFS.begin();
  delay(1000);
  Serial.println("Beggining format");
  if(SPIFFS.format()){
    Serial.println("Format complete");
  }
  else{
    Serial.println("unable to Format");
  }
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

I did search online in other forums regarding this error. I came accross this github discussion regarding the error. https://github.com/esp8266/Arduino/issues/4061 I did run the code suggested in this link to obtain the device ID.

Firmware: Chip Id: 000E01E5
Core version: 2_7_0
SDK version:2.2.2-dev(38a443e)
Boot version: 5
Boot mode: 1


Flash chip information: Flash chip Id: 00146085 (for example: Id=001640E0 Manuf=E0, Device=4016 (swap bytes))
Sketch thinks Flash RAM is size: 1.00 MB Actual size based on chip Id: 1.00 MB Flash frequency: 40.00 MHz
Flash write mode: DIO


File system (SPIFFS):
Total KB: 4176892.00 KB Used KB: 4176892.00 KB Block size: 8192
Page size: 256
Maximum open files: 5 Maximum path length: 32

SPIFFS directory {/} :


CPU frequency: 80 MHz

###############file open failed

In the output I see that: File system (SPIFFS): Total KB: 4176892.00 KB Used KB: 4176892.00 KB

I don't understand this. Can someone help me understand this? So that I can upload file to SPIFFS?

0

There are 0 best solutions below