Uploading index.html to ESP32


I tried rebuilding the intelliSense index, and it seems like everything is uploading, however, when trying to connect to my ESP32 and going to the local ip address it doesn’t seem to have the index.html page for me. I also followed instructions from here: ESP32 VS Code PlatformIO: Upload Files to Filesystem SPIFFS | Random Nerd Tutorials

This is the message I get when building and uploading. Is this an issue with platform IO?

Processing adafruit_feather_esp32s3_tft (platform: espressif32; board: adafruit_feather_esp32s3_tft; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/adafruit_feather_esp32s3_tft.html
PLATFORM: Espressif 32 (6.2.0) > Adafruit Feather ESP32-S3 TFT
HARDWARE: ESP32S3 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
 - framework-arduinoespressif32 @ 3.20008.0 (2.0.8)
 - tool-esptoolpy @ 1.40501.0 (4.5.1)
 - tool-mkfatfs @ 2.0.1
 - tool-mklittlefs @ 1.203.210628 (2.3) 
 - tool-mkspiffs @ 2.230.0 (2.30)
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
Warning! An extra UF2 bootloader image is already added!
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ deep, Compatibility ~ soft
Found 49 compatible libraries
Scanning dependencies...
Dependency Graph
|-- STM32duino VL53L4CD @ 1.0.2
|-- GFX Library for Arduino @ 1.3.5
|-- Adafruit ST7735 and ST7789 Library @ 1.10.0
|-- ESPAsyncWebServer-esphome @ 3.0.0
|-- Adafruit GFX Library @ 1.11.5
|-- LittleFS @ 2.0.0
|-- SPI @ 2.0.0
|-- WiFi @ 2.0.0
|-- Wire @ 2.0.0
Building in release mode
Building FS image from 'data' directory to .pio\build\adafruit_feather_esp32s3_tft\littlefs.bin
Looking for upload port...
Auto-detected: COM10
Forcing reset using 1200bps open/close on port COM10
Waiting for the new upload port...
Uploading .pio\build\adafruit_feather_esp32s3_tft\littlefs.bin
esptool.py v4.5.1
Serial port COM9
Chip is ESP32-S3 (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
MAC: f4:12:fa:59:a9:e0
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Configuring flash size...
Flash will be erased from 0x00310000 to 0x003fffff...
Compressed 983040 bytes to 2791...
Writing at 0x00310000... (100 %)
Wrote 983040 bytes (2791 compressed) at 0x00310000 in 8.4 seconds (effective 937.4 kbit/s)...
Hash of data verified.

Hard resetting via RTS pin...
========================================================================================= [SUCCESS] Took 15.52 seconds =========================================================================================

This is what’s contained in my platform.ini

platform = espressif32
board = adafruit_feather_esp32s3_tft
framework = arduino
lib_deps = `Preformatted text`
	stm32duino/STM32duino VL53L4CD@^1.0.2
	moononournation/GFX Library for Arduino@^1.3.5
	adafruit/Adafruit ST7735 and ST7789 Library@^1.10.0
monitor_speed = 115200
board_build.filesystem = littlefs

This is the code that contains littleFS

// Replaces placeholder with sensor values
String processor(const String& var){
  getSensor1Reading(status1, NewDataReady1);
  if(var == "DISTANCE"){
    return String(sensor1);
  else if(var =="OFFSET"){
    return String(offset);
  return String();
  getSensor2Reading(status2, NewDataReady2);
  if(var == "DISTANCE"){
    return String(sensor2);
  else if(var =="OFFSET"){
    return String(offset);
  return String();

/* Setup ---------------------------------------------------------------------*/
void setup()
  // Initialize serial for output.

  // Route for root / web page
  server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
    request->send(LittleFS, "/index.html", String(), false, processor);

  // Route to load style.css file, and script.js file
  server.serveStatic("/", LittleFS, "/");

  server.on("/distance", HTTP_GET, [](AsyncWebServerRequest *request){
    getSensor1Reading(status1, NewDataReady1);
    request->send_P(200, "text/plain", String(sensor2).c_str());

    server.on("/offset", HTTP_GET, [](AsyncWebServerRequest *request){
    request->send_P(200, "text/plain", String(offset).c_str());

  server.on("/zero", HTTP_GET, [] (AsyncWebServerRequest *request){
  Serial.println("Sensor Zeroed");

  server.on("/reset", HTTP_GET, [] (AsyncWebServerRequest *request){
  offset = 0;
  Serial.println("Offset Reset");

  // Initialize I2C bus.
  initSensors(sensor1_vl53l4cd_sat, sensor2_vl53l4cd_sat, sensor1add, sensor2add);

Test only the LittleFS system by itself using your current files and this sketch. Does it work?

I don’t seem to see anything being printed in my serial monitor

But in the previous sketch Serial output worked fine or not?

Yep I was getting live readings from sensors. I can post my full code if that helps. But I was printing 2 sensor readings + my local IP address and that worked fine.

I didn’t install littleFS from PIO’s library management tool as it said that ESP32s should have it as part of their core library now. Is this an issue?

Actually, the test may already be done running when the serial monitor is started too late. Below


can you add

while(!Serial) {}

? If the S3 chip doesn’t host the native USB output, also try pressing the reset button.

That did give me an output and it’s saying that LittleFS Mount Failed

In this new project, can you add in board_build.filesystem = littlefs and copy-paste the same data/ folder as your original project, then use “Upload FileSystem”?

Hmm, i started a new project and added the board_build.filesystem = littlefs to the platformio.ini then copy pasted the data folder and did the build and upload file system image but it seems to keep failing to mount.

Both the LittleFS test cpp code and the data/ folder should be in the same project right now, right? Not 2 different ones with one only having the .cpp and the other only having data.

Yep that’s correct, I have the data folder in the PIO project folder, and the main.cpp in the src folder.