Page 1 of 1
File_ESP32_SDMode problem: file close is not working
Posted: Fri Nov 24, 2023 12:09 pm
by stefan.erni
Hi Ben
File_ESP32_SDMode is a fantastic component!
Very quick and easy to understand.
So fast that you can even use it to create csv file with a sample rate of a few Hz!
easy to open the file with excel later.

- Snag_f6617c.png (121.27 KiB) Viewed 6387 times
but there is a limitation with the number of file.
if I choose 4 then I can create 3 files, then my programme crashes
if I choose 5 then i can create 4 files, then crashed my programme.
I cannot set more than 5 files count.
I always try to close the files but unfortunately that doesn't work.
(on the file sd-card there was not a problem)
regards
Stefan

- Snag_f5678c.png (27.4 KiB) Viewed 6387 times
here the recordings on the micro sd-card dependent on file count.

- Snag_f57c9a.png (7.07 KiB) Viewed 6387 times

- Snag_f594f5.png (5.18 KiB) Viewed 6387 times
Here my program:
Re: File_ESP32_SDMode problem: file close is not working
Posted: Fri Dec 01, 2023 12:37 pm
by stefan.erni
Hi Ben
There is a problem with file close in the ile_ESP32_SDMode component.
I just want to create a file, open it, append data and close it again.
Then create a new file and do the same again.
But somehow it doesn't work.
As if the number of files opened at the same time is increased and more than 4 files are written to the sd-cards,
the programm crashes an reset.
regards
Stefan
Re: File_ESP32_SDMode problem: file close is not working
Posted: Fri Dec 22, 2023 8:59 am
by stefan.erni
Hi Ben
Is there a command to close the file with a c code where I can test?
Just 4 file are not enough to save on the sd-card
also a small problem:
I use the same macro with the "old" esp32 sd-card component to check what name becomes the next recordet file.
i open with a list of which files are already on the card.
If a file is available, I close the file and try to open the next one. Until I can't open a file, I have the next number for the filename.
look for the file on sd-card:

- Snag_83e39c.png (73.93 KiB) Viewed 5347 times
Re: File_ESP32_SDMode problem: file close is not working
Posted: Fri Dec 22, 2023 9:10 am
by Steve-Matrix
Hi Stefan,
I've not used that component, but have you tried limiting the file count to 4 and using a second component for files 5-8? It probably won't work and is not ideal, but is a quick thing to check.
Re: File_ESP32_SDMode problem: file close is not working
Posted: Fri Dec 22, 2023 9:34 am
by stefan.erni
Hi Steve
You've given me an idea... Thank you very much.
Yes but I don't need a second componet, but before each recording I un-initialisee the component and initialise the same again. That works !!!
Add this:

- Snag_a37ebc.png (36.48 KiB) Viewed 5339 times
More files...

- Snag_a41b4a.png (13.11 KiB) Viewed 5339 times
Re: File_ESP32_SDMode problem: file close is not working
Posted: Fri Dec 22, 2023 11:06 am
by Steve-Matrix
Excellent. Thanks for letting us know.