-->
Page 1 of 1

fsInfo.usedBytes and fsInfo.totalBytes confusion

PostPosted: Wed Nov 09, 2016 8:49 pm
by rudy
I found the following code in cleanESP8266. I am confused about the number reported. The first block makes sense. I don't understand why I get the numbers from the second block. Why is it so big and shouldn't I be getting 3MB? (Chip compile setup is 3M size with 3M SPIFFS)


Code: Select all 
 
          Serial.print("Flash Real Size: ");
          Serial.println(ESP.getFlashChipRealSize());
          Serial.print("Flash Firmware Configured Size: ");
          Serial.println(ESP.getFlashChipSize());
         
          FSInfo fsInfo;
          SPIFFS.info(fsInfo);
          Serial.print("FS Bytes: ");
          Serial.print(fsInfo.usedBytes);
          Serial.print(" / ");
          Serial.println(fsInfo.totalBytes);
         


Prints the following/

Flash Real Size: 4194304
Flash Firmware Configured Size: 4194304
FS Bytes: 1885644992 / 1073683708 < I don't get this.

Re: fsInfo.usedBytes and fsInfo.totalBytes confusion

PostPosted: Thu Nov 10, 2016 8:18 am
by martinayotte
Did you format SPIFFS and mounted it before doing such print ?
On my side, it is working properly ...

Re: fsInfo.usedBytes and fsInfo.totalBytes confusion

PostPosted: Thu Nov 10, 2016 8:42 am
by rudy
I did do a format. I did mount it, but properly? I will check again.

Thanks.