Go Down

Topic: Problem with FileIO (Read 435 times) previous topic - next topic

marc_behm

Hello,

i have some problems to write some data to the sd-card on my YUN.

Here the relevant code:

Code: [Select]

File dataFile = FileSystem.open(dateipfad.c_str(), FILE_APPEND);
  if (dataFile) {
    dataFile.println(String(zeit));
    dataFile.close();
  }
  else {
    Seria.println("error opening file");
  }


The first attempt is always successful and the value is written to the file. At the 2nd run the "dataFile.println" and "dataFile.close" function took very long. Finally at the 3rd attempt the system isn't able to open the file?!

Any suggestions??

thx

jessemonroy650

#1
Apr 18, 2015, 10:29 pm Last Edit: Apr 18, 2015, 10:30 pm by jessemonroy650
::::SNIP::::
The first attempt is always successful and the value is written to the file. At the 2nd run the "dataFile.println" and "dataFile.close" function took very long. Finally at the 3rd attempt the system isn't able to open the file?!

Any suggestions??
::::SNIP::::
@marc_behm,
it appears you have some bad bits. It may be on the SD or it might be memory.

Things to try:

1) try the read/write several times. See if you can repeat the error?
2) SSH into the Yun and at the command line run fsck.
3) or You could have a loose wire on the SD connector.

Lastly, please post your logs or code with markup (see image).

Jesse

Go Up