Very weird program behavior

This is the exact same program in Arduino.
It gives as output:
SPIFFS initialization succesfull

—Dir: /:
File name: /NotoSansBold-15.vlw
File name: /SansSerif36.vlw
File name: /NotoSansBold-36.vlw

listSPIFFS() here outputs:
—Dir: /:
File name: /NotoSansBold-36.vlw

So, it reports only the last file; what the h is going here?

When using just PlatformIO I can’t reproduce the problem. If I clone your repo and add the data folder from your previous repo GitHub - Aleph-Design/Test-IoT-Gadget and do a Uplaod filesystem + Upload + Monitor, the system behaves as expected

--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
0:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5828
entry 0x400806a8

SPIFFS available!

---Dir: /:
File name: /NotoSansBold-15.vlw
File name: /NotoSansBold-36.vlw
File name: /SansSerif36.vlw
Font file /NotoSansBold-36 not found!

--- exit ---

Note that you get the

Font file /NotoSansBold-36 not found!

error because your code does

pTft->loadFont("/NotoSansBold-36", SPIFFS);

but should be donig

pTft->loadFont("NotoSansBold-36", SPIFFS);

since the loadFont() function automatically adds the / prefix.

I then tested this on the Arduino IDE with the GitHub - lorol/arduino-esp32fs-plugin: Arduino plugin for uploading files to ESP32 file system plugin, creating an empty sektch, saving it, then going into that sketch’s folder (C:\Users\Max\Documents\Arduino\sketch_aug10a in my case), copying the data folder into it, selected “DOIT ESP32 DEVKIT V1” as my board, made sure Tools → Port is correct and also Tools → Partition Scheme was set to “Default 4MB SPIFFS” (this must be the same as the PlatformIO sketch is using, but for this board there was no other choice). Then I choose Tools → ESP32 Sketch Data Upload → SPIFFS

grafik

And after a succesfull upload

I restarted the PIO device monitor

--- Miniterm on COM4  115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5828
entry 0x400806a8

SPIFFS available!

---Dir: /:
File name: /NotoSansBold-15.vlw
File name: /NotoSansBold-36.vlw
File name: /SansSerif36.vlw
Font file /NotoSansBold-36 not found!

--- exit ---

to find that all the files are still there as expected.

So I can only guess what’s wrong here – maybe you are using a different Plugin, maybe a different version of it, maybe you’re having a different ESP32 core version installed that differs from PlatformIO’s (1.0.6). But as-is, I can’t reproduce the behavior you see.

EDIT: Corrected a mistake in the text where I selected the wrong board in the Arduino IDE. Selecting “ESP32 Dev Kit” while PlatformIO uses board = esp32doit-devkit-v1 will cause an error, in my case when I erase the flash, only upload the firmware via PlatformIO and the data via the Arduino IDE, the SPIFFS partition failed to be mounted.

This: “Partition Scheme was set to “Default 4MB SPIFFS” (this must be the same as the PlatformIO sketch is using)” seems to be my solution; at least for now.
I’m using the No_OTA partition scheme; small wonder that is won’t work.
After adding this scheme to platformio.ini all went well.
The output is now:
SPIFFS available!
—Dir: /:
File name: /NotoSansBold-15.vlw
File name: /SansSerif36.vlw
File name: /NotoSansBold-36.vlw

NOTE: There’s no error message from loadFont()!

Heck all mighty, this has given me a real hard time; it also kept me busy for a few days.
So, all you out there, watch out for the correct partition scheme. PlatformIO uses default scheme ‘default.csv’.

Max, many thanks for all your trouble.
And, as nearly always, I’m the culprit not platformIO.