Closed TobbeG closed 1 month ago
Tried more files created just like above, just different names 2023-10-10_SE3.sdv 276B OK 2024-10-01_SE3.sdv 276B OK 2024-10-09_SE3.sdv 276B OK 2024-10-10_SE3.sdv 276B FAILS disappears after returning to main loop() and running getDiskInfo() there
I have done extensive tests and i can confirm there must be an error how filenames are handled i LittleFS
/2024-10-10_SE1.sdv is overwritten when /2024-10-10_SE2.sdv is created and written
/20241010_SE1.sdv is NOT overwritten when /20241010_SE2.sdv is created and written
/2024-10-10SE1.sdv is NOT overwritten when /2024-10-10SE2.sdv is created and written
/20241010SE1.sdv is NOT overwritten when /20241010SE2.sdv is created and written
Code section used for testing: //filename.replace("-",""); //filename.replace("",""); filename.replace("","_");
File f = FILESYSTEM.open(filename, FILE_WRITE);
if (f){
Serial.println(filename + " opened for writing"); unsigned long l = f.println("# Date(dd.mm.yyyy) " + d + "-" + m + "-" + y + " Prices from Entsoe " + getDate(0)); l += f.print("PR;SO;YYYY;WY;WD;" + d + "." + m + "." + y); l += f.print(";" + regions[region][0] + regions[region][1] + ";" + currency[regions[region][3].toInt()]); float sum = 0.0f; String t; for (int m = 0; m < 24; m++) { t = String(prices[m], 2); t.replace('.', ','); l += f.print(";" + t); sum += prices[m]; } t = String(sum / 24, 2); t.replace('.', ','); l += f.println(";" + t); f.close(); Serial.println(filename + " closed, wrote " + String(l) + " bytes\r\n");
}else{
Serial.println(filename + " write failed");
}
Serial.println(getDiskInfo());
Board
ESP32-S3
Device Description
Elecrow ESP32-S3 Terminal
Hardware Configuration
Nothing outside the ESP32-S3 terminal that has TFT/Touch display etc.,.
Version
latest master (checkout manually)
IDE Name
Arduino IDE 2.3.2
Operating System
Windows 11
Flash frequency
QIO 80MHz
PSRAM enabled
yes
Upload speed
921600
Description
File with specific filename disappears and is not shown in exists(filename) or able open for read It still takes up bytes from usedBytes() calling getDiskinfo directly after saving the file, lists it but after returning to loop() the same getDiskinfo does not show it
filename = "/2024-10-10_SE3.sdv" Disappears filename = "/2024_10_10_SE3.sdv" Works normal and exists and can be opened for read
Sketch
Debug Message
Other Steps to Reproduce
filename /2024-01-01_SE3.sdv works fine so it seems to related to -10-10 or something similar
I have checked existing issues, online documentation and the Troubleshooting Guide