Woah ! @peekay123 thanks for doing those calculations for me; definitely gives me more information to use!
Okay, so let me digest all of this . . . Also this is the first thing that came to mind on how to implement your mentioned method!
So lets say I have a text file like this, I would have my tail pointer “T” as such, and H wouldn’t be really needed, cause I’ll always write at the end of the text file.
Ttesting. 1, 2, 3.
Ttesting. 4, 5, 6.
Ttesting. 7, 8, 9.
So on the minute mark things would go down like this:
myFile = SD.open("test.txt", O_RDWR); //Since I'm at the end of the
//test.txt, no need to use seek() to find "H"
//for example this is the acquired data
myFile.println("testing. 1, 2, 3.");
myFile.seek(0); // go to the start
char X = myFile.peek();
if (X == T) unsigned long posit = myFile.position();
//---- then do the reading and sending ----//
//if success, file cursor SHOULD be at the start of the next "line"
unsigned long nextposit = myFile.position();
posit = nextposit;
//--then read again and send again--//
//-- if success again , repeat the above five lines --//
//------ rinse and repeat this until 50<=Time.second() AND the 5 above lines have finished running ------//
//-- THEN we do: --//
// ------------ on the NEXT minute , we look for the "T" and repeat the process -------//
So is it correct-ish, or is there a simple,er, way ?
Doing it with this method I guess size doesn’t matter ( ) If you’re saying SD speed, reading/writing, won’t be affected. Which I guess it wouldn’t be. But when I read through the file to find “T”, if the file is REALLY large won’t it take longer to look for it? My guess is your saying it might but it won’t be anything that affects performance such as missing the 50 sec timeout. And if by testing and such I find that a file can get too large, I can truncate it as you suggested!
Edit: I realize the code isn’t 100% few lines I left out here and there, BUT the general idea is there I believe