Page 1 of 1

Cannot read files from LittleFS

Posted: Mon Sep 11, 2023 9:33 am
by viktak
Dear All,
I have been making (old) ESP32 based projects for some time now with no issues, but now I started my first ESP32-S3-mini-1 project and I noticed that the uploaded filesystem does not work.
When I make a simple web server to serve pages from PROGMEM or from an ordinary variable, it works fine:

Code: Select all

webServer.send(200, "text/html", "hello");
The same code fails as soon as I change it to take the HTML from a file uploaded as LittlFS:

Code: Select all

File f = LittleFS.open("/status.html", "r");
s = f.readString();
f.close();
webServer.send(200, "text/html", s);
The error message:

Code: Select all

[ 20094][E][WebServer.cpp:648] _handleRequest(): request handler not found
Truth be told, I get the same message on the old ESP32 too, but all the pages I have ever tried get processed and sent to the client correctly.

I use Platformio's Upload Filesystem Image function to upload my html files, just like with the old ESP32s..., and I also have this in platformio.ini:

Code: Select all

board_build.filesystem = littlefs
Is there anything special about the new S3 variant I am not aware of? Does anyone have a working example code I could try? I haven't found any sample code anywhere that is specifically written for the S3...

Thanks for any pointers in advance!

Re: Cannot read files from LittleFS

Posted: Mon Sep 11, 2023 6:02 pm
by lbernstone
Please test LittleFS with the LittleFS_Test example.
https://github.com/espressif/arduino-es ... S_test.ino
There are multiple types/sizes of flash available on the S3, so you must make sure you set the type & size correctly in your platformio.ini. There's an example at the top of this thread that looks correct for a mini.
https://www.reddit.com/r/esp32/comments ... latformio/

Re: Cannot read files from LittleFS

Posted: Tue Sep 12, 2023 10:13 am
by viktak
Thank you for the quick reply!

The first example, indeed works for me, which means now I have to see what I do differently. Thank you again!!!!