sorry, I just attached the code file and the picture of the readings with the time stamp in my previous reply.
the loop takes around 1 second to complete.
I posted a part of the code in the beginning because my code has more than one mode, it has 2 modes or routines, the first one is to write to the memory card alone, the second mode is to write to the serial port and to the memory card at the same time, I didn't wanna make things complicated so others can focus on just one mode and therefore to pass some advice.
okay to make it clear, we don't have a PC in the laundry shop. and we are not willing to have, it needs to be standalone arduino and later on we take the data from the SD card.
"So what's the problem?"
in fact no problem except that I am trying to reach to a conclusion and a clear methodology of solving my problem.
"does the file really need to be 5Mb? "
yes, the file almost needs to be 5 MB or more
my data looks something like:
0:28:21,27.05,24.29,12.52,13.48
0:28:21,10.45,14.98,4.82,5.58
0:28:21,2.16,8.74,0.96,1.51
0:28:21,3.56,4.79,0.67,0.31
0:28:22,3.63,2.5,1.65,1.42
0:28:22,3.93,1.24,1.77,1.66
in one second (lets say 0:28:21) I have four lines
these four lines each line almost has 30 char which is 30 bytes
30 bytes * 4 is the data size for 1 second = 120 bytes
(120 * 60 sec *60 min *24 hour)/ (1024 to convert to KB *1024 to convert to MB ) = 9+ MB
how yours is just some Kbs ?
"what do you do with a 5Mb CSV file once it has been retrieved?"
I process these data using C#.net and analyse these data to know the healthiness of the machines and some other information like how many cycles of the machines have been done in one day , week ... and other things
"- are there periods of inactivity when a long download is feasible?
-
if there are, do these readings need to be recorded?
-
would it be a good idea not to record in these periods, even if the is no downloading?"
there is no inactivity times because customers may come and insert their coins (money ) under any second to run the machines, we can't stop the data logging. I mean like its all automated and there is no shop keeper.
"- does a few seconds of recording missed really matter?
- what is the download speed?"
it would be inconvenient if we missed readings for continuous seconds, for example to lose the data from second #0 to #60 is unacceptable, but to record seconds #0 , #2 , #4 , #6 ..... # 60 and lose #1, #3,#5.. is okay, because at least we can have some track of the data ?
what download speed ? do you mean the copying speed ?
the copying speed is almost the time to take out the memory card and insert it into the pc and get it back again. the actual copying process in the pc doesn't take timem the file is too small.