Sample project SD_Test, doesn't list files in 2nd level

Hi,

I have an issue with listing of files in SD card. Files and directories in the root folders are displayed, but 2nd level. 3rd level displays the following error. here directory name was 123456

Listing directory: /
  DIR : 123456
Listing directory: 123456
[  2110][E][vfs_api.cpp:29] open(): �������?���? does not start with /
Failed to open directory

Code lines which is generating this error from sample project. First call to ListDir is with level 0 displays files and folders in root, but next call to ListDir with level 2, generates the above error.

 listDir(SD, "/", 0);
    createDir(SD, "/mydir");
    listDir(SD, "/", 0);
    removeDir(SD, "/mydir");
    listDir(SD, "/", 2);
    writeFile(SD, "/hello.txt", "Hello ");
    appendFile(SD, "/hello.txt", "World!\n");
    readFile(SD, "/hello.txt");

Appreciate a solution/feedback on the subject.

[sterretje edit]
Removed the screaming bold.

What is reading root dir with level 2 ? Which folder should be listed with this command?

Shouldn't it be like this:

Please show exact name of the library you used.
Standard arduino "SD.h" library doesn't contain a method ListDir

Seed the sd card with the directory structure you want and add some test files on your PC. Get file reads to work first, then worry about creating files.

FYI:

  • Directory and file names MUST be DOS 8.3 compliant.
  • SD cards need to be 32gb or smaller.

Thanks,
ListDir is function in SD_Test example project from board library for ESP32.
This example project list files in root level, not 2nd or 3rd level.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.