File_ESP32_SDMode problem: file close is not working

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
stefan.erni
Valued Contributor
Posts: 758
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

File_ESP32_SDMode problem: file close is not working

Post 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
Snag_f6617c.png (121.27 KiB) Viewed 3675 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
Snag_f5678c.png (27.4 KiB) Viewed 3675 times
here the recordings on the micro sd-card dependent on file count.
Snag_f57c9a.png
Snag_f57c9a.png (7.07 KiB) Viewed 3675 times
Snag_f594f5.png
Snag_f594f5.png (5.18 KiB) Viewed 3675 times
Here my program:
Sparkfun_logger1.fcfx
(86.26 KiB) Downloaded 196 times

stefan.erni
Valued Contributor
Posts: 758
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

Re: File_ESP32_SDMode problem: file close is not working

Post 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

stefan.erni
Valued Contributor
Posts: 758
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

Re: File_ESP32_SDMode problem: file close is not working

Post 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
Snag_83e39c.png (73.93 KiB) Viewed 2635 times

Steve-Matrix
Matrix Staff
Posts: 1253
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 167 times
Been thanked: 277 times

Re: File_ESP32_SDMode problem: file close is not working

Post 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.

stefan.erni
Valued Contributor
Posts: 758
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

Re: File_ESP32_SDMode problem: file close is not working

Post 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
Snag_a37ebc.png (36.48 KiB) Viewed 2627 times
More files...
Snag_a41b4a.png
Snag_a41b4a.png (13.11 KiB) Viewed 2627 times

Steve-Matrix
Matrix Staff
Posts: 1253
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 167 times
Been thanked: 277 times

Re: File_ESP32_SDMode problem: file close is not working

Post by Steve-Matrix »

Excellent. Thanks for letting us know.

Post Reply