SD Library Version 1.2.0 problem


it seems that the new version 1.2.0 of the SD library recently released has changed the modality to write file data to the SD card.
If I run the Datalogger example, with the version 1.1.1 new data are appended to the previous ones in a new text line, but with the new version every writing cicle overwrites the data on the same (first) text line.

Did anybody have a similar problem?

I suspect this was the cause of the change:

Try this, change line 62 from:

 File dataFile ="datalog.txt", FILE_WRITE);


 File dataFile ="datalog.txt", O_APPEND);

Let me know what the results are of that. If this is causing the sketch to not work as expected then I'll try to get it fixed. At the very least the library documentation needs to be updated since it only mentions FILE_READ and FILE_WRITE as valid values for the mode parameter of

Issue tracker report related to this subject:


 File dataFile ="datalog.txt", FILE_WRITE);


File dataFile ="datalog.txt", O_APPEND);

is not the solution, sketch stops and the Serial monitor shows:
"error opening datalog.txt"

Try this:

File dataFile ="datalog.txt", O_READ | O_APPEND | O_CREAT);

I had the same problem. My code stopped working this weekend and it took me a while to realize that the library updated. I just rolled back to 1.1.0 as it should not be necessary to modify my code. I can see where it would be nice to have the added options, but default should work the same way it has always had.

suggested code:

File dataFile ="datalog.txt", O_READ | O_APPEND | O_CREAT);

neither fix the problem.
I’ve downgraded as well to Version 1.1.1, I will stick with it until new documentation is available

neither fix the problem.

What does it do?

Nothing, no error but also no writing to file

I have this problem too!
I'm back to use the 1.1.1 version...

Version 1.2.1 released! and work fine!

I can confirm, problem fixed with Version 1.2.1, thanks!