SPIFFS problems

Hello everyone. I'm a beginner and I'm taking a test to better understand SPIFFS in esp32.

When starting SPIFFS, nothing is returning to me. Here is an example:

#include <SPIFFS.h>

void setup() {

Serial.begin(115200);

if(SPIFFS.begin())
{
Serial.println("OK");
}
else
{
Serial.println("FAIL");
while(true);
}

}

Nothing is shown on the Serial Monitor. Does anyone know why?

Thanks!

Have you verified that your serial connection is working, by printing something BEFORE calling SPIFFS.begin()? Follow the print with Serial.flush() to make sure the message goes out BEFORE you call SPIFFS.begin().

Also, have you initialized the SPIFFS filesystem? I have no idea what SPIFFS.begin() will do if it tries to open an uninitialized filesystem. Perhaps it handles that situation gracefully, perhaps not.

#include <SPIFFS.h>

void setup() {
  
  Serial.begin(115200);
  
  if(SPIFFS.begin())
  {
    Serial.println("OK");
  }
  else
  {
    Serial.println("FAIL");
    while(true);
  }

}

Yea, you got a whole lot of issues with the way you are trying to do SPIFF's

sigh

#include "SPIFFS.h"

setup()
{
  if (!SPIFFS.begin(true))
    {
      log_i("An Error has occurred while mounting SPIFFS");
    }
}

Is that good for you?

Of course you know that SPIFF's have been depreciated in favor of LitteFS.

Oh, and now you know about putting your code in code tags, right?

It appears that SPIFFS has been deprecated in favour of LittleFS

UKHeliBob:
It appears that SPIFFS has been deprecated in favour of LittleFS

Yes and no. On ESP8266 that is 100% true. On ESP32, SPIFFS is still the only FFS that can be installed through library manager or board manager, while SPIFFS is present, and supported, by default. That could change at any time, but right now, using SPIFFS is painless, while setting up LittleFS takes some effort.

right now, using SPIFFS is painless, while setting up LittleFS takes some effort.

LittleFS_esp32 is available via the Library Manager and is what I have installed

I believe SPIFF's will be around for a time for the ESP32's. Doing a search on the littlefs in the ESP32 API does not yield a result set.

Also, if you want the ability to push data files from your PC to SPIFFS, you should be aware that the availability of the "ESP8266 Sketch Data Upload" option in the Arduino IDE Tools Menu depends on which IDE / Board Package version you're using. It's present in 1.8.5 / 2.5.0, but NOT in 1.8.12 / 2.7.4. Not sure about versions in-between.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.