srwi / ESPEssentials

Essentials to get you started with your Arduino projects using the ESP8266 and ESP32.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automatically format unformatted file systems

wgrymo opened this issue · comments

I have used espessentials for a timer for a non profit organization which worked perfect and saved me a lot of work. Now i want to make a webradio for a personal project. I upload the sample sketch of espessentials.ino to the Espressif wroom 32 board. I tried this with arduino ide as well as with vs code. Setting up the wifi works, but after that i get this error on the terminal

./components/esp_littlefs/src/littlefs/lfs.c:1229:error: Corrupted dir pair at {0x0, 0x1}
E (780) esp_littlefs: mount failed, (-84)
E (784) esp_littlefs: Failed to initialize LittleFS
[ 793][E][LittleFS.cpp:95] begin(): Mounting LittleFS failed! Error: -1
[Storage] Couldn't mount file system.

I have looked on the internet how to resolve this issue, but none of the answers online seem to apply to my situation.

This is probably the case because the file system on your ESP32 has not been formatted yet.

You should be able to fix this using this procedure in VSCode using PlatformIO. ESPEssentials uses the LittleFS file system by default, so please define that in your config file using board_build.filesystem = littlefs as described in the link above. You can just leave the data folder empty.

Alternatively you can use the ESP32 file system uploader plugin for the Arduino IDE, but I am not sure whether this supports the LittleFS file system or the Arduino IDE 2.0.

Please let me know if that helps you. I should probably make ESPEssentials automatically format the file system whenever this error occurs.

Actually I just released a fix for that. It should be available in the library manager within the next 24 hours I guess. So you might as well just wait for that. :)

Thank you very much for your quick response. I have already applied the changes in vscode and it works :-) Espessentials is really the first thing i put on an esp device because it makes the annoying stuff so easy. Thank you again for your time and help.

And today it got a little bit less annoying! Thank you too for reporting the problem! :)